diff options
| author | Simon-Kor <52245124+Simon-Kor@users.noreply.github.com> | 2024-05-28 17:36:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-28 17:36:49 +0200 |
| commit | 68598ccc2e420376a790b31b93efa7f18f91edf6 (patch) | |
| tree | 6ca3ecd36d8d84ea7153d74cab73361052d03565 /source/Syntax/Adapt.hs | |
| parent | 266529fa1271a942920845072efb588c64c4aba3 (diff) | |
| parent | a08c4b2d7a7135029a588df542c18fdf07725075 (diff) | |
Merge pull request #2 from adelon/main
changes from main needs to be included
Diffstat (limited to 'source/Syntax/Adapt.hs')
| -rw-r--r-- | source/Syntax/Adapt.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/Syntax/Adapt.hs b/source/Syntax/Adapt.hs index b1237d2..3a8b3d6 100644 --- a/source/Syntax/Adapt.hs +++ b/source/Syntax/Adapt.hs @@ -26,10 +26,14 @@ scanChunk ltoks = let toks = unLocated <$> ltoks matchOrErr re env pos = match re toks ?? error ("could not find lexical pattern in " <> env <> " at " <> sourcePosPretty pos) in case ltoks of - Located pos (BeginEnv "definition") : _ -> matchOrErr definition "definition" pos - Located pos (BeginEnv "abbreviation") : _ -> matchOrErr abbreviation "abbreviation" pos - Located pos (BeginEnv "struct") :_ -> matchOrErr struct "struct definition" pos - Located pos (BeginEnv "inductive") :_ -> matchOrErr inductive "inductive definition" pos + Located{startPos = pos, unLocated = BeginEnv "definition"} : _ -> + matchOrErr definition "definition" (pos) + Located{startPos = pos, unLocated = BeginEnv "abbreviation"} : _ -> + matchOrErr abbreviation "abbreviation" pos + Located{startPos = pos, unLocated = (BeginEnv "struct")} :_ -> + matchOrErr struct "struct definition" pos + Located{startPos = pos, unLocated = (BeginEnv "inductive")} :_ -> + matchOrErr inductive "inductive definition" pos _ -> [] adaptChunks :: [[Located Token]] -> Lexicon -> Lexicon |
