Misleading syntax error for malformed local names after prefixes
- Dominant language
- Rust
- Stars
- 289
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
Consider the following malformed program:
```
@prefix wd: .
in(1,wd:Q42,2).
test1(?x) :- in(1, wd:42, 2).
```
The term `wd:42` is illegal, since local names cannot start with a number. However, Nemo shows an error for the previous occurrence of the predicate `in`, and the error message is
> expected '.'
It would be good if the parser could pinpoint the real problem more accurately, since it is a common typo.
Contributor guide
Research direction
Start by reproducing the malformed Nemo program in the issue, especially the `wd:42` term after the prefix declaration. Trace the parser's handling of prefixed local names and compare the reported location and message with the actual syntax error. Done means the diagnostic points to `wd:42` and explains that the local name cannot start with a number.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100