Start function call parsing
This commit is contained in:
parent
2e9776de01
commit
03b5a1b6de
@ -14,6 +14,11 @@
|
||||
- Document code
|
||||
|
||||
|
||||
## v0.0.7
|
||||
|
||||
- Parse minimal function declarations following a grammar
|
||||
|
||||
|
||||
## v0.0.6
|
||||
|
||||
- Parse function declarations
|
||||
|
6
src/syntax/ast/functions.rs
Normal file
6
src/syntax/ast/functions.rs
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct FunctionCall {
|
||||
identifier: Box<String>
|
||||
}
|
@ -1,3 +1,6 @@
|
||||
pub mod functions;
|
||||
|
||||
|
||||
pub struct ModuleAST {
|
||||
pub declarations: Vec<TopLevelDeclaration>,
|
||||
}
|
21
src/syntax/functions/function_call.rs
Normal file
21
src/syntax/functions/function_call.rs
Normal file
@ -0,0 +1,21 @@
|
||||
use crate::{lexic::token::Token, syntax::{ParseResult, ast::functions::FunctionCall}};
|
||||
|
||||
|
||||
|
||||
pub fn try_parse<'a>(tokens: &'a Vec<Token>, pos: usize) -> ParseResult<FunctionCall, ()> {
|
||||
|
||||
|
||||
|
||||
todo!()
|
||||
}
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn should_parse_1() {
|
||||
|
||||
}
|
||||
}
|
1
src/syntax/functions/mod.rs
Normal file
1
src/syntax/functions/mod.rs
Normal file
@ -0,0 +1 @@
|
||||
pub mod function_call;
|
@ -42,4 +42,17 @@ block = "{", "}"
|
||||
```
|
||||
|
||||
|
||||
## Function call
|
||||
|
||||
```ebnf
|
||||
function call = identifier, arguments list
|
||||
```
|
||||
|
||||
|
||||
### Arguments list
|
||||
|
||||
```ebnf
|
||||
arguments list = "(", ")"
|
||||
```
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@ mod expression;
|
||||
mod function_declaration;
|
||||
mod params_list;
|
||||
mod utils;
|
||||
mod functions;
|
||||
|
||||
pub mod ast;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user