happy icon indicating copy to clipboard operation
happy copied to clipboard

Happy should error out on duplicate productions

Open harpocrates opened this issue 6 years ago • 0 comments

  1. Consider the following short grammar:

    foo :: { Int }
       : int             { $1 }
    
    foo :: { Int }
       : int             { $1 + 4 }
    

    Happy should not accept this - it should complain that I've defined foo twice. Right now, it just silently picks one of the two.

  2. Consider the following shorter grammar:

    foo :: { Int }
    foob
       : int             { $1 }
    

    Happy should not accept this - it should complain that the name foob does not match the expected name foo. Right now, it just uses foo and ignores foob completely.

harpocrates avatar Nov 05 '19 14:11 harpocrates