Enable parsing float types
This commit is contained in:
@@ -27,6 +27,10 @@ class IntegerLiteral(Atom):
|
||||
pass
|
||||
|
||||
|
||||
class FloatLiteral(Atom):
|
||||
pass
|
||||
|
||||
|
||||
class StringLiteral(Atom):
|
||||
pass
|
||||
|
||||
@@ -47,6 +51,10 @@ def IntegerParser(input):
|
||||
return Parser.terminal(TokenType.INTEGER, createNode=IntegerLiteral.withValue)(input)
|
||||
|
||||
|
||||
def FloatParser(input):
|
||||
return Parser.terminal(TokenType.FLOAT, createNode=FloatLiteral.withValue)(input)
|
||||
|
||||
|
||||
def StringParser(input):
|
||||
return Parser.terminal(TokenType.STRING, createNode=StringLiteral.withValue)(input)
|
||||
|
||||
@@ -66,6 +74,7 @@ def TypeLiteralParser(input):
|
||||
def LiteralParser(input):
|
||||
return Parser.oneOf(
|
||||
IntegerParser,
|
||||
FloatParser,
|
||||
StringParser,
|
||||
NoteParser,
|
||||
BoolParser,
|
||||
|
||||
Reference in New Issue
Block a user