Skip to content

Commit 9fa7a19

Browse files
committed
Fixes to correctly handle reserved JS word "in"
1 parent f4fbc2b commit 9fa7a19

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

codemirror/qb-lang.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ CodeMirror.defineMode("qbjs", function(conf, parserConf) {
2828
var endKeywords = ['next','loop','wend'];
2929

3030
var wordOperators = wordRegexp(['and', 'or', 'not', 'xor', 'is', 'mod', 'eqv', 'imp']);
31-
var commonkeywords = ['dim', 'as', 'redim', 'then', 'until', 'exit', 'in', 'to', 'let',
31+
var commonkeywords = ['dim', 'as', 'redim', 'then', 'until', 'exit', 'to', 'let',
3232
'const', 'integer', 'single', 'double', 'long', '_?unsigned', '_?float', '_?bit', '_?byte',
3333
'string', '_?byte', 'object', '_?offset', '_?integer64', 'call', 'step', '_?preserve'];
3434

qb2js.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async function main() {
2323
QB.resizeArray(exportMethods, [{l:0,u: 0}], {line:0,type:'',returnType:'',name:'',uname:'',argc:0,args:'',jsname:'',sync:0,builtin:0,dynamic:0}, false); /* METHOD */
2424
QB.resizeArray(dataArray, [{l:0,u: 0}], '', false); /* STRING */
2525
QB.resizeArray(dataLabels, [{l:0,u: 0}], {text:'',index:0}, false); /* LABEL */
26-
QB.resizeArray(jsReservedWords, [{l:0,u: 54}], '', false); /* STRING */
26+
QB.resizeArray(jsReservedWords, [{l:0,u: 55}], '', false); /* STRING */
2727
modLevel = 0; /* INTEGER */
2828
currentMethod = ''; /* STRING */
2929
currentModule = ''; /* STRING */
@@ -3899,6 +3899,7 @@ if (QB.halted()) { return; };
38993899
QB.arrayValue(jsReservedWords, [ 52]).value = "prompt";
39003900
QB.arrayValue(jsReservedWords, [ 53]).value = "require";
39013901
QB.arrayValue(jsReservedWords, [ 54]).value = "process";
3902+
QB.arrayValue(jsReservedWords, [ 55]).value = "in";
39023903
}
39033904
async function sub_InitGX() {
39043905
if (QB.halted()) { return; };

tools/qb2js.bas

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ ReDim Shared As Variable exportConsts(0)
8989
ReDim Shared As Method exportMethods(0)
9090
ReDim Shared As String dataArray(0)
9191
ReDim Shared As Label dataLabels(0)
92-
Dim Shared As String jsReservedWords(54)
92+
Dim Shared As String jsReservedWords(55)
9393
Dim Shared modLevel As Integer
9494
Dim Shared As String currentMethod
9595
Dim Shared As String currentModule
@@ -3983,7 +3983,7 @@ Sub InitJSReservedWords
39833983
jsReservedWords(17) = "finally"
39843984
' float, for, function, goto, if
39853985
jsReservedWords(18) = "implements"
3986-
' import, in
3986+
' import
39873987
jsReservedWords(19) = "instanceof"
39883988
' int
39893989
jsReservedWords(20) = "interface"
@@ -4024,6 +4024,7 @@ Sub InitJSReservedWords
40244024
jsReservedWords(52) = "prompt"
40254025
jsReservedWords(53) = "require"
40264026
jsReservedWords(54) = "process"
4027+
jsReservedWords(55) = "in"
40274028
End Sub
40284029

40294030
Sub InitGX

0 commit comments

Comments
 (0)