Allow '_' in label and meta names

This commit is contained in:
Joscha 2020-04-04 13:40:40 +00:00
parent c8b53d1a1f
commit 86dd243c11
2 changed files with 5 additions and 5 deletions

View file

@ -163,11 +163,11 @@ callee:
STV tmp3 ; For comparison in loop STV tmp3 ; For comparison in loop
STV tmp4 ; For accumulating result STV tmp4 ; For accumulating result
callee-loop: callee_loop:
; Break if counter (tmp1) is zero ; Break if counter (tmp1) is zero
LDV tmp1 LDV tmp1
EQL tmp3 EQL tmp3
JMN callee-loop-end JMN callee_loop_end
; Decrement counter (tmp1) by 1 ; Decrement counter (tmp1) by 1
LDV tmp1 LDV tmp1
ADC -1 ADC -1
@ -177,9 +177,9 @@ callee:
ADD tmp2 ADD tmp2
STV tmp4 STV tmp4
; And repeat the loop ; And repeat the loop
JMP callee-loop JMP callee_loop
callee-loop-end: callee_loop_end:
; Save the result in return value 2 ; Save the result in return value 2
LDV tmp4 LDV tmp4
STRF 2 STRF 2

View file

@ -213,7 +213,7 @@ withSpan f = do
name :: Parser (Name Span) name :: Parser (Name Span)
name = fmap (uncurry Name) $ withSpan $ do name = fmap (uncurry Name) $ withSpan $ do
firstChar <- satisfy isLower <?> "lowercase character" firstChar <- satisfy isLower <?> "lowercase character"
otherChars <- takeWhileP (Just "alphanumeric character") isAlphaNum otherChars <- takeWhileP (Just "alphanumeric character or '_'") (\c -> isAlphaNum c || c == '_')
pure $ T.pack [firstChar] <> otherChars pure $ T.pack [firstChar] <> otherChars
number :: (Num a) => Parser a number :: (Num a) => Parser a