You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(!statementIsA(expr,NodeType.PrimitiveType))thrownewCompilerError(expr.range,`Expected argument types after function name, found ${expr.value}.`,filePath);
elsethrownewCompilerError(t.range,`Expected comma or identifier, found '${t.value}'.`,filePath);
150
150
}
151
151
tokens.shift();// skip CloseParen
@@ -157,7 +157,7 @@ export namespace syxparser {
157
157
158
158
if(!statementIsA(moduleExpr,NodeType.String))thrownewCompilerError(moduleExpr.range,`Expected string after parens of imports statement, found '${moduleExpr.value}'.`,filePath);
if(!statementIsA(braceExpr,NodeType.Brace))thrownewCompilerError(braceExpr.range,'Expected braces after global name.',filePath);
@@ -493,7 +494,7 @@ export namespace syxparser {
493
494
* @param {boolean} expectIdentifier Whether identifiers should be allowed. Unknown identifiers will stop the function with this value set to `false`, returning the identifier as a {@link StringExpression} otherwise.
Copy file name to clipboardExpand all lines: src/compiler.ts
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ export class SyntaxScriptCompiler {
65
65
* Compiles one .syx file from the path given.
66
66
* @param {string} file Path to a file to compile.
67
67
* @author efekos
68
-
* @version 1.0.5
68
+
* @version 1.0.6
69
69
* @since 0.0.2-alpha
70
70
*/
71
71
publiccompileSyx(file: string){
@@ -90,9 +90,9 @@ export class SyntaxScriptCompiler {
90
90
constcompileStmt=stmtasCompileStatement;
91
91
92
92
compileStmt.formats.forEach(frmt=>{
93
-
if(operatorStmtExport.outputGenerators[frmt]!==undefined)thrownewCompilerError(compileStmt.range,`Duplicate file format at compile statement \'${frmt}\'`);
93
+
if(operatorStmtExport.outputGenerators[frmt.value]!==undefined)thrownewCompilerError(compileStmt.range,`Duplicate file format at compile statement \'${frmt}\'`);
if(operatorStmtExport.imports[frmt.value]!==undefined)thrownewCompilerError(importStmt.range,`Duplicate file format at imports statement \'${frmt}\'`);
if(stmt.body[0].type!==NodeType.String)thrownewCompilerError(stmt.range,'Expected a string after compile statement parens');
133
133
stmt.formats.forEach(each=>{
134
-
if(statementExport.formatNames[each]!==undefined)thrownewCompilerError(stmt.range,`Encountered multiple compile statements for target language '${each}'`);
if(statementExport.formatNames[each.value]!==undefined)thrownewCompilerError(stmt.range,`Encountered multiple compile statements for target language '${each}'`);
if(statementExport.imports[each]!==undefined)thrownewCompilerError(stmt.range,`Encountered multiple import statements for target language '${each}'`);
140
-
statementExport.imports[each]=stmt.module;
139
+
if(statementExport.imports[each.value]!==undefined)thrownewCompilerError(stmt.range,`Encountered multiple import statements for target language '${each}'`);
0 commit comments