Add function asting
Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
parent
70f616d60c
commit
cb55c00739
4 changed files with 97 additions and 4 deletions
53
src/ast/snapshots/nomo__ast__tests__check_function_call.snap
Normal file
53
src/ast/snapshots/nomo__ast__tests__check_function_call.snap
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
---
|
||||
source: src/ast/mod.rs
|
||||
expression: ast
|
||||
---
|
||||
TemplateAst {
|
||||
root: [
|
||||
Interpolation {
|
||||
prev_whitespace_content: None,
|
||||
expression: FunctionCall {
|
||||
name: VariableAccess(
|
||||
[Ident]"foo" (4..7),
|
||||
),
|
||||
args: [
|
||||
Operation {
|
||||
op: Times,
|
||||
lhs: Literal {
|
||||
source: [Literal(Integer(2))]"2" (8..9),
|
||||
value: Integer {
|
||||
value: 2,
|
||||
},
|
||||
},
|
||||
rhs: Literal {
|
||||
source: [Literal(Integer(3))]"3" (12..13),
|
||||
value: Integer {
|
||||
value: 3,
|
||||
},
|
||||
},
|
||||
},
|
||||
FunctionCall {
|
||||
name: VariableAccess(
|
||||
[Ident]"bar" (15..18),
|
||||
),
|
||||
args: [
|
||||
Operation {
|
||||
op: Plus,
|
||||
lhs: Literal {
|
||||
source: [Literal(Integer(2))]"2" (19..20),
|
||||
value: Integer {
|
||||
value: 2,
|
||||
},
|
||||
},
|
||||
rhs: VariableAccess(
|
||||
[Ident]"baz" (23..26),
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
post_whitespace_content: None,
|
||||
},
|
||||
],
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue