[Compiler] v0.0.4
This commit is contained in:
parent
8a72b9308d
commit
e28c608788
@ -10,12 +10,16 @@
|
|||||||
- [ ] Namespace identifiers in the symbol table
|
- [ ] Namespace identifiers in the symbol table
|
||||||
- [ ] Stdlib
|
- [ ] Stdlib
|
||||||
- [ ] Document code
|
- [ ] Document code
|
||||||
- [ ] Test that the field `position` of the tokens actually points to the start of the token, and not its length
|
|
||||||
|
## v0.0.5
|
||||||
|
|
||||||
|
- ...
|
||||||
|
|
||||||
## v0.0.4
|
## v0.0.4
|
||||||
|
|
||||||
- Explicit datatype of variables
|
- Explicit datatype of variables
|
||||||
- Improve error messages when a syntax error is found (show offending line and offending token)
|
- Improve error messages when a syntax error is found (show offending line and offending token)
|
||||||
|
- Show different error messages for val/var binding
|
||||||
|
|
||||||
## v0.0.3
|
## v0.0.3
|
||||||
|
|
||||||
|
2
compiler/Cargo.lock
generated
2
compiler/Cargo.lock
generated
@ -313,7 +313,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "misti"
|
name = "misti"
|
||||||
version = "0.0.3"
|
version = "0.0.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap",
|
"clap",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "misti"
|
name = "misti"
|
||||||
version = "0.0.3"
|
version = "0.0.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
@ -76,7 +76,7 @@ pub fn try_parse<'a>(tokens: &'a Vec<Token>, pos: usize) -> Option<SyntaxResult>
|
|||||||
/*
|
/*
|
||||||
* Equal (=) operator
|
* Equal (=) operator
|
||||||
*/
|
*/
|
||||||
let _equal_operator: &Token = match try_operator(tokens, pos + 2, String::from("=")) {
|
let equal_operator: &Token = match try_operator(tokens, pos + 2, String::from("=")) {
|
||||||
Result3::Ok(t) => t,
|
Result3::Ok(t) => t,
|
||||||
Result3::Err(t) => {
|
Result3::Err(t) => {
|
||||||
// The parser found a token, but it's not the `=` operator
|
// The parser found a token, but it's not the `=` operator
|
||||||
@ -98,8 +98,11 @@ pub fn try_parse<'a>(tokens: &'a Vec<Token>, pos: usize) -> Option<SyntaxResult>
|
|||||||
|
|
||||||
let expression = expression::try_parse(tokens, pos + 3);
|
let expression = expression::try_parse(tokens, pos + 3);
|
||||||
if expression.is_none() {
|
if expression.is_none() {
|
||||||
// TODO: return Error
|
return Some(SyntaxResult::Err(SyntaxError {
|
||||||
return None;
|
reason: String::from("Expected an expression after the equal `=` operator"),
|
||||||
|
error_start: equal_operator.position,
|
||||||
|
error_end: equal_operator.get_end_position(),
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
let expression = expression.unwrap();
|
let expression = expression.unwrap();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user