فهرست منبع

* support storing the scanner state when the current token is _ID
* recognise that we can't store the scanner state yet when the current
token is _CSTRING

git-svn-id: branches/jvmbackend@21056 -

Jonas Maebe 13 سال پیش
والد
کامیت
ca57ab2c99
1فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 5 2
      compiler/symcreat.pas

+ 5 - 2
compiler/symcreat.pas

@@ -40,6 +40,7 @@ interface
       old_c: char;
       old_c: char;
       old_orgpattern: string;
       old_orgpattern: string;
       old_modeswitches: tmodeswitches;
       old_modeswitches: tmodeswitches;
+      old_idtoken: ttoken;
       valid: boolean;
       valid: boolean;
     end;
     end;
 
 
@@ -131,8 +132,8 @@ implementation
     var
     var
       old_block_type: tblock_type;
       old_block_type: tblock_type;
     begin
     begin
-      { would require saving of idtoken, pattern etc }
-      if (token=_ID) or
+      { would require saving of cstringpattern, patternw }
+      if (token=_CSTRING) or
          (token=_CWCHAR) or
          (token=_CWCHAR) or
          (token=_CWSTRING) then
          (token=_CWSTRING) then
         internalerror(2011032201);
         internalerror(2011032201);
@@ -142,6 +143,7 @@ implementation
       sstate.old_c:=c;
       sstate.old_c:=c;
       sstate.old_orgpattern:=orgpattern;
       sstate.old_orgpattern:=orgpattern;
       sstate.old_modeswitches:=current_settings.modeswitches;
       sstate.old_modeswitches:=current_settings.modeswitches;
+      sstate.old_idtoken:=idtoken;
       sstate.valid:=true;
       sstate.valid:=true;
       { creating a new scanner resets the block type, while we want to continue
       { creating a new scanner resets the block type, while we want to continue
         in the current one }
         in the current one }
@@ -166,6 +168,7 @@ implementation
           c:=sstate.old_c;
           c:=sstate.old_c;
           orgpattern:=sstate.old_orgpattern;
           orgpattern:=sstate.old_orgpattern;
           pattern:=upper(sstate.old_orgpattern);
           pattern:=upper(sstate.old_orgpattern);
+          idtoken:=sstate.old_idtoken;
         end;
         end;
     end;
     end;