mirror of
https://github.com/danog/parser.git
synced 2024-11-30 04:29:13 +01:00
parser: support float expressions
This commit is contained in:
parent
ce4e1e1152
commit
d898216706
@ -303,6 +303,9 @@ pub enum Expression {
|
||||
Int {
|
||||
i: i64
|
||||
},
|
||||
Float {
|
||||
f: f64,
|
||||
},
|
||||
Variable {
|
||||
name: String
|
||||
},
|
||||
|
@ -992,6 +992,11 @@ impl Parser {
|
||||
self.next();
|
||||
e
|
||||
},
|
||||
TokenKind::Float(f) => {
|
||||
let f = Expression::Float { f: *f };
|
||||
self.next();
|
||||
f
|
||||
},
|
||||
TokenKind::Identifier(i) | TokenKind::QualifiedIdentifier(i) | TokenKind::FullyQualifiedIdentifier(i) => {
|
||||
let e = Expression::Identifier { name: i.to_string() };
|
||||
self.next();
|
||||
|
Loading…
Reference in New Issue
Block a user