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

Wrong result when double qoute is escaped #12

Open
abdulkareemnalband opened this issue Jun 18, 2018 · 5 comments
Open

Wrong result when double qoute is escaped #12

abdulkareemnalband opened this issue Jun 18, 2018 · 5 comments

Comments

@abdulkareemnalband
Copy link

{
"FIRST": {
        "SECOND": {
            "THIRD1": " \", #, %, *, :, <, >, ?, /, \\, |, \\t, (, & ",
            "THIRD2": "a",
            "THIRD3": "b",
            "THIRD4": "f."
        }
}

putting cursor under THIRD2 and onward it shows FIRST.SECOND[", "] as path

@richie5um
Copy link
Owner

Oh no. Time to have another go at that regexp. :-/

Thanks for the great bug report - the example is really helpful.

@richie5um
Copy link
Owner

Still not got this working. It is proving tricky to solve.

@abdulkareemnalband
Copy link
Author

how about this

/\"([^\0-\x1F\x22\x5C]|\\[\"\\/bfnrt]|\\u[0-9a-fA-F]{4})*\"/

built from here https://github.com/pegjs/pegjs/blob/06c9400bcac1b696eb5c4f2787734ab7038cef3e/examples/json.pegjs#L119

regexer example https://regexr.com/3sjsg

@abdulkareemnalband
Copy link
Author

instead of readstring function, above regex can be used here

const { text: s, pos: newPos } = readString(text, pos)

@AleWin32
Copy link

instead of readstring function, above regex can be used here

const { text: s, pos: newPos } = readString(text, pos)

@abdulkareemnalband so can you post the full replacement for that line you said? If it works for you

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