mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 17:19:33 +02:00
* 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 -
This commit is contained in:
parent
0659058e44
commit
ca57ab2c99
@ -40,6 +40,7 @@ interface
|
||||
old_c: char;
|
||||
old_orgpattern: string;
|
||||
old_modeswitches: tmodeswitches;
|
||||
old_idtoken: ttoken;
|
||||
valid: boolean;
|
||||
end;
|
||||
|
||||
@ -131,8 +132,8 @@ implementation
|
||||
var
|
||||
old_block_type: tblock_type;
|
||||
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=_CWSTRING) then
|
||||
internalerror(2011032201);
|
||||
@ -142,6 +143,7 @@ implementation
|
||||
sstate.old_c:=c;
|
||||
sstate.old_orgpattern:=orgpattern;
|
||||
sstate.old_modeswitches:=current_settings.modeswitches;
|
||||
sstate.old_idtoken:=idtoken;
|
||||
sstate.valid:=true;
|
||||
{ creating a new scanner resets the block type, while we want to continue
|
||||
in the current one }
|
||||
@ -166,6 +168,7 @@ implementation
|
||||
c:=sstate.old_c;
|
||||
orgpattern:=sstate.old_orgpattern;
|
||||
pattern:=upper(sstate.old_orgpattern);
|
||||
idtoken:=sstate.old_idtoken;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user