Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to parse empty array value #13

Closed
hoopoepg opened this issue May 19, 2014 · 3 comments
Closed

failed to parse empty array value #13

hoopoepg opened this issue May 19, 2014 · 3 comments

Comments

@hoopoepg
Copy link

hi
i found issue in parser (not sure it is correct case, but just in case :) )...
so, toml code:

# *************************
[versions]

    [versions.1_2_3]
    name        = "1.2.3"
    files       = [
    ]
# *************************

to workaround issue small fix:

--- toml/lib/parser.js  Mon May 19 20:54:58 2014
+++ toml/lib/parser.js Mon May 19 19:27:55 2014
@@ -1506,7 +1506,7 @@ module.exports = (function() {
       }
       if (s1 !== peg$FAILED) {
         s2 = peg$parsevalue();
-        if (s2 !== peg$FAILED) {
+        if (s2 !== peg$FAILED || s0 == peg$currPos || input.substring(s0, peg$currPos).match(/^\s+$/)) {
           s3 = [];
           s4 = peg$parsearray_sep();
           while (s4 !== peg$FAILED) {

thank you

--Sergey

@ForbesLindesay
Copy link
Contributor

Try using ``` on its own line before and after code snippets. GitHub will then make them nice and easy to read.

@hoopoepg
Copy link
Author

updated

@BinaryMuse
Copy link
Owner

Good find, thanks a bunch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants