Compare commits

...

4 commits
v0.6.0 ... main

Author SHA1 Message Date
ee641d1539 Release 0.7.0
All checks were successful
ci/woodpecker/push/check Pipeline was successful
ci/woodpecker/tag/check Pipeline was successful
2025-04-02 10:16:51 +00:00
e6473f64ae Add integer select pattern
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2025-04-02 10:15:11 +00:00
2b7323eaf0 Test non-recursive comments
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2025-03-24 12:07:55 +00:00
4c2a1d0012 Test negative integer literal
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2025-03-12 21:33:34 +00:00
11 changed files with 513 additions and 378 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "tree-sitter-bp"
description = "Blueprint grammar for the tree-sitter parsing library"
version = "0.6.0"
version = "0.7.0"
keywords = ["incremental", "parsing", "android", "blueprint"]
categories = ["parsing", "text-editors"]
repository = "https://git.belanyi.fr/ambroisie/tree-sitter-bp"

View file

@ -163,6 +163,7 @@ module.exports = grammar({
_select_pattern: ($) => choice(
$._string_literal,
$.boolean_literal,
$.integer_literal,
alias("any", $.any),
$.pattern_binding,
alias("default", $.default),

View file

@ -1,6 +1,6 @@
{
"name": "tree-sitter-bp",
"version": "0.6.0",
"version": "0.7.0",
"description": "Blueprint grammar for tree-sitter",
"main": "bindings/node",
"types": "bindings/node",

View file

@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "tree-sitter-bp"
description = "Bp grammar for tree-sitter"
version = "0.6.0"
version = "0.7.0"
keywords = ["incremental", "parsing", "tree-sitter", "bp"]
classifiers = [
"Intended Audience :: Developers",

4
src/grammar.json generated
View file

@ -757,6 +757,10 @@
"type": "SYMBOL",
"name": "boolean_literal"
},
{
"type": "SYMBOL",
"name": "integer_literal"
},
{
"type": "ALIAS",
"content": {

4
src/node-types.json generated
View file

@ -531,6 +531,10 @@
"type": "default",
"named": true
},
{
"type": "integer_literal",
"named": true
},
{
"type": "interpreted_string_literal",
"named": true

792
src/parser.c generated

File diff suppressed because it is too large Load diff

View file

@ -116,6 +116,19 @@ Block comment is not recursive
(source_file
(comment))
================================================================================
Block comment is not recursive (error)
================================================================================
/* /* */ */
--------------------------------------------------------------------------------
(source_file
(comment)
(ERROR
(UNEXPECTED '*')))
================================================================================
Unterminated comment
================================================================================

View file

@ -20,6 +20,35 @@ foo = 42
--------------------------------------------------------------------------------
(source_file
(assignment
(identifier)
(operator)
(integer_literal)))
================================================================================
Integer literal (negative)
================================================================================
foo = -42
--------------------------------------------------------------------------------
(source_file
(assignment
(identifier)
(operator)
(integer_literal)))
================================================================================
Integer literal (negative space)
================================================================================
foo = - 42
--------------------------------------------------------------------------------
(source_file
(assignment
(identifier)

View file

@ -409,6 +409,46 @@ foo = select(some_boolean("IS_TRUE"), {
(boolean_literal))
(interpreted_string_literal))))))
================================================================================
Select (integer typed)
================================================================================
foo = select(some_integer("VALUE"), {
0: "0",
-1: "-1",
1: "1",
default: "default",
})
--------------------------------------------------------------------------------
(source_file
(assignment
(identifier)
(operator)
(select_expression
(select_value
(condition
(identifier)
(interpreted_string_literal)))
(select_cases
(select_case
(select_pattern
(integer_literal))
(interpreted_string_literal))
(select_case
(select_pattern
(integer_literal))
(interpreted_string_literal))
(select_case
(select_pattern
(integer_literal))
(interpreted_string_literal))
(select_case
(select_pattern
(default))
(interpreted_string_literal))))))
================================================================================
Select as an identifier
================================================================================

View file

@ -12,7 +12,7 @@
}
],
"metadata": {
"version": "0.6.0",
"version": "0.7.0",
"license": "MIT",
"description": "Blueprint grammar for tree-sitter",
"links": {