Fix for Mantis #25215.

compiler/scanner.pas, tscannerfile.readtoken:
  * after trying to read a _INTCONST check whether a valid first character for an identifier follows and give a syntax error if that is not the case

+ added test

git-svn-id: trunk@25835 -
This commit is contained in:
svenbarth 2013-10-20 12:15:49 +00:00
parent d91d4afb0f
commit d908dbeec1
3 changed files with 13 additions and 0 deletions

1
.gitattributes vendored
View File

@ -12486,6 +12486,7 @@ tests/webtbf/tw24495.pp svneol=native#text/pascal
tests/webtbf/tw24588.pp svneol=native#text/pascal
tests/webtbf/tw2478.pp svneol=native#text/plain
tests/webtbf/tw25029.pp svneol=native#text/pascal
tests/webtbf/tw25215.pp svneol=native#text/pascal
tests/webtbf/tw2562.pp svneol=native#text/plain
tests/webtbf/tw2657.pp svneol=native#text/plain
tests/webtbf/tw2670.pp svneol=native#text/plain

View File

@ -4549,6 +4549,9 @@ type
readnumber;
if length(pattern)=1 then
begin
{ does really an identifier follow? }
if not (c in ['_','A'..'Z','a'..'z']) then
message2(scan_f_syn_expected,tokeninfo^[_ID].str,c);
readstring;
token:=_ID;
idtoken:=_ID;

9
tests/webtbf/tw25215.pp Normal file
View File

@ -0,0 +1,9 @@
{ %FAIL }
program tw25215;
var
&:integer;
begin
writeln(&);
//readln;
end.