fix: do not allow negation of a positive int literal
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package wacc
|
||||
|
||||
import parsley.Parsley
|
||||
import parsley.character
|
||||
import parsley.token.{Basic, Lexer}
|
||||
import parsley.token.descriptions.*
|
||||
|
||||
@@ -45,6 +46,7 @@ object lexer {
|
||||
private val lexer = Lexer(desc)
|
||||
val ident = lexer.lexeme.names.identifier
|
||||
val integer = lexer.lexeme.integer.decimal32[Int]
|
||||
val negateCheck = lexer.nonlexeme.symbol("-") ~> character.digit
|
||||
val charLit = lexer.lexeme.character.ascii
|
||||
val stringLit = lexer.lexeme.string.ascii
|
||||
val implicits = lexer.lexeme.symbol.implicits
|
||||
|
||||
Reference in New Issue
Block a user