akeep / nanopass-framework-racket

Racket port of the nanopass-framework
MIT License
34 stars 9 forks source link

Improve error and location when "duplicate alt" is detected #33

Closed soegaard closed 9 years ago

soegaard commented 9 years ago

The following program provokes an "duplicate alt" error. I suggest that the error location becomes (+ s).

The current error. define-language: duplicate alt in add in: #s((terminal-alt #(0) alt 3) #<syntax:12:7 s> #f #f #f)

Could this message be improved?

#lang nanopass

(define-language L
  (entry e)
  (terminals
   (symbol (s)))
  (Expr (e)
    s))

(define-language L1 (extends L)
  (Expr (e)
    (+ s)))