Skip to content

Commit

Permalink
issue #1163 ready for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
stefjoosten committed Jun 7, 2021
1 parent 732019e commit 02e04a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Ampersand/Input/ADL1/Lexer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ mainLexer p ('<':d:s) = if isOperator ['<',d]
else returnToken (LexSymbol '<') p mainLexer (addPos 1 p) (d:s)

mainLexer p cs@(c:s)
| isIdStart c || isUpper c
| isLower c || isUpper c
= let (name', p', s') = scanIdent (addPos 1 p) s
name'' = c:name'
tokt | iskw name'' = LexKeyword name''
| otherwise = if isIdStart c
name'' = c:name'
tokt | iskw name'' = LexKeyword name''
| otherwise = if isLower c
then LexVarId name''
else LexConId name''
in returnToken tokt p mainLexer p' s'
Expand Down Expand Up @@ -206,8 +206,6 @@ isOperatorBegin = locatein (mapMaybe head operators)
where head :: [a] -> Maybe a
head (a:_) = Just a
head [] = Nothing
isIdStart :: Char -> Bool
isIdStart c = isLower c || c == '_'

isIdChar :: Char -> Bool
isIdChar c = isAlphaNum c || c == '_'
Expand Down
1 change: 1 addition & 0 deletions src/Ampersand/Input/ADL1/ParsingLib.hs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ data Value = VRealString Text
| VBoolean Bool
| VDateTime UTCTime
| VDate Day

pAtomValInPopulation :: Bool -> AmpParser Value
-- An atomvalue can be lots of things. However, since it can be used in
-- as a term (singleton expression), an ambiguity might occur if we allow
Expand Down

0 comments on commit 02e04a0

Please sign in to comment.