slang: Correctly handle end of tokens marker.
authorMichal Krol <michal@vmware.com>
Tue, 8 Sep 2009 11:32:20 +0000 (13:32 +0200)
committerMichal Krol <michal@vmware.com>
Tue, 8 Sep 2009 11:32:20 +0000 (13:32 +0200)
src/mesa/shader/grammar/grammar.c
src/mesa/shader/slang/library/slang_shader.syn
src/mesa/shader/slang/library/slang_shader_syn.h

index 36ed9d5603b25865d34177d795f8470b25120c81..54e94bbf6a9577a88af2782916f0e8bc3372e926 100644 (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;
index 4558ed58b0727f36791f61e8afa00180fdd2a68d..f6bf7f1e5462e4868954f0a816c144ff9224947f 100644 (file)
@@ -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;
 
 
 /*
index e94238e0125e736a4f0b3815a24426edafc278c6..9a56643d2f1ba7b9078952e2188cd844bbd376ae 100644 (file)
 " 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"