Commit c51b717
fix(dql): support IRI-ref at query start (#9667)
**Description**
This PR fixes a regression in DQL lexing where queries starting with an
IRI-ref (names wrapped in `< >`, e.g., `<caseNodeDel_xxx>`) would fail
with an `Unexpected character: U+003C '<'` error.
**Root Cause:**
In v25, the state function `lexIdentifyMutationOrQuery` was introduced
to distinguish between mutations and queries. However, it lacked a case
for the `lsThan` (`<`) character, causing the lexer to fail when a query
block started with an IRI-ref instead of a standard name or keyword.
**Changes:**
- Updated `lexIdentifyMutationOrQuery` in `dql/state.go` to handle the
`lsThan` (`<`) case.
- Ensures the lexer correctly calls `lex.IRIRef` and transitions to
`lexQuery`.
Fixes #9666
**Checklist**
- [x] The PR title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) syntax,
leading with `fix:`, `feat:`, `chore:`, `ci:`, etc.
- [x] Code compiles correctly and linting (via trunk) passes locally
- [x] Tests added for new functionality, or regression tests for bug
fixes added as applicable
---------
Co-authored-by: gooohgb <[email protected]>1 parent a1499c6 commit c51b717
3 files changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
391 | 394 | | |
392 | 395 | | |
393 | 396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
196 | 214 | | |
197 | 215 | | |
198 | 216 | | |
| |||
0 commit comments