fix(lexer): $# and backslash implemented (partial version)
This commit is contained in:
parent
0c80663d7c
commit
e853249fbf
3 changed files with 15 additions and 11 deletions
|
|
@ -100,10 +100,10 @@ struct token *peek_token(struct lexer_context *ctx)
|
|||
if (!update_lexing_mode(stream, i, &lexing_mode)
|
||||
&& lexing_mode == LEXER_NORMAL)
|
||||
{
|
||||
if (is_special_char(stream[i]))
|
||||
if (is_special_char(stream, i))
|
||||
{
|
||||
if (i == 0) // where we create spe_char token
|
||||
i++;
|
||||
i += len_op_sepchar(stream, i);
|
||||
break;
|
||||
}
|
||||
if (isblank(stream[i]))
|
||||
|
|
@ -159,10 +159,7 @@ struct token *pop_token(struct lexer_context *ctx)
|
|||
if (!update_lexing_mode(stream, i, &lexing_mode)
|
||||
&& lexing_mode == LEXER_NORMAL)
|
||||
{
|
||||
// TODO call here a function
|
||||
// it must check if is a spe char or an operator
|
||||
// and sets i accordingly.
|
||||
if (is_special_char(stream[i]))
|
||||
if (is_special_char(stream, i))
|
||||
{
|
||||
if (i == 0) // where we create spe_char token
|
||||
i += len_op_sepchar(stream, i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue