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