haskell / haskell/parsec

Parameterized enclosing for char and string literals

Open
#170 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
892
Forks
99
PR merge metrics
No merged PRs in 30d

Description

`charLiteral` and `stringLiteral` lexemes encloses literals, respectively, with characters `'` and `"` (both at the beginning and at the end of a literal) by default. There should be lexemes (one for characters and one for strings) which makes parametric literals enclosing, for instance by taking as arguments a string (not a single character) which encloses a literal at the beginning of it and a string which encloses the literal at the end of it, something like `charLiteral :: String -> String -> ParsecT s u m Char`. Thus:
`charLiteral "<<" ">>"` would parse `<>`, where `c` is a single character, valid to be a literal character.
This is just an example, before opening a pull request there should be a reasoning about not to make a breaking change (if it's possible).

Anyway, actually, I don't know a clean way to do what I just explained with the actual API.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.