Skip to content

Nicer error message on name duplicates - #255

Merged
dahlia merged 1 commit into
nirum-lang:masterfrom
dahlia:nicer-error-on-name-dups
Mar 27, 2018
Merged

dahlia merged 1 commit into
nirum-lang:masterfrom
dahlia:nicer-error-on-name-dups

Conversation

@dahlia

@dahlia dahlia commented Mar 26, 2018

Copy link
Copy Markdown
Member

Continued from #254. Now give nicer error message on name duplicates. Offset line/column number became accurate.

Where the following Nirum code is given:


union bar = foo
          | bar
          | baz;

Although the compiler had given the following error message (which refers to inaccurate offset line/column number):

examples/a.nrm:5:1:
the facial type name `bar` is duplicated


^

It's now like the following:

examples/a.nrm:3:13:
the tag name `bar` is duplicated

          | bar
            ^

See also the added "handling name duplications" test case.

@dahlia dahlia added typ:bug Type: Bug/defect cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) labels Mar 26, 2018
@dahlia dahlia self-assigned this Mar 26, 2018
@dahlia
dahlia requested a review from kanghyojun March 26, 2018 19:53
@checkmate-bot

checkmate-bot commented Mar 26, 2018 •

Copy link
Copy Markdown

Checklist 🤔

src/Nirum/Parser.hs

  • If a new reserved keyword is introduced, it has to be also added to reservedKeywords set in the Nirum.Constructs.Identifier module.

@codecov

codecov Bot commented Mar 26, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #255 into master will increase coverage by 0.64%.
The diff coverage is 94.02%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #255      +/-   ##
==========================================
+ Coverage   73.13%   73.77%   +0.64%     
==========================================
  Files          33       33              
  Lines        2356     2391      +35     
  Branches      130      124       -6     
==========================================
+ Hits         1723     1764      +41     
  Misses        503      503              
+ Partials      130      124       -6
Impacted Files Coverage Δ
src/Nirum/Parser.hs 86.86% <94.02%> (+2.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4529e07...8fd42c8. Read the comment docs.

@dahlia
dahlia merged commit 8fd42c8 into nirum-lang:master Mar 27, 2018
dahlia added a commit that referenced this pull request Mar 27, 2018
Nicer error message on name duplicates
@dahlia dahlia added this to the Version 0.4.0 milestone May 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) typ:bug Type: Bug/defect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants