Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Sep 13, 2022
1 parent 7935351 commit 33d09aa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/Juvix/Compiler/Core/Pretty/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module Juvix.Compiler.Core.Pretty.Base
)
where

import Data.Functor
import Data.HashMap.Strict qualified as HashMap
import Juvix.Compiler.Core.Data.InfoTable
import Juvix.Compiler.Core.Data.Stripped.InfoTable qualified as Stripped
Expand Down
5 changes: 4 additions & 1 deletion src/Juvix/Compiler/Core/Translation/FromSource/Lexer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ string = lexemeInterval string'
keyword :: Text -> ParsecS r ()
keyword = keyword' space

keywordSymbol :: Text -> ParsecS r ()
keywordSymbol = keywordSymbol' space

identifier :: ParsecS r Text
identifier = lexeme bareIdentifier

Expand Down Expand Up @@ -156,7 +159,7 @@ kwSemicolon :: ParsecS r ()
kwSemicolon = keyword Str.semicolon

kwComma :: ParsecS r ()
kwComma = keyword Str.comma
kwComma = keywordSymbol Str.comma

kwWildcard :: ParsecS r ()
kwWildcard = keyword Str.underscore
Expand Down
6 changes: 6 additions & 0 deletions src/Juvix/Parser/Lexer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ keywordL' spc kw = do
spc
return i

keywordSymbol' :: ParsecS r () -> Text -> ParsecS r ()
keywordSymbol' spc kw = do
P.try $ do
void $ P.chunk kw
spc

rawIdentifier :: [ParsecS r ()] -> ParsecS r Text
rawIdentifier allKeywords = do
notFollowedBy (choice allKeywords)
Expand Down

0 comments on commit 33d09aa

Please sign in to comment.