Skip to content

Commit 49643b2

Browse files
committed
Add performance hint and adapt syntax highlighting
Signed-off-by: Markus Rudolph <markus.rudolph@typefox.io>
1 parent 7ec4ef6 commit 49643b2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

hugo/content/docs/recipes/infix-operators/syntactical-implementation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ infix BinaryExpr on PrimaryExpression:
2929
PrimaryExpression: '(' expr=Expression ')' | value=Number;
3030
```
3131

32+
In addition to better readability, the new notation also makes use of **performance optimizations** to speed up expression parsing by roughly 50% compared to the typical way of writing expressions.
33+
3234
### Primary expression
3335

3436
The `PrimaryExpression` rule defines the basic building blocks of our expressions, which can be (for example) a parenthesized expression, an unary expression, or a number literal.

hugo/static/prism/langium-prism.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Prism.languages.langium = {
1818
greedy: true
1919
},
2020
keyword: {
21-
pattern: /\b(interface|fragment|terminal|boolean|current|extends|grammar|returns|bigint|hidden|import|infers|number|string|entry|false|infer|Date|true|type|with|on|infix)\b/
21+
pattern: /\b(interface|fragment|terminal|boolean|current|extends|grammar|returns|bigint|hidden|import|infers|number|string|entry|false|infer|Date|true|type|with|on|infix|left|right|assoc)\b/
2222
},
2323
property: {
2424
pattern: /\b[a-z][\w]*(?==|\?=|\+=|\??:|>)\b/

0 commit comments

Comments
 (0)