Basic tests for macros and arguments pass.
[pspp] / src / language / lexer / lexer.c
index f577c598b89c9bf5a0ce939e94476feef5cfd417..534ed077e1b2a6ae3d54f13c7241100a9f583bd9 100644 (file)
@@ -216,6 +216,7 @@ lex_push_token__ (struct lex_source *src)
 
   token = &src->tokens[deque_push_front (&src->deque)];
   token->token = (struct token) { .type = T_STOP };
+  token->from_macro = false;
   return token;
 }
 
@@ -972,6 +973,12 @@ lex_next_representation (const struct lexer *lexer, int n0, int n1)
   return lex_source_get_syntax__ (lex_source__ (lexer), n0, n1);
 }
 
+bool
+lex_next_is_from_macro (const struct lexer *lexer, int n)
+{
+  return lex_next__ (lexer, n)->from_macro;
+}
+
 static bool
 lex_tokens_match (const struct token *actual, const struct token *expected)
 {