Mark tokens with the file position from where they're read. Restore this

position for tokens read from a token list. This means that line info does
now show the actual point of definition. This is an improvement but needs to
be refined.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4911 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-01-20 20:54:30 +00:00
parent ddb7296b6c
commit 3b59a8ca6f
8 changed files with 67 additions and 58 deletions

View File

@@ -49,17 +49,14 @@
/*****************************************************************************/
/* Data */
/*****************************************************************************/
/* Struct holding a token */
typedef struct TokNode TokNode;
struct TokNode {
TokNode* Next; /* For single linked list */
token_t Tok; /* Token value */
int WS; /* Whitespace before token? */
long IVal; /* Integer token attribute */
StrBuf SVal; /* String attribute, dyn. allocated */
Token T; /* Token value */
};
/* Struct holding a token list */
@@ -95,13 +92,13 @@ enum TC {
TokNode* NewTokNode (void);
/* Create and return a token node with the current token value */
void FreeTokNode (TokNode* T);
void FreeTokNode (TokNode* N);
/* Free the given token node */
void TokSet (TokNode* T);
void TokSet (TokNode* N);
/* Set the scanner token from the given token node */
enum TC TokCmp (const TokNode* T);
enum TC TokCmp (const TokNode* N);
/* Compare the token given as parameter against the current token */
void InitTokList (TokList* T);