@toml-tools/parser
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -50,3 +50,3 @@ const { Parser } = require("chevrotain"); | ||
$.CONSUME(t.IKey); | ||
$.OPTION(() => { | ||
$.MANY(() => { | ||
$.CONSUME(t.Dot); | ||
@@ -81,11 +81,17 @@ $.CONSUME2(t.IKey); | ||
$.SUBRULE($.val); | ||
$.MANY(() => { | ||
$.CONSUME(t.Comma); | ||
$.SUBRULE2($.commentNewline); | ||
$.SUBRULE2($.val); | ||
let notDangling = true; | ||
$.MANY({ | ||
GATE: () => notDangling, | ||
DEF: () => { | ||
$.CONSUME(t.Comma); | ||
$.SUBRULE2($.commentNewline); | ||
const foundVal = $.OPTION2(() => { | ||
$.SUBRULE2($.val); | ||
}); | ||
if (foundVal === false) { | ||
notDangling = false; | ||
} | ||
} | ||
}); | ||
// Dangling Comma | ||
$.OPTION2(() => { | ||
$.CONSUME2(t.Comma); | ||
}); | ||
}); | ||
@@ -103,3 +109,3 @@ | ||
$.SUBRULE($.keyval); | ||
$.OPTION(() => { | ||
$.MANY(() => { | ||
$.CONSUME(t.Comma); | ||
@@ -106,0 +112,0 @@ $.SUBRULE2($.keyval); |
{ | ||
"name": "@toml-tools/parser", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "TOML Parser Implemented in JavaScript", | ||
@@ -9,3 +9,3 @@ "main": "lib/api.js", | ||
"dependencies": { | ||
"@toml-tools/lexer": "^0.1.0", | ||
"@toml-tools/lexer": "^0.1.1", | ||
"chevrotain": "4.1.1" | ||
@@ -19,3 +19,3 @@ }, | ||
}, | ||
"gitHead": "7f92498e805472213e9500b32fe5295534cecd31" | ||
"gitHead": "985568629950665054ac56fd2601d465cb9aa716" | ||
} |
6805
212
Updated@toml-tools/lexer@^0.1.1