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

Add missing tokens to SPARQL lexer #1559

Merged
merged 1 commit into from
Oct 2, 2020
Merged

Conversation

lucaswerkmeister
Copy link
Contributor

@belett noticed that VALUES was missing; I found the other ones by running the following snippet on the SPARQL 1.1 Query Language spec:

new Set(Array.from(document.querySelectorAll('.grammarTable'))
    .reduce((text, elem) => text + elem.textContent)
    .match(/'[a-z0-9-_ ]*'/ig))

I don’t know why a few keywords were missing; the docstring linked to the SPARQL 1.0 Query Language spec (also fixed here), but the lexer already contained other tokens which were only added in SPARQL 1.1, such as the aggregate functions (MIN, MAX etc.), which have already been in Pygments since the initial commit of the current history (6ded9db).

@belett noticed that VALUES was missing [1]; I found the other ones by
running the following snippet on the SPARQL 1.1 Query Language spec:

    new Set(Array.from(document.querySelectorAll('.grammarTable'))
        .reduce((text, elem) => text + elem.textContent)
        .match(/'[a-z0-9-_ ]*'/ig))

I don’t know why a few keywords were missing; the docstring linked to
the SPARQL 1.0 Query Language spec (also fixed here), but the lexer
already contained other tokens which were only added in SPARQL 1.1, such
as the aggregate functions (MIN, MAX etc.), which have already been in
Pygments since the initial commit of the current history (6ded9db).

[1]: https://phabricator.wikimedia.org/T264175
@Anteru Anteru self-assigned this Oct 2, 2020
@Anteru Anteru added the changelog-update Items which need to get mentioned in the changelog label Oct 2, 2020
@Anteru
Copy link
Collaborator

Anteru commented Oct 2, 2020

Merged, thanks! No idea what went wrong originally, that was before my time.

@Anteru Anteru merged commit d5f8600 into pygments:master Oct 2, 2020
@lucaswerkmeister lucaswerkmeister deleted the sparql branch October 2, 2020 17:26
@Anteru Anteru removed the changelog-update Items which need to get mentioned in the changelog label Oct 24, 2020
@Anteru Anteru added this to the 2.7.2 milestone Oct 24, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants