git-svn-id: trunk@40486 -
@@ -2060,6 +2060,12 @@ function TPas2jsPasScanner.HandleInclude(const Param: String): TToken;
SetCurTokenString(''''+s+'''');
end;
+ procedure SetInteger(const i: TMaxPrecInt);
+ begin
+ Result:=tkNumber;
+ SetCurTokenString(IntToStr(i));
+ end;
+
var
Year, Month, Day, Hour, Minute, Second, MilliSecond: word;
i: Integer;
@@ -2101,6 +2107,11 @@ begin
SetStr(IntToStr(CurRow));
exit;
+ '%linenum%':
+ SetInteger(CurRow);
+ exit;
'%currentroutine%':
begin
if Resolver<>nil then
@@ -2263,9 +2263,12 @@ procedure TTestModule.TestIncludeVersion;
StartProgram(false);
Add([
- 'var s: string;',
+ 'var',
+ ' s: string;',
+ ' i: word;',
'begin',
' s:={$I %line%};',
+ ' i:={$I %linenum%};',
' s:={$I %currentroutine%};',
' s:={$I %pas2jsversion%};',
' s:={$I %pas2jstarget%};',
@@ -2274,9 +2277,12 @@ begin
'']);
ConvertProgram;
CheckSource('TestIncludeVersion',
+ LinesToStr([
'this.s="";',
+ 'this.i = 0;']),
LinesToStr([
- '$mod.s = "5";',
+ '$mod.s = "7";',
+ '$mod.i = 8;',
'$mod.s = "<anonymous>";',
'$mod.s = "Comp.Ver.tcmodules";',
'$mod.s = "Browser";',