slang: Correctly handle end of tokens marker.

This commit is contained in:
Michal Krol
2009-09-08 13:32:20 +02:00
parent 2ec2936454
commit fab99092a0
3 changed files with 4 additions and 2 deletions
+2
View File
@@ -2069,6 +2069,8 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb
s->m_token = SL_PP_IDENTIFIER;
} else if (!strcmp(s->m_string, "@NUM")) {
s->m_token = SL_PP_NUMBER;
} else if (!strcmp(s->m_string, "@EOF")) {
s->m_token = SL_PP_EOF;
} else {
spec_destroy(&s);
return 1;
@@ -1291,7 +1291,7 @@ var_with_field
*/
translation_unit
.true .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and
.loop external_declaration .and '\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;
.loop external_declaration .and "@EOF" .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;
/*
@@ -601,7 +601,7 @@
" variable_identifier .and dot .and field_selection .emit OP_FIELD;\n"
"translation_unit\n"
" .true .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and\n"
" .loop external_declaration .and '\\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;\n"
" .loop external_declaration .and \"@EOF\" .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;\n"
"external_declaration\n"
" precision_stmt .emit DEFAULT_PRECISION .or\n"
" function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or\n"