diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-01-03 12:29:35 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-01-03 12:32:17 +0100 |
| commit | 29b31c4a5ac4cde311c4d38b3d70130e7d27ba76 (patch) | |
| tree | fe4e5dbd2166a69af90e69578ad4602725cdb63c /src/syntax/parser.rs | |
| parent | 54962e6dcd002fd27918827996155fd7dc4e1cff (diff) | |
New import syntax
Diffstat (limited to 'src/syntax/parser.rs')
| -rw-r--r-- | src/syntax/parser.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/syntax/parser.rs b/src/syntax/parser.rs index a0b1e7d1..74be792f 100644 --- a/src/syntax/parser.rs +++ b/src/syntax/parser.rs @@ -237,7 +237,7 @@ impl<'s> Parser<'s> { self.tokens.set_mode(match kind { Group::Bracket | Group::Strong | Group::Emph => TokenMode::Markup, Group::Math | Group::MathRow(_, _) => TokenMode::Math, - Group::Brace | Group::Paren | Group::Expr | Group::Imports => TokenMode::Code, + Group::Brace | Group::Paren | Group::Expr => TokenMode::Code, }); match kind { @@ -249,7 +249,6 @@ impl<'s> Parser<'s> { Group::Math => self.assert(SyntaxKind::Dollar), Group::MathRow(l, _) => self.assert(SyntaxKind::Atom(l.into())), Group::Expr => self.repeek(), - Group::Imports => self.repeek(), } } @@ -274,7 +273,6 @@ impl<'s> Parser<'s> { Group::Math => Some((SyntaxKind::Dollar, true)), Group::MathRow(_, r) => Some((SyntaxKind::Atom(r.into()), true)), Group::Expr => Some((SyntaxKind::Semicolon, false)), - Group::Imports => None, } { if self.current.as_ref() == Some(&end) { // If another group closes after a group with the missing @@ -346,7 +344,6 @@ impl<'s> Parser<'s> { .next() .map_or(false, |group| group.kind == Group::Math), Some(SyntaxKind::Semicolon) => self.inside(Group::Expr), - Some(SyntaxKind::From) => self.inside(Group::Imports), Some(SyntaxKind::Atom(s)) => match s.as_str() { ")" => self.inside(Group::MathRow('(', ')')), "}" => self.inside(Group::MathRow('{', '}')), @@ -377,7 +374,6 @@ impl<'s> Parser<'s> { match self.groups.last().map(|group| group.kind) { Some(Group::Strong | Group::Emph) => n >= 2, - Some(Group::Imports) => n >= 1, Some(Group::Expr) if n >= 1 => { // Allow else and method call to continue on next line. self.groups.iter().nth_back(1).map(|group| group.kind) @@ -541,8 +537,6 @@ pub enum Group { MathRow(char, char), /// A group ended by a semicolon or a line break: `;`, `\n`. Expr, - /// A group for import items, ended by a semicolon, line break or `from`. - Imports, } impl Group { |
