diff --git a/src/parser/expr.rs b/src/parser/expr.rs index ab54245..7c8a876 100644 --- a/src/parser/expr.rs +++ b/src/parser/expr.rs @@ -14,11 +14,11 @@ use super::var::var; fn atom_paren( expr: impl Parser + Clone, ) -> impl Parser { - just("(") + just('(') .ignore_then(space()) .then(expr) .then(space()) - .then_ignore(just(")")) + .then_ignore(just(')')) .map_with_span(|((s0, inner), s1), span| Expr::Paren { s0, inner: Box::new(inner), diff --git a/src/parser/lit.rs b/src/parser/lit.rs index afd9251..a81d7cf 100644 --- a/src/parser/lit.rs +++ b/src/parser/lit.rs @@ -114,13 +114,13 @@ pub fn table_lit( .then(space()) .map(|((s0, elem), s1)| (s0, elem, s1)); - let trailing_comma = just(",").ignore_then(space()).or_not(); + let trailing_comma = just(',').ignore_then(space()).or_not(); - let elems = elem.separated_by(just(",")).then(trailing_comma); + let elems = elem.separated_by(just(',')).then(trailing_comma); just("'{") .ignore_then(elems) - .then_ignore(just("}")) + .then_ignore(just('}')) .map_with_span(|(elems, trailing_comma), span| TableLit { elems, trailing_comma, diff --git a/src/parser/suffix.rs b/src/parser/suffix.rs index 584bbfa..f70985a 100644 --- a/src/parser/suffix.rs +++ b/src/parser/suffix.rs @@ -136,11 +136,11 @@ fn suffix_field_access( expr: impl Parser + Clone, ) -> impl Parser { space() - .then_ignore(just("[")) + .then_ignore(just('[')) .then(space()) .then(expr) .then(space()) - .then_ignore(just("]")) + .then_ignore(just(']')) .map(|(((s0, s1), index), s2)| Suffix::FieldAccess { s0, s1, diff --git a/src/parser/table_constr.rs b/src/parser/table_constr.rs index 1b70048..7c75229 100644 --- a/src/parser/table_constr.rs +++ b/src/parser/table_constr.rs @@ -12,13 +12,13 @@ pub fn table_constr_elem( ) -> impl Parser { let lit = table_lit_elem(expr.clone()).map(TableConstrElem::Lit); - let indexed = just("[") + let indexed = just('[') .ignore_then(space()) .then(expr.clone()) .then(space()) - .then_ignore(just("]")) + .then_ignore(just(']')) .then(space()) - .then_ignore(just(":")) + .then_ignore(just(':')) .then(space()) .then(expr) .map_with_span( @@ -44,13 +44,13 @@ pub fn table_constr( .then(space()) .map(|((s0, elem), s1)| (s0, elem, s1)); - let trailing_comma = just(",").ignore_then(space()).or_not(); + let trailing_comma = just(',').ignore_then(space()).or_not(); - let elems = elem.separated_by(just(",")).then(trailing_comma); + let elems = elem.separated_by(just(',')).then(trailing_comma); - just("{") + just('{') .ignore_then(elems) - .then_ignore(just("}")) + .then_ignore(just('}')) .map_with_span(|(elems, trailing_comma), span| TableConstr { elems, trailing_comma, diff --git a/src/parser/table_destr.rs b/src/parser/table_destr.rs index 29a8389..d25590b 100644 --- a/src/parser/table_destr.rs +++ b/src/parser/table_destr.rs @@ -31,13 +31,13 @@ pub fn table_pattern() -> impl Parser { .then(space()) .map(|((s0, elem), s1)| (s0, elem, s1)); - let trailing_comma = just(",").ignore_then(space()).or_not(); + let trailing_comma = just(',').ignore_then(space()).or_not(); - let elems = elem.separated_by(just(",")).then(trailing_comma); + let elems = elem.separated_by(just(',')).then(trailing_comma); - just("{") + just('{') .ignore_then(elems) - .then_ignore(just("}")) + .then_ignore(just('}')) .map_with_span(|(elems, trailing_comma), span| TablePattern { elems, trailing_comma, diff --git a/src/parser/var.rs b/src/parser/var.rs index a46e624..2db31d8 100644 --- a/src/parser/var.rs +++ b/src/parser/var.rs @@ -9,11 +9,11 @@ use super::basic::{ident, space, Error}; fn var_access( expr: impl Parser + Clone, ) -> impl Parser { - just("[") + just('[') .ignore_then(space()) .then(expr) .then(space()) - .then_ignore(just("]")) + .then_ignore(just(']')) .map_with_span(|((s0, index), s1), span| Var::Access { s0, index: Box::new(index), @@ -28,13 +28,13 @@ fn var_assign( let local = text::keyword("local").ignore_then(space()).or_not(); local - .then_ignore(just("[")) + .then_ignore(just('[')) .then(space()) .then(expr.clone()) .then(space()) - .then_ignore(just("]")) + .then_ignore(just(']')) .then(space()) - .then_ignore(just("=")) + .then_ignore(just('=')) .then(space()) .then(expr) .map_with_span( @@ -59,7 +59,7 @@ fn var_assign_ident( local .then(ident()) .then(space()) - .then_ignore(just("=")) + .then_ignore(just('=')) .then(space()) .then(expr) .map_with_span(