lexer: Fix implementation of lex_force_string_or_id().
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 21 Feb 2018 19:33:23 +0000 (11:33 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 21 Feb 2018 19:37:30 +0000 (11:37 -0800)
Change a test to make sure that it works.

Found by inspection.

src/language/lexer/lexer.c
tests/language/control/do-repeat.at

index 5c61c8def41fd2780dfda3c6aecff68f449c9190..a3642f8a6c6f7e7f5fc5b9376ee31db8308e9efa 100644 (file)
@@ -644,7 +644,7 @@ lex_force_string (struct lexer *lexer)
 bool
 lex_force_string_or_id (struct lexer *lexer)
 {
-  return lex_is_integer (lexer) || lex_force_string (lexer);
+  return lex_token (lexer) == T_ID || lex_force_string (lexer);
 }
 
 /* If the current token is an integer, does nothing and returns true.
index 4afd5eaf52e5798c1dbc5a50a5d917277c224259..e52b7ad999119da45f8a5bd84254e896de681335 100644 (file)
@@ -88,7 +88,7 @@ END FILE.
 END INPUT PROGRAM.
 
 DO REPEAT x = 1 2 3.
-INCLUDE 'include.sps'.
+INCLUDE include.sps.
 END REPEAT.
 
 LIST.