mirror of
https://github.com/anoma/juvix.git
synced 2024-11-30 14:13:27 +03:00
This PR addresses a bug/missing case present since v0.6.2, introduced specifically by - PR #2779, That PR involves detecting imports in Juvix files before type checking, and that's the issue. Detecting/scanning imports is done by running a flat parser (which ignores the Juvix Markdown structure) and when it fails, it runs a Megaparser parse. So, for simplicity, we could just continue using the same Megaparser as before for Juvix Markdown files. --------- Co-authored-by: Jan Mas Rovira <janmasrovira@gmail.com>
This commit is contained in:
parent
2524606757
commit
2416f78a3e
@ -12,7 +12,10 @@ import Juvix.Prelude.FlatParse qualified as FP
|
||||
import Juvix.Prelude.FlatParse.Lexer qualified as L
|
||||
|
||||
scanBSImports :: Path Abs File -> ByteString -> Maybe ScanResult
|
||||
scanBSImports fp = fromResult . scanner fp
|
||||
scanBSImports fp
|
||||
-- FlatParse only supports .juvix files
|
||||
| isJuvixFile fp = fromResult . scanner fp
|
||||
| otherwise = const Nothing
|
||||
where
|
||||
fromResult :: Result () ok -> Maybe ok
|
||||
fromResult = \case
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Example
|
||||
|
||||
What is important is seldom urgent.
|
||||
|
||||
A Juvix Markdown file name ends with `.juvix.md`. This kind of file must contain
|
||||
a module declaration at the top, as shown below ---in the first code block.
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
# Example
|
||||
|
||||
What is important is seldom urgent.
|
||||
|
||||
A Juvix Markdown file name ends with `.juvix.md`. This kind of file must contain
|
||||
a module declaration at the top, as shown below ---in the first code block.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user