Start function call parsing

This commit is contained in:
Araozu 2023-10-01 17:18:28 -05:00
parent 2e9776de01
commit 03b5a1b6de
7 changed files with 50 additions and 0 deletions

View File

@ -14,6 +14,11 @@
- Document code
## v0.0.7
- Parse minimal function declarations following a grammar
## v0.0.6
- Parse function declarations

View File

@ -0,0 +1,6 @@
#[derive(Debug)]
pub struct FunctionCall {
identifier: Box<String>
}

View File

@ -1,3 +1,6 @@
pub mod functions;
pub struct ModuleAST {
pub declarations: Vec<TopLevelDeclaration>,
}

View 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() {
}
}

View File

@ -0,0 +1 @@
pub mod function_call;

View File

@ -42,4 +42,17 @@ block = "{", "}"
```
## Function call
```ebnf
function call = identifier, arguments list
```
### Arguments list
```ebnf
arguments list = "(", ")"
```

View File

@ -6,6 +6,7 @@ mod expression;
mod function_declaration;
mod params_list;
mod utils;
mod functions;
pub mod ast;