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

Parser issue for long quotes #78

Open
mytmark opened this issue Feb 27, 2020 · 4 comments
Open

Parser issue for long quotes #78

mytmark opened this issue Feb 27, 2020 · 4 comments
Labels

Comments

@mytmark
Copy link

mytmark commented Feb 27, 2020

Thank you very much for this great extension. I found one little issue with long quotes. Your parser would recognize a single quote as the end of a long quote. Example:

:Bens_house dc:description '''Ben's house'''@en .

This triple is conform to RDF grammar (https://www.w3.org/TR/turtle/#grammar-production-STRING_LITERAL_LONG_SINGLE_QUOTE).

Best regards,
Mark

@jmrog
Copy link
Contributor

jmrog commented Feb 27, 2020

I think the parser actually gets this correct, strictly speaking (see image below). I think the only thing that is incorrect is the syntax highlighting (i.e., the textmate grammar for Turtle). We can try to fix that at some point soon, or PRs are welcome in the meantime! Thanks.

image

@jmrog jmrog added the bug label Feb 27, 2020
@mytmark
Copy link
Author

mytmark commented May 14, 2020

I am sorry, but i do not know how to do a pull request, I'm not allowed to push to your repository which I seem to have to do in order to do a pull request. But I found the bug: In the turtle.tmLanguage.json file simply change the order of string patterns. Instead of

    { "include": "#single-squote-string-literal" },
    { "include": "#single-dquote-string-literal" },
    { "include": "#triple-squote-string-literal" },
    { "include": "#triple-dquote-string-literal" },
    { "include": "#triple-tick-string-literal" }

write

    { "include": "#triple-squote-string-literal" },
    { "include": "#triple-dquote-string-literal" },
    { "include": "#triple-tick-string-literal" },
    { "include": "#single-squote-string-literal" },
    { "include": "#single-dquote-string-literal" }

That should do the trick. Hope this helps and maybe you got some advice how to do a proper pull request for a github-noob like me :)

Best regards,
Mark

@fkleedorfer
Copy link

I can confirm this problem in 0.1.2:
grafik

@jmrog
Copy link
Contributor

jmrog commented May 22, 2020

I am sorry, but i do not know how to do a pull request, I'm not allowed to push to your repository which I seem to have to do in order to do a pull request. But I found the bug: In the turtle.tmLanguage.json file simply change the order of string patterns. Instead of

    { "include": "#single-squote-string-literal" },
    { "include": "#single-dquote-string-literal" },
    { "include": "#triple-squote-string-literal" },
    { "include": "#triple-dquote-string-literal" },
    { "include": "#triple-tick-string-literal" }

write

    { "include": "#triple-squote-string-literal" },
    { "include": "#triple-dquote-string-literal" },
    { "include": "#triple-tick-string-literal" },
    { "include": "#single-squote-string-literal" },
    { "include": "#single-dquote-string-literal" }

That should do the trick. Hope this helps and maybe you got some advice how to do a proper pull request for a github-noob like me :)

Best regards,
Mark

@mytmark Thanks for this. You can make a pull request to this repo by forking the repo (to your own GitHub), creating a branch on your fork and pushing your code to that branch, then opening a pull request from your fork to our repository. The flow is described in more detail here: https://jarv.is/notes/how-to-pull-request-fork-github/

If you'd rather not do this, we can make the change you suggested. But making a pull request is a nice way to get credit!

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

No branches or pull requests

3 participants