diff --git a/src/Juvix/Compiler/Concrete/Translation/ImportScanner/FlatParse.hs b/src/Juvix/Compiler/Concrete/Translation/ImportScanner/FlatParse.hs index f39c42d0d1..9ca6e710fe 100644 --- a/src/Juvix/Compiler/Concrete/Translation/ImportScanner/FlatParse.hs +++ b/src/Juvix/Compiler/Concrete/Translation/ImportScanner/FlatParse.hs @@ -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 diff --git a/tests/positive/Markdown/Test.juvix.md b/tests/positive/Markdown/Test.juvix.md index 12698dd12c..aeb24dfa7e 100644 --- a/tests/positive/Markdown/Test.juvix.md +++ b/tests/positive/Markdown/Test.juvix.md @@ -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. diff --git a/tests/positive/Markdown/markdown/Test.md b/tests/positive/Markdown/markdown/Test.md index d4c15f200e..e816efa3c5 100644 --- a/tests/positive/Markdown/markdown/Test.md +++ b/tests/positive/Markdown/markdown/Test.md @@ -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.