Title: Lexer outputs confused reminder when the terminal NUMBER prohibits trailing dot · Issue #195 · structuredllm/syncode · GitHub
Open Graph Title: Lexer outputs confused reminder when the terminal NUMBER prohibits trailing dot · Issue #195 · structuredllm/syncode
X Title: Lexer outputs confused reminder when the terminal NUMBER prohibits trailing dot · Issue #195 · structuredllm/syncode
Description: version: v0.4.12 According to the JSON specification (RFC 8259), trailing dot is prohibited for floating point. However, when I define the new JSON grammar like below, I found the lexer's suspicious behavior. // RFC 8259 without complex ...
Open Graph Description: version: v0.4.12 According to the JSON specification (RFC 8259), trailing dot is prohibited for floating point. However, when I define the new JSON grammar like below, I found the lexer's suspiciou...
X Description: version: v0.4.12 According to the JSON specification (RFC 8259), trailing dot is prohibited for floating point. However, when I define the new JSON grammar like below, I found the lexer's suspi...
Opengraph URL: https://github.com/structuredllm/syncode/issues/195
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Lexer outputs confused reminder when the terminal NUMBER prohibits trailing dot","articleBody":"version: v0.4.12\n\nAccording to the JSON specification (RFC 8259), trailing dot is prohibited for floating point.\nHowever, when I define the new JSON grammar like below, I found the lexer's suspicious behavior.\n\n```\n// RFC 8259 without complex STRING definition\n?start: value\n\n?value: object\n| array\n| STRING\n| NUMBER\n| \"true\" -\u003e true\n| \"false\" -\u003e false\n| \"null\" -\u003e null\n\nobject: \"{\" [member (\",\" member)*] \"}\"\nmember: STRING \":\" value\narray : \"[\" [value (\",\" value)*] \"]\"\n\nNUMBER: MINUS? INT FRAC? EXP?\nMINUS: \"-\"\nINT: \"0\" | (\"1\"..\"9\") DIGIT*\nDIGIT: \"0\"..\"9\"\nFRAC: \".\" DIGIT+\nEXP: (\"e\"|\"E\") [\"+\"|\"-\"] DIGIT+\n\nSTRING: /\\\"[^\"]*\\\"/\nWS: /[ \\t\\f\\r\\n]/+\n\n%ignore WS\n```\n\nThe observed behavior:\n```python\n\u003e\u003e\u003e grammar_engine._parse_partial_code(0, '{ \"cap\": 10.0', b'', accepted_generation=True)\n(remainder : b'10.0', remainder_state: RemainderState.MAYBE_COMPLETE, accept_sequences: {accept_terminals: ['NUMBER', 'COMMA'], accept_terminals: ['NUMBER', 'WS', 'COMMA'], accept_terminals: ['LBRACE'], accept_terminals: ['WS'], accept_terminals: ['NULL'], accept_terminals: ['STRING'], accept_terminals: ['NUMBER', 'WS', 'RBRACE'], accept_terminals: ['NUMBER', 'RBRACE'], accept_terminals: ['TRUE'], accept_terminals: ['FALSE'], accept_terminals: ['LSQB']}, next_ac_indents: None, False)\n\n# ↑ This looks correct.\n\n\u003e\u003e\u003e grammar_engine._parse_partial_code(0, '{ \"cap\": 10.', b'', accepted_generation=True)\n(remainder : b'.', remainder_state: RemainderState.INCOMPLETE, accept_sequences: {accept_terminals: ['COMMA'], accept_terminals: ['WS'], accept_terminals: ['RBRACE']}, next_ac_indents: None, False)\n\n# ↑ This reminder must be '10.' ?\n```\n\nIt seems that the lexer will be confused when its state moves along accepted (digits) -\u003e live-state (trailing dot) -\u003e accepted (digits).","author":{"url":"https://github.com/Yosshi999","@type":"Person","name":"Yosshi999"},"datePublished":"2025-04-23T07:26:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/195/syncode/issues/195"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:05b48d3f-e497-ae45-68ec-753b8e72a959 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8890:3F004:2080A33:2A2F597:6990ABC1 |
| html-safe-nonce | e6338186b7c93c4eadba71e95ce2c426b12c62eb9484181b07b4e7c7fa1e931b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODkwOjNGMDA0OjIwODBBMzM6MkEyRjU5Nzo2OTkwQUJDMSIsInZpc2l0b3JfaWQiOiI2ODcwMzk0NjUzODUxNTYwODk3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3a3c43e2dffc6b5c75392fc42648c103d6a3523d5bd96c2db9bee5707184053d |
| hovercard-subject-tag | issue:3012979279 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/structuredllm/syncode/195/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cdcd69c638829d14a89455aeee03254540e9802c9bac9e5ee7ef5de918fb3c56/structuredllm/syncode/issues/195 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cdcd69c638829d14a89455aeee03254540e9802c9bac9e5ee7ef5de918fb3c56/structuredllm/syncode/issues/195 |
| og:image:alt | version: v0.4.12 According to the JSON specification (RFC 8259), trailing dot is prohibited for floating point. However, when I define the new JSON grammar like below, I found the lexer's suspiciou... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Yosshi999 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/structuredllm/syncode git https://github.com/structuredllm/syncode.git |
| octolytics-dimension-user_id | 204232273 |
| octolytics-dimension-user_login | structuredllm |
| octolytics-dimension-repository_id | 687211074 |
| octolytics-dimension-repository_nwo | structuredllm/syncode |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 687211074 |
| octolytics-dimension-repository_network_root_nwo | structuredllm/syncode |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width