diff --git a/assets/basic.js b/assets/basic.js index 80489de..e30313d 100644 --- a/assets/basic.js +++ b/assets/basic.js @@ -1995,12 +1995,11 @@ bF._executeSyntaxTree = function(lnum, syntaxTree, recDepth) { bF._recurseApplyAST(exprTree, (it) => { if (it.astType == "lit") { // check if parametre name is valid - if (defunRenamingMap[it.astValue] === undefined) { - throw lang.refError(lnum, it.astValue); + // if the name is invalid, regard it as a global variable (i.e. do nothing) + if (defunRenamingMap[it.astValue] !== undefined) { + it.astType = "defun_args"; + it.astValue = defunRenamingMap[it.astValue]; } - - it.astType = "defun_args"; - it.astValue = defunRenamingMap[it.astValue]; } // decrease the recursion counter while we're looping it.astDepth -= 2; diff --git a/assets/emit.bas b/assets/emit.bas new file mode 100644 index 0000000..c8d29cb --- /dev/null +++ b/assets/emit.bas @@ -0,0 +1,3 @@ +10 for k=0 to 1024 +20 emit(k mod 1024;) +30 next diff --git a/assets/facrec.bas b/assets/facrec.bas new file mode 100644 index 0000000..5ca49fb --- /dev/null +++ b/assets/facrec.bas @@ -0,0 +1,4 @@ +10 DEFUN FAC(N)=IF N==0 THEN 1 ELSE N*FAC(N-1) +20 FOR K=1 TO 6 +30 PRINT FAC(K) +40 NEXT