Fixed a problem where multi-line C comments with blank lines in them were causing incorrect line number reporting.
git-svn-id: http://picoc.googlecode.com/svn/trunk@471 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
036f3efa8b
commit
4ecfc1c66b
3
lex.c
3
lex.c
|
@ -362,7 +362,6 @@ enum LexToken LexGetCharacterConstant(struct LexState *Lexer, struct Value *Valu
|
|||
/* skip a comment - used while scanning */
|
||||
void LexSkipComment(struct LexState *Lexer, char NextChar, enum LexToken *ReturnToken)
|
||||
{
|
||||
LEXER_INC(Lexer);
|
||||
if (NextChar == '*')
|
||||
{
|
||||
/* conventional C comment */
|
||||
|
@ -454,7 +453,7 @@ enum LexToken LexScanGetToken(struct LexState *Lexer, struct Value **Value)
|
|||
case '+': NEXTIS3('=', TokenAddAssign, '+', TokenIncrement, TokenPlus); break;
|
||||
case '-': NEXTIS4('=', TokenSubtractAssign, '>', TokenArrow, '-', TokenDecrement, TokenMinus); break;
|
||||
case '*': NEXTIS('=', TokenMultiplyAssign, TokenAsterisk); break;
|
||||
case '/': if (NextChar == '/' || NextChar == '*') LexSkipComment(Lexer, NextChar, &GotToken); else NEXTIS('=', TokenDivideAssign, TokenSlash); break;
|
||||
case '/': if (NextChar == '/' || NextChar == '*') { LEXER_INC(Lexer); LexSkipComment(Lexer, NextChar, &GotToken); } else NEXTIS('=', TokenDivideAssign, TokenSlash); break;
|
||||
case '%': NEXTIS('=', TokenModulusAssign, TokenModulus); break;
|
||||
case '<': if (Lexer->Mode == LexModeHashInclude) GotToken = LexGetStringConstant(Lexer, *Value, '>'); else { NEXTIS3PLUS('=', TokenLessEqual, '<', TokenShiftLeft, '=', TokenShiftLeftAssign, TokenLessThan); } break;
|
||||
case '>': NEXTIS3PLUS('=', TokenGreaterEqual, '>', TokenShiftRight, '=', TokenShiftRightAssign, TokenGreaterThan); break;
|
||||
|
|
Loading…
Reference in a new issue