Skip to content

Make backends more resilient against keyword and Prelude clashes #278

Closed

Description

@andreasabel

OP: Haskell: Printer: variable name "pattern" might clash with PatternSynonyms language extension.

Prg. Program ::= Pattern;
PVar. Pattern ::= Ident;

creates Haskell printer containing:

instance Print Test.Abs.Program where
  prt i e = case e of
    Test.Abs.Prg pattern -> prPrec i 0 (concatD [prt 0 pattern])

However, pattern is a Haskell keyword when using {-# LANGUAGE PatternSynonyms #-}.

When trying to get a test case through that has one category for each keyword of each backend target, I notice a number of related issues:

  • Haskell abstract syntax: avoid Prelude clashes
  • Haskell template: import Abs module qualified to avoid clashes
  • Haskell parser: import Abs qualified
  • Agda AST: import Abs qualified in COMPILE pragmas
  • Haskell/GADT: same as Haskell
  • C: clash of user-defined category Int with token type int in parser
  • C++: same as C
  • Ocaml: refer to abstract syntax qualified in print/show
  • Java: qualified absyn, names need to be unique modulo case (case insensitive file systems!)
  • Java/ANTLR: labels for alternatives may clash with rule names

Activity

  1. added
    printer
    on Dec 16, 2019
  2. added this to the 2.8.4 milestone on Dec 16, 2019
  3. self-assigned this
    on Dec 16, 2019
  4. changed the title [-]Haskell: Printer: variable name "pattern" might clash with PatternSynonyms language extension[/-] [+]Make backends more resiliant againt keyword and Prelude clashes[/+] on Dec 16, 2019
  5. changed the title [-]Make backends more resiliant againt keyword and Prelude clashes[/-] [+]Make backends more resilient againt keyword and Prelude clashes[/+] on Dec 16, 2019
  6. changed the title [-]Make backends more resilient againt keyword and Prelude clashes[/-] [+]Make backends more resilient against keyword and Prelude clashes[/+] on Dec 16, 2019
  7. 14 remaining items

  8. added a commit that references this issue on Dec 25, 2019
  9. andreasabel commented on Dec 25, 2019

    @andreasabel
    MemberAuthor

    Ocamlyacc can currently only handle 127 entry points correctly, see ocaml/ocaml#9207, less than the test case produces.

  10. added 5 commits that reference this issue on Dec 25, 2019
  11. andreasabel commented on Dec 29, 2019

    @andreasabel
    MemberAuthor
  12. added 4 commits that reference this issue on Jan 2, 2020
  13. andreasabel commented on Oct 5, 2020

    @andreasabel
    MemberAuthor

    Both ocamlyacc (shipped with ocaml 4.11.1) and menhir (20200624, my birthday version) are up to the task now.

  14. added a commit that references this issue on Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

AgdaCC#C++HaskellHaskell/CNFHaskell/GADTJavaJava/ANTLROCamlbugprinter

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions