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
Could not parse with pattern #3172
Comments
And of course use parseF : List ℂ → List Fmt
parseF [] = []
parseF (x ∷ xs) with xs | x ≟ '%'
parseF (x ∷ xs) | '%' ∷ xss | .Relation.Nullary.Dec.yes p = ?
parseF (x ∷ xs) | '%' ∷ xss | .Relation.Nullary.Dec.no ¬p = ? |
You need to |
Ok thanks |
@gallais And BTW why Agda complains about the termination of this function? parseF : List ℂ → List Fmt
parseF [] = []
parseF (x ∷ xs) with xs | x ≟ '%'
... | '%' ∷ xss | yes _ = lit '%' ∷ parseF xss
... | c ∷ xss | yes _ = fmt c ∷ parseF xss
... | [] | yes _ = lit '%' ∷ []
... | _ | no _ = lit x ∷ parseF xs |
While the normal form checks: parseF : List ℂ → List Fmt
parseF [] = []
parseF ('%' ∷ '%' ∷ cs) = lit '%' ∷ parseF cs
parseF ('%' ∷ c ∷ cs) = fmt c ∷ parseF cs
parseF ( c ∷ cs) = lit c ∷ parseF cs |
Moved discussion to #3173 |
Simple, minimum code to reproduce the error:
The code above uses these declarations:
If I change
(yes y)
toy
, the parser works. But I need to pattern match onx ≟ '%'
, how can I do that?The text was updated successfully, but these errors were encountered: