mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-06-10 07:29:32 +00:00
Allow invalid escape sequences and UCN-like sequences in skipped code.
The standard wording is not always clear on these cases, but I think at least some of them should be allowed and others may be undefined behavior (which we can choose to allow). At any rate, this allows non-standard escape sequences targeted at other compilers to appear in skipped-over code. There probably ought to be similar handling for #defines that are never expanded, but that would require more code changes.
This commit is contained in:
parent
438942692a
commit
9c04b94093
|
@ -3654,6 +3654,7 @@ while digits > 0 do begin
|
|||
digits := digits - 1;
|
||||
end {while}
|
||||
else begin
|
||||
if not skipping then
|
||||
Error(145);
|
||||
codePoint := $0000C0;
|
||||
digits := 0;
|
||||
|
@ -4263,6 +4264,7 @@ var
|
|||
NextCh;
|
||||
end; {while}
|
||||
if (val & $FF00) <> 0 then
|
||||
if not skipping then
|
||||
Error(162);
|
||||
EscapeCh := val & $FF;
|
||||
skipChar := false;
|
||||
|
@ -4290,6 +4292,7 @@ var
|
|||
end; {else}
|
||||
val := (val << 4) | dig;
|
||||
if (val & $FF00) <> 0 then begin
|
||||
if not skipping then
|
||||
Error(162);
|
||||
val := 0;
|
||||
end; {if}
|
||||
|
@ -4306,6 +4309,7 @@ var
|
|||
EscapeCh := chFromUCN
|
||||
else begin
|
||||
EscapeCh := 0;
|
||||
if not skipping then
|
||||
Error(146);
|
||||
end; {else}
|
||||
end;
|
||||
|
@ -4313,6 +4317,7 @@ var
|
|||
otherwise: Error(57);
|
||||
end {case}
|
||||
else begin
|
||||
if not skipping then
|
||||
Error(162);
|
||||
EscapeCh := ord(ch);
|
||||
end; {else}
|
||||
|
|
Loading…
Reference in New Issue
Block a user