Currently:
If Err Then MsgBox "Can't open ""core.vbs""" : Exit Sub
renders:
if (Err)
MsgBox('Can\'t open "core.vbs"');
return;
This was fixed in scripting/ebnf and merged into master.
Currently:
If VPBuildVersion < 0 Or Err Then
x = 5
End If
renders:
if (VPBuildVersion < 0 | Err) {
x = 5;
}
This was fixed in scripting/ebnf as a logical or expression (||) and merged into master.
JavaScript has classes but does not support fields.
Classes were implemented in scripting/ebnf and merged into master. ProperyDecl's were implemented as methods.
Controller.Switch(swLRFlip) = True
should probably render in JavaScript:
Controller.Switch[swLRFlip] = true;
Do we need to make a second pass, to grab a collection of all variables in relation to their position on the stack. If we find a subcall that matches a variable name, switch statement to array
This was implemented in scripting/ebnf and merged into master.
result(0, 0, 0) = 42 --> _scope.result[0][0][0] = 42
For example, does Switch cause issues?
You could do a second pass, and all identifiers that match keywords, auto append something
or
maybe it can altered directly in the id helper post processor?
No updates were made as this does not seem to be an issue.
Currently these are just ignored. In JavaScript, only objects are passed by reference
Currently:
Redim x(5, 5)
Redim Preserve x(5, 10)
renders:
let x = vbsHelper.redim(x, [
5,
5
]);
let x = vbsHelper.redim(x, [
5,
10
], true);
And would fail with:
Identifier 'x' has already been declared
This was implemented in scripting/ebnf and merged into master.
redim is no longer implemented as variable declaration.
These were implemented in scripting/ebnf and merged into master.
Step is a keyword in Visual Basic, but not VBScript. Option Explicit is ignored and only allowed as first line in program. Erase has been implemented as a dim`
Currently they are just rendered as comments:
; // On Error Resume Next
**This was implemented in scripting/ebnf and merged into master.
Currently WPC.vbs contains 0x93 and 0x94 in a comment:
'Everytime you press the flipper keys those switches are <93>on<94>,
This was implemented in scripting/ebnf and merged into master. The parser is now based on node-ebnf. The program is first parsed into tokens (as per microsoft docs), formatted, and then standardized.
Example:
should render as:
This was implemented in scripting/ebnf and merged into master. Related to above, after the script if formatted and standardized, no extra whitespace is present.
Currently all are rendered as null
This was implemented in scripting/ebnf and merged into master. Nothing, Null, and Empty now have __stdlib members that represent null and undefined.
| QualifiedID _ IndexOrParamsList %dot LeftExprTail _ SubSafeExprOpt _ CommaExprList {% ppSubCall.stmt6 %}
| QualifiedID _ IndexOrParamsListDot LeftExprTail _ SubSafeExprOpt _ CommaExprList {% ppSubCall.stmt7 %}
| QualifiedID _ IndexOrParamsList %dot LeftExprTail _ SubSafeExprOpt {% ppSubCall.stmt8 %}
| QualifiedID _ IndexOrParamsListDot LeftExprTail _ SubSafeExprOpt {% ppSubCall.stmt9 %}
Need to confirm, but I believe IndexOrParamsListDot vs IndexOrParamsList %dot was intended to allow for whitespace a.b(1). c(2, 3)
This was fixed in scripting/ebnf and merged into master. Since the parser is now based on EBNF and microsoft specs, this is no longer relevant.
These are required for multiple object subcalls:
ExecuteGlobal fso.OpenTextFile("VPMKeys.vbs", 1).ReadAll
that renders as:
ExecuteGlobal(fso.OpenTextFile('VPMKeys.vbs', 1).ReadAll);
ie, should ReadAll be ReadAll()?
This was fixed in scripting/ebnf and merged into master. Since the parser is now based on EBNF and microsoft specs, this is no longer relevant. See InvocationExpression and InvocationMemberAccessExpression
This was fixed in scripting/ebnf and merged into master.
http://www.herongyang.com/VBScript/Data-Type-Date-and-Time-Data-Literal.html
You can just do a time portion: #21:26:00#
**This was fixed in scripting/ebnf and merged into master. Since the parser is now based on microsoft specs, the date grammar is accurate. **
This was fixed in scripting/ebnf and merged into master. Since the parser is now based on EBNF and microsoft specs, this is no longer relevant.
https://www.promotic.eu/en/pmdoc/ScriptLangs/VBScript/Operat/Imp.htm
arg1
leftExpr1
leftExprTail1
qualifiedId2
indexOrParamsDot2
indexOrParamsDot4
This was fixed in scripting/ebnf and merged into master. Since the parser is now based on EBNF and microsoft specs, this is no longer relevant.
vpmSystemHelp = "Zaccaria keys:" & vbNewLine &_
vpmKeyName(keyInsertCoin1) & vbTab & "Insert Coin #1" & vbNewLine &_
vpmKeyName(keyInsertCoin2) & vbTab & "Insert Coin #2" & vbNewLine &_
vpmKeyName(keySelfTest) & vbTab & "Open Coin Door" & vbNewLine &_
vpmKeyName(keyAdvance) & vbTab & "Advance Test"
renders as:
vpmSystemHelp = 'Zaccaria keys:' + vbNewLine + vpmKeyName(keyInsertCoin1) + vbTab + 'Insert Coin #1' + vbNewLine + vpmKeyName(keyInsertCoin2) + vbTab + 'Insert Coin #2' + vbNewLine + vpmKeyName(keySelfTest) + vbTab + 'Open Coin Door' + vbNewLine + vpmKeyName(keyAdvance) + vbTab + 'Advance Test';
This was fixed in scripting/ebnf and merged into master. Since the parser first formats the script all line continuations merged into one line.
Do we need to implement ~ in certain cases?
This was fixed in scripting/ebnf and merged into master. Not was implemented as !
If aNo < mSize Then mKick(aNo + 1).Kick 0, 0
This was fixed in scripting/ebnf and merged into master. Since the parser is now EBNF based, this is no longer an issue.
Currently:
renders:
This was fixed in
scripting/ebnfand merged intomaster.Currently:
renders:
This was fixed in
scripting/ebnfas a logical or expression (||) and merged intomaster.ClassDecl,MemberDeclList,MemberDecl,PropertyDecl, andPropertyAccessTypeJavaScript has
classesbut does not supportfields.Classes were implemented in
scripting/ebnfand merged intomaster. ProperyDecl's were implemented as methods.arrayvscall. For example:should probably render in JavaScript:
Do we need to make a second pass, to grab a collection of all variables in relation to their position on the stack. If we find a
subcallthat matches a variable name, switch statement toarrayThis was implemented in
scripting/ebnfand merged intomaster.result(0, 0, 0) = 42 --> _scope.result[0][0][0] = 42
Idthat might match JavaScript keywords.For example, does
Switchcause issues?You could do a second pass, and all identifiers that match keywords, auto append something
or
maybe it can altered directly in the
idhelper post processor?No updates were made as this does not seem to be an issue.
ByRef&ByVal.Currently these are just ignored. In JavaScript, only objects are passed by reference
Redimneeds to be fixed.Redimdoes not first require aDim. Should we make a second pass and look for any previousDimor additionalRedimand change to assignment statements.Currently:
renders:
And would fail with:
This was implemented in
scripting/ebnfand merged intomaster.redim is no longer implemented as variable declaration.
Default,Erase,Error,Explicit,Step,Private,PublicThese were implemented in
scripting/ebnfand merged intomaster.Step is a keyword in Visual Basic, but not VBScript. Option Explicit is ignored and only allowed as first line in program. Erase has been implemented as a dim`
Currently they are just rendered as comments:
**This was implemented in
scripting/ebnfand merged intomaster.Currently
WPC.vbscontains 0x93 and 0x94 in a comment:'Everytime you press the flipper keys those switches are <93>on<94>,This was implemented in
scripting/ebnfand merged intomaster. The parser is now based on node-ebnf. The program is first parsed into tokens (as per microsoft docs), formatted, and then standardized.Example:
should render as:
This was implemented in
scripting/ebnfand merged intomaster. Related to above, after the script if formatted and standardized, no extra whitespace is present.NothingvsNullvsEmptyliterals.Currently all are rendered as
nullThis was implemented in
scripting/ebnfand merged intomaster. Nothing, Null, and Empty now have __stdlib members that represent null and undefined.SubCallStmtin grammar, and determine howSubSafeExprOptis meant to be usedNeed to confirm, but I believe
IndexOrParamsListDotvsIndexOrParamsList %dotwas intended to allow for whitespacea.b(1). c(2, 3)This was fixed in
scripting/ebnfand merged intomaster. Since the parser is now based on EBNF and microsoft specs, this is no longer relevant.LeftExprandLeftExprTailThese are required for multiple object subcalls:
that renders as:
ie, should
ReadAllbeReadAll()?This was fixed in
scripting/ebnfand merged intomaster. Since the parser is now based on EBNF and microsoft specs, this is no longer relevant. See InvocationExpression and InvocationMemberAccessExpressionCallStmtin grammarThis was fixed in
scripting/ebnfand merged intomaster.Dateliteral. This may require avbsHelperfunction because according tohttp://www.herongyang.com/VBScript/Data-Type-Date-and-Time-Data-Literal.html
You can just do a time portion:
#21:26:00#**This was fixed in
scripting/ebnfand merged intomaster. Since the parser is now based on microsoft specs, the date grammar is accurate. **KeywordIDandSafeKeywordIDin the Rosetta Code grammar is trying to doThis was fixed in
scripting/ebnfand merged intomaster. Since the parser is now based on EBNF and microsoft specs, this is no longer relevant.Implogical implication function. This will need to be done as avbsHelperas javascript does not have this built in:https://www.promotic.eu/en/pmdoc/ScriptLangs/VBScript/Operat/Imp.htm
This was fixed in
scripting/ebnfand merged intomaster. Since the parser is now based on EBNF and microsoft specs, this is no longer relevant.renders as:
This was fixed in
scripting/ebnfand merged intomaster. Since the parser first formats the script all line continuations merged into one line.NOTdoes on integer literals.Do we need to implement
~in certain cases?This was fixed in
scripting/ebnfand merged intomaster. Not was implemented as !This was fixed in
scripting/ebnfand merged intomaster. Since the parser is now EBNF based, this is no longer an issue.