Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uiua-0.9 #29

Merged
merged 7 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading