-
Notifications
You must be signed in to change notification settings - Fork 11
Description
- Multiple Statements in one line using colons are not treated like block statements:
Currently:
If Err Then MsgBox "Can't open ""core.vbs""" : Exit Subrenders:
if (Err)
MsgBox('Can\'t open "core.vbs"');
return;This was fixed in scripting/ebnf and merged into master.
- Check how OR should be rendered.
Currently:
If VPBuildVersion < 0 Or Err Then
x = 5
End Ifrenders:
if (VPBuildVersion < 0 | Err) {
x = 5;
}This was fixed in scripting/ebnf as a logical or expression (||) and merged into master.
- Implement classes and properties:
ClassDecl,MemberDeclList,MemberDecl,PropertyDecl, andPropertyAccessType
JavaScript has classes but does not support fields.
Classes were implemented in scripting/ebnf and merged into master. ProperyDecl's were implemented as methods.
- Properly support
arrayvscall. For example:
Controller.Switch(swLRFlip) = Trueshould 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
- Replace
Idthat might match JavaScript keywords.
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.
- Correctly implement
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:
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.
- Fields need to be really implemented
Default,Erase,Error,Explicit,Step,Private,Public
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`
- Error statements need to be really implemented
Currently they are just rendered as comments:
; // On Error Resume Next**This was implemented in scripting/ebnf and merged into master.
- Special character will break the parser
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.
- Sometimes whitespace will lock up the parser
Example:
a.b(1).c(2) (3).d(4, 5)should render as:
a.b(1).c(2, 3).d(4, 5)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 implement
NothingvsNullvsEmptyliterals.
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.
- Implement 3 remaining
SubCallStmtin grammar, and determine howSubSafeExprOptis meant to be used
| 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.
- Finish
LeftExprandLeftExprTail
These are required for multiple object subcalls:
ExecuteGlobal fso.OpenTextFile("VPMKeys.vbs", 1).ReadAllthat 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
- Implement
CallStmtin grammar
This was fixed in scripting/ebnf and merged into master.
- Fix
Dateliteral. This may require avbsHelperfunction because according to
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. **
- Determine what
KeywordIDandSafeKeywordIDin the Rosetta Code grammar is trying to do
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.
- Implement
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
- Find test cases for the following post processor helpers:
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.
- Add a test case for white space line continuation
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.
- Check what
NOTdoes on integer literals.
Do we need to implement ~ in certain cases?
This was fixed in scripting/ebnf and merged into master. Not was implemented as !
- Fix lockup during the following:
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.