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

Internal parser error using syntax rules #5763

Closed
foones opened this issue Jan 30, 2022 · 3 comments · Fixed by #5785
Closed

Internal parser error using syntax rules #5763

foones opened this issue Jan 30, 2022 · 3 comments · Fixed by #5785
Labels
operators Parsing of mixfix operators parser Problems with the parser's implementation (rather than with decisions about syntax) type: bug Issues and pull requests about actual bugs ux: error reporting Issues to do with how Agda reports errors
Milestone

Comments

@foones
Copy link

foones commented Jan 30, 2022

The following snippet produces an internal (__IMPOSSIBLE__) parser error at src/full/Agda/Syntax/Concrete/Operators/Parser.hs:114:77 in Agda-2.6.2.1. I have tried it in a slightly older version (Agda-2.6.1) with similar results:

postulate X : Set
postulate Π : (X  X)  X
syntax Π  (λ A  B) = Π A , B
syntax Π' (λ A  B) = Π' A , B 
Π' : (X  X)  X
(Π' α , P α) = (Π α , P α)
@foones foones changed the title Internal parser error Internal parser error using syntax rules Jan 30, 2022
@nad
Copy link
Contributor

nad commented Jan 30, 2022

One cannot use lambda abstractions as patterns (excluding dot patterns), but the error message should be better.

@nad nad added ux: error reporting Issues to do with how Agda reports errors operators Parsing of mixfix operators parser Problems with the parser's implementation (rather than with decisions about syntax) type: bug Issues and pull requests about actual bugs labels Jan 30, 2022
@nad nad added this to the 2.6.3 milestone Jan 30, 2022
@andreasabel
Copy link
Member

andreasabel commented Jan 30, 2022

The error is raised here (second __IMPOSSIBLE__):

unExprView = \case
LocalV x -> IdentP x
AppV e1 e2 -> AppP e1 e2
OpAppV d ns es -> let ess :: [NamedArg Pattern]
ess = (fmap . fmap . fmap)
(\case
Placeholder{} -> __IMPOSSIBLE__
NoPlaceholder _ x -> fromOrdinary __IMPOSSIBLE__ x)
es
in OpAppP (fuseRange d ess) d ns ess

This never worked properly, there is an internal error all the way back to 2.4.2.6 (and probably further).

@andreasabel
Copy link
Member

(Removed from 2.6.2.2 as it does not pick cleanly.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
operators Parsing of mixfix operators parser Problems with the parser's implementation (rather than with decisions about syntax) type: bug Issues and pull requests about actual bugs ux: error reporting Issues to do with how Agda reports errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants