mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-07 20:46:06 +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_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 }
|
{ would require saving of cstringpattern, patternw }
|
||||||
if (token=_ID) or
|
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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user