Update schala-lang to edition 2021

This commit is contained in:
Greg Shuflin 2021-10-21 12:37:29 -07:00
parent b5484e67ee
commit 9b5c3629c0
2 changed files with 8 additions and 9 deletions

View File

@ -2,8 +2,7 @@
name = "schala-lang"
version = "0.1.0"
authors = ["greg <greg.shuflin@protonmail.com>"]
edition = "2018"
resolver = "2"
edition = "2021"
[dependencies]
itertools = "0.10"

View File

@ -308,13 +308,13 @@ macro_rules! expect {
}
macro_rules! delimited {
($self:expr, $start:pat, $parse_fn:ident, $( $delim:pat )|+, $end:pat, nonstrict) => {
delimited!($self, $start, $parse_fn, $( $delim )|*, $end, false)
($self:expr, $start:pat, $parse_fn:ident, $delim:pat, $end:pat, nonstrict) => {
delimited!($self, $start, $parse_fn, $delim, $end, false)
};
($self:expr, $start:pat, $parse_fn:ident, $( $delim:pat )|+, $end:pat) => {
delimited!($self, $start, $parse_fn, $( $delim )|*, $end, true)
($self:expr, $start:pat, $parse_fn:ident, $delim:pat, $end:pat) => {
delimited!($self, $start, $parse_fn, $delim, $end, true)
};
($self:expr, $start:pat, $parse_fn:ident, $( $delim:pat )|+, $end:pat, $strictness:expr) => {
($self:expr, $start:pat, $parse_fn:ident, $delim:pat, $end:pat, $strictness:expr) => {
{
expect!($self, $start);
let mut acc = vec![];
@ -326,13 +326,13 @@ macro_rules! delimited {
}
if !$strictness {
match peek.get_kind() {
$( $delim )|* => { $self.token_handler.next(); continue },
$delim => { $self.token_handler.next(); continue },
_ => ()
}
}
acc.push($self.$parse_fn()?);
match $self.token_handler.peek().get_kind() {
$( $delim )|* => { $self.token_handler.next(); continue },
$delim => { $self.token_handler.next(); continue },
_ if $strictness => break,
_ => continue,
};