Nothing Special   »   [go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haskell backend prints a list [Char] containing characters as string #359

Closed
andreasabel opened this issue Apr 24, 2021 · 2 comments
Closed
Assignees
Labels
bug Haskell lists Concerning list categories and separator/terminator/delimiter pragmas printer Concerning the generated printer
Milestone

Comments

@andreasabel
Copy link
Member

Grammar

(:[]). [Char] ::= "*" Char ";";
(:).   [Char] ::= "*" Char ";" [Char];

and input

* 'A';
* 'B';
* 'C';

results in printed output

"ABC"

The other backends print this correctly.

@andreasabel andreasabel added bug Haskell lists Concerning list categories and separator/terminator/delimiter pragmas printer Concerning the generated printer labels Apr 24, 2021
@andreasabel andreasabel added this to the 2.9.2 milestone May 2, 2021
@andreasabel
Copy link
Member Author

The overloaded prt function can naturally not deal with both of [Char] and String, since these are the same type. Should not be a problem with Text tokens, though.

A way to fix this would be to have a non-overloaded printing function for String, so it does not clash with [Char].

@andreasabel andreasabel self-assigned this May 2, 2021
@andreasabel
Copy link
Member Author
  • If category [Char] is used, we now have printString instead of instance Print String.
  • Method prtList has been removed from class Print.

andreasabel added a commit that referenced this issue May 2, 2021
Having Char lists and String will atm give a compilation error for the generated
Printer, because

    instance [Char]

clashes with

    instance String
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Haskell lists Concerning list categories and separator/terminator/delimiter pragmas printer Concerning the generated printer
Projects
None yet
Development

No branches or pull requests

1 participant