From 2a3d0f4b390457174ed09347dd29e97ff9a783e4 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 15 Dec 2021 20:27:41 +0100 Subject: Set Rules Episode VII: The Set Awakens --- src/syntax/highlight.rs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'src/syntax/highlight.rs') diff --git a/src/syntax/highlight.rs b/src/syntax/highlight.rs index 22e6cf50..85fbef12 100644 --- a/src/syntax/highlight.rs +++ b/src/syntax/highlight.rs @@ -96,22 +96,23 @@ impl Category { NodeKind::EnDash => Some(Category::Shortcut), NodeKind::EmDash => Some(Category::Shortcut), NodeKind::Escape(_) => Some(Category::Escape), + NodeKind::Not => Some(Category::Keyword), + NodeKind::And => Some(Category::Keyword), + NodeKind::Or => Some(Category::Keyword), + NodeKind::With => Some(Category::Keyword), NodeKind::Let => Some(Category::Keyword), + NodeKind::Set => Some(Category::Keyword), NodeKind::If => Some(Category::Keyword), NodeKind::Else => Some(Category::Keyword), + NodeKind::While => Some(Category::Keyword), NodeKind::For => Some(Category::Keyword), NodeKind::In => Some(Category::Keyword), - NodeKind::While => Some(Category::Keyword), NodeKind::Break => Some(Category::Keyword), NodeKind::Continue => Some(Category::Keyword), NodeKind::Return => Some(Category::Keyword), NodeKind::Import => Some(Category::Keyword), - NodeKind::Include => Some(Category::Keyword), NodeKind::From => Some(Category::Keyword), - NodeKind::Not => Some(Category::Keyword), - NodeKind::And => Some(Category::Keyword), - NodeKind::Or => Some(Category::Keyword), - NodeKind::With => Some(Category::Keyword), + NodeKind::Include => Some(Category::Keyword), NodeKind::Plus => Some(Category::Operator), NodeKind::Star => Some(Category::Operator), NodeKind::Slash => Some(Category::Operator), @@ -139,6 +140,7 @@ impl Category { Some(Category::Function) } NodeKind::WithExpr => Some(Category::Function), + NodeKind::SetExpr => Some(Category::Function), NodeKind::Call => Some(Category::Function), _ => Some(Category::Variable), }, @@ -161,21 +163,22 @@ impl Category { NodeKind::Array => None, NodeKind::Dict => None, NodeKind::Named => None, + NodeKind::Template => None, NodeKind::Group => None, + NodeKind::Block => None, NodeKind::Unary => None, NodeKind::Binary => None, NodeKind::Call => None, NodeKind::CallArgs => None, + NodeKind::Spread => None, NodeKind::Closure => None, NodeKind::ClosureParams => None, - NodeKind::Spread => None, - NodeKind::Template => None, - NodeKind::Block => None, - NodeKind::ForExpr => None, - NodeKind::WhileExpr => None, - NodeKind::IfExpr => None, - NodeKind::LetExpr => None, NodeKind::WithExpr => None, + NodeKind::LetExpr => None, + NodeKind::SetExpr => None, + NodeKind::IfExpr => None, + NodeKind::WhileExpr => None, + NodeKind::ForExpr => None, NodeKind::ForPattern => None, NodeKind::ImportExpr => None, NodeKind::ImportItems => None, -- cgit v1.2.3