Comparing version 0.0.15 to 0.0.16
@@ -160,3 +160,3 @@ "use strict"; | ||
// Raise error. | ||
throw new SyntaxError("ParserError at ".concat(imports[contentIndex], "(Line ").concat(lineNumber, "): Invalid Syntax")); | ||
throw new SyntaxError("ParserError at ".concat(imports[contentIndex], "(Line ").concat(lineNumber, "): Invalid Syntax\n \n ").concat(input.slice(0, input.indexOf("\n")), "\n ^\n ")); | ||
} | ||
@@ -163,0 +163,0 @@ } |
@@ -39,3 +39,3 @@ "use strict"; | ||
// Add the file contents to the includes array. | ||
includes = __spreadArray(__spreadArray([], includes, true), newIncludes, true); | ||
includes = __spreadArray(__spreadArray([], newIncludes, true), includes, true); | ||
// Add the file to the imports array. | ||
@@ -42,0 +42,0 @@ imports = __spreadArray(__spreadArray([], files, true), newImports, true); |
@@ -15,4 +15,4 @@ "use strict"; | ||
while (!(0, regex_1.isEndOfData)(data)) { | ||
var multiIndex = data.indexOf("/*") === 0 ? 1 : data.indexOf("/*"); | ||
var singleIndex = data.indexOf("//") === 0 ? 1 : data.indexOf("//"); | ||
var multiIndex = data.indexOf("/*"); | ||
var singleIndex = data.indexOf("//"); | ||
if (multiIndex !== -1 && (multiIndex < singleIndex || singleIndex === -1)) { | ||
@@ -19,0 +19,0 @@ formatted += data.slice(0, multiIndex); |
{ | ||
"name": "huffc", | ||
"description": "A low level programming language for the Ethereum Virtual Machine", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"author": "JetJadeja", | ||
@@ -6,0 +6,0 @@ "bin": { |
@@ -221,3 +221,7 @@ import getAllFileContents from "./utils/contents"; | ||
throw new SyntaxError( | ||
`ParserError at ${imports[contentIndex]}(Line ${lineNumber}): Invalid Syntax` | ||
`ParserError at ${imports[contentIndex]}(Line ${lineNumber}): Invalid Syntax | ||
${input.slice(0, input.indexOf("\n"))} | ||
^ | ||
` | ||
); | ||
@@ -224,0 +228,0 @@ } |
@@ -34,3 +34,3 @@ /* Imports */ | ||
// Add the file contents to the includes array. | ||
includes = [...includes, ...newIncludes]; | ||
includes = [...newIncludes, ...includes]; | ||
@@ -37,0 +37,0 @@ // Add the file to the imports array. |
@@ -16,4 +16,4 @@ import assert = require("assert"); | ||
while (!isEndOfData(data)) { | ||
const multiIndex = data.indexOf("/*") === 0 ? 1 : data.indexOf("/*"); | ||
const singleIndex = data.indexOf("//") === 0 ? 1 : data.indexOf("//"); | ||
const multiIndex = data.indexOf("/*"); | ||
const singleIndex = data.indexOf("//"); | ||
@@ -20,0 +20,0 @@ if (multiIndex !== -1 && (multiIndex < singleIndex || singleIndex === -1)) { |
567806
14499