Skip to content

Conversation

@9999years
Copy link
Member

@9999years 9999years commented Jun 21, 2024

GHC output contains quoted fragments:

Module graph contains a cycle:
        module ‘C’ (./C.hs)
        imports module ‘A’ (A.hs)
  which imports module ‘B’ (./B.hs)
  which imports module ‘C’ (./C.hs)

When Unicode output is not available, the Unicode quotes are substituted for GNU-style ASCII quotes:

module `C' (./C.hs)

However, when the quoted text starts or ends with a single quote, ASCII quotes are omitted. This leads to ambiguous output:

A   → `A'
A'  → A'
`A' → `A'
'A  → 'A
'A' → 'A'

Correctly parsing this is challenging.

This probably increases the amount of backtracking and lookahead required for these parsers. Not sure if that's significant or how concerning it is...

Split off of #297

@linear
Copy link

linear bot commented Jun 21, 2024

@github-actions github-actions bot added the patch Bug fixes or non-functional changes label Jun 21, 2024
@9999years 9999years force-pushed the wiggles/dux-2348-fix-single-quoted-ghc-output-parser branch from 5398873 to c3d456c Compare June 21, 2024 21:02
@9999years 9999years mentioned this pull request Jun 21, 2024
3 tasks
GHC output contains quoted fragments:

    Module graph contains a cycle:
            module ‘C’ (./C.hs)
            imports module ‘A’ (A.hs)
      which imports module ‘B’ (./B.hs)
      which imports module ‘C’ (./C.hs)

When Unicode output is not available, the Unicode quotes are substituted
for GNU-style ASCII quotes:

    module `C' (./C.hs)

However, when the quoted text starts or ends with a single quote, ASCII
quotes are omitted. This leads to ambiguous output:

    A   → `A'
    A'  → A'
    `A' → `A'
    'A  → 'A
    'A' → 'A'

Correctly parsing this is challenging.

This probably increases the amount of backtracking and lookahead
required for these parsers. Not sure if that's significant or relevant.
@9999years 9999years force-pushed the wiggles/dux-2348-fix-single-quoted-ghc-output-parser branch from c3d456c to 24fd4a1 Compare June 21, 2024 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Bug fixes or non-functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant