Skip to content

fix(lexers): recognize GraphQL integer and float literals - #1515

Merged
github-actions[bot] merged 1 commit into
alecthomas:masterfrom
yxshee:fix/graphql-negative-numbers-nov19
Nov 19, 2026
Merged

github-actions[bot] merged 1 commit into
alecthomas:masterfrom
yxshee:fix/graphql-negative-numbers-nov19

Conversation

@yxshee

@yxshee yxshee commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

The minus signs in the query below are currently reported as errors. It's possible to get Name styling for any positive integer. 50 in profilePic(size: 50) is highlighted as NameClass in the current fixture.

query { values(samples: [-2, -0.5, -1e-3]) }

Integers and floats are all matched prior to attempting a name, whether they appear as an argument value following : or otherwise. Various malformed numbers will also result in different error highlighting. For instance, .5 results in an Error highlight on the leading period.

The updated fixture fails on master with Found Error token in lexer GraphQL output. The number tokens agree with GraphQL.js for the query above and all integer and float literals in GitHub’s public schema. The full Go suite, lint and generated-file checks pass.

@github-actions
github-actions Bot enabled auto-merge (squash) November 19, 2026 11:50
@github-actions
github-actions Bot merged commit 8a9c557 into alecthomas:master Nov 19, 2026
4 checks passed
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.

1 participant