pastojs: set Scanner.AllowedModeSwitches

git-svn-id: trunk@35939 -
This commit is contained in:
Mattias Gaertner 2017-04-24 16:58:08 +00:00
parent dbbeec54de
commit 89b839d341
2 changed files with 5 additions and 1 deletions

View File

@ -246,7 +246,6 @@ Works:
- use 0o for octal literals
ToDos:
- overload: jsvalue last,
- constant evaluation
- integer ranges
- static arrays
@ -262,6 +261,7 @@ ToDos:
- make -Jirtl.js default for -Jc and -Tnodejs, needs #IFDEF in cfg
- FuncName:= (instead of Result:=)
- $modeswitch -> define <modeswitch>
- scanner: define list of allowed modeswitches
- $modeswitch- -> turn off
- check memleaks
- @@ compare method in delphi mode
@ -779,6 +779,9 @@ type
//------------------------------------------------------------------------------
// TPas2JSResolver
const
msAllPas2jsModeSwitches = [msDelphi,msFpc,msObjfpc,
msExternalClass,msHintDirective,msNestedComment];
btAllJSBaseTypes = [
btChar,
btString,

View File

@ -652,6 +652,7 @@ begin
FFileResolver:=TStreamResolver.Create;
FFileResolver.OwnsStreams:=True;
FScanner:=TPascalScanner.Create(FFileResolver);
FScanner.AllowedModeSwitches:=msAllPas2jsModeSwitches;
FEngine:=AddModule(Filename);
FParser:=TTestPasParser.Create(FScanner,FFileResolver,FEngine);
Parser.Options:=Parser.Options+po_pas2js;