Skip to content

Commit

Permalink
Uiua-0.9 (#29)
Browse files Browse the repository at this point in the history
* modified:   flake.lock
* remove unsupported flag for regex
* modified:   grammar.js
* update src/
* bump version to 0.11
* modified:   ChangeLog.md
  • Loading branch information
shnarazk authored Feb 29, 2024
1 parent 373f507 commit 942e836
Show file tree
Hide file tree
Showing 9 changed files with 23,653 additions and 22,013 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tree-sitter-uiua"
description = "Uiua grammar for the tree-sitter parsing library"
version = "0.10.0"
version = "0.11.0"
keywords = ["incremental", "parsing", "Uiua"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/tree-sitter/tree-sitter-uiua"
Expand Down
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

### 0.11.0: 2024-02-29

- follow Uiua-0.9.0
- Note: function strands are treated as arrays, just as they were

### 0.10.0: 2024-02-01

- follow Uiua-0.8.0
Expand Down
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 34 additions & 14 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ module.exports = grammar({
string: $ => token(/\$?"(\\["bnrst0]||[^"])+"/),
multiLineString: $ => /\$ .*/,
signature: $ => seq('|', /[0-9]+(\.[0-9]+)?/),
identifier: $ => token(/[A-Z][A-Za-z]*!*|[a-z][A-Za-z]?!*|\p{Emoji}/u),
identifier: $ => token(/[A-Z][A-Za-z]*!*|[a-z][A-Za-z]?!*|\p{Emoji}/),
identifierDeprecated: $ => token(/[a-z][A-Za-z]{2,}/),
system: $ => token(/&[a-z]+/),
comment: $ => /#.*/,
Expand Down Expand Up @@ -134,6 +134,11 @@ module.exports = grammar({
$.deprecated,
),
constant: $ => choice(
token('e'),
token('NaN'),
token('NumProcs'),

// Since 0.9.0
// (0, Eta, Constant, ("eta", 'η')),
token('eta'),
token('η'),
Expand All @@ -146,9 +151,6 @@ module.exports = grammar({
// (0, Infinity, Constant, ("infinity", '∞')),
token('infinity'),
token('∞'),
token('e'),
token('NaN'),
token('NumProcs'),
),
function: $ => choice(
// (1(2), Dup, Stack, ("duplicate", '.')),
Expand Down Expand Up @@ -388,6 +390,9 @@ module.exports = grammar({
token('get'),
token('insert'),
token('remove'),

// Since 0.9.0
token('repr'),
),
modifier1: $ => choice(
// (1[1], Reduce, AggregatingModifier, ("reduce", '/')),
Expand Down Expand Up @@ -424,19 +429,26 @@ module.exports = grammar({
// Since 0.4.0
token('rectify'),
token('⌅'),
token('this'),
token('↬'),
token('recur'),
token('↫'),

// Since 0.6.0
token('un'),
token('°'),

// Since 0.8.0
token('content'),
token('⊔'),
token('bind'),

// Since 0.9.0
token('on'),
token('⟜'),
token('inventory'),
token('⍚'),
token('content'),
token('◇'),
token('pool'),
token('stringify'),
token('signature'),
token('shapes'),
token('types'),
),
modifier2: $ => choice(
// (2[1], Fold, AggregatingModifier, ("fold", '∧')),
Expand Down Expand Up @@ -475,10 +487,11 @@ module.exports = grammar({
token('⍢'),

// Since 0.4.0
token('all'),
token('⋔'),
token('setinv'),
token('setunder'),

// Since 0.9.0
token('f'),
),
deprecated: $ => choice(
token('❥'),
Expand All @@ -489,8 +502,9 @@ module.exports = grammar({
token('⌂'),
token('↰'),

// Since 0.4.0
token('⟜'),
// removed at 0.9.0?
// // Since 0.4.0
// token('⟜'),

// Since 0.8.0
token('unpack'),
Expand All @@ -500,6 +514,12 @@ module.exports = grammar({
token('cross'),
token('⊠'),
token(';'),

// Since 0.9.0
token('↬'),
token('↫'),
token('all'),
token('⋔'),
),
// _whitespace: $ => /[ \t]+/,
emptyMultiLineString: $ => token(/\$\r?\n/),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tree-sitter-uiua",
"version": "0.10.0",
"version": "0.11.0",
"description": "parser for Uiua",
"main": "bindings/node",
"scripts": {
Expand Down
Loading

0 comments on commit 942e836

Please sign in to comment.