fix: disallow exponents, export identifier from lexer
This commit is contained in:
parent
e384265189
commit
70aa58b879
@ -25,7 +25,6 @@ object lexer {
|
||||
spaceDesc = SpaceDesc.plain.copy(
|
||||
lineCommentStart = "#"
|
||||
),
|
||||
// TODO - See BNF 1.1 and Table 5 2.3.6
|
||||
textDesc = TextDesc.plain.copy(
|
||||
graphicCharacter =
|
||||
Basic(c => c >= ' ' && c != '\\' && c != '\'' && c != '"'),
|
||||
@ -40,21 +39,17 @@ object lexer {
|
||||
"r" -> '\r'
|
||||
)
|
||||
)
|
||||
),
|
||||
numericDesc = NumericDesc.plain.copy(
|
||||
decimalExponentDesc = ExponentDesc.NoExponents
|
||||
)
|
||||
)
|
||||
|
||||
private val lexer = Lexer(desc)
|
||||
|
||||
// Enforce 32-bit signed integer range - see 1.5
|
||||
// TODO By default leadingZerosAllowed = true in NumericDesc - Wacc doesnt specify (I think) but should reach consensus
|
||||
val ident = lexer.lexeme.names.identifier
|
||||
val integer = lexer.lexeme.integer.decimal32[Int]
|
||||
|
||||
// TODO Check if textDesc can handle this
|
||||
val charLit = lexer.lexeme.character.ascii
|
||||
|
||||
// TODO Check if textDesc can handle this
|
||||
val stringLit = lexer.lexeme.string.ascii
|
||||
|
||||
val implicits = lexer.lexeme.symbol.implicits
|
||||
|
||||
def fully[A](p: Parsley[A]): Parsley[A] = lexer.fully(p)
|
||||
|
Loading…
x
Reference in New Issue
Block a user