Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

moniel-parser

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moniel-parser - npm Package Compare versions

Comparing version
0.0.3
to
0.0.4
+6
_tests/ill_formed/issues.json
[
{
"message": "Expected end of input.",
"location": 0
}
]
+1
-1
{
"name": "moniel-parser",
"version": "0.0.3",
"version": "0.0.4",
"description": "Parser for Moniel notation",

@@ -5,0 +5,0 @@ "main": "Parser.js",

@@ -24,2 +24,5 @@ const fs = require("fs")

parse(source) {
let ast = null
let issues = []
const matchResult = this.grammar.match(source)

@@ -29,12 +32,15 @@

const expected = matchResult.getExpectedText()
const position = matchResult.getRightmostFailurePosition()
return {
expected,
position
}
const location = matchResult.getRightmostFailurePosition()
issues.push({
message: `Expected ${expected}.`,
location
})
} else {
ast = this.semantics(matchResult).eval()
}
const ast = this.semantics(matchResult).eval()
return {
ast
ast,
issues
}

@@ -41,0 +47,0 @@ }

@@ -28,4 +28,4 @@ const fs = require("fs")

if (!parseResult.ast) {
const errorFilePath = path.join(testDirectory, "_error.json")
generated = parseResult
const errorFilePath = path.join(testDirectory, "issues.json")
generated = parseResult.issues
target = loadSnapshot(errorFilePath, generated)

@@ -32,0 +32,0 @@ } else {

{
"expected": "end of input",
"position": 0
}