Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ee641d1539 | |||
| e6473f64ae | |||
| 2b7323eaf0 | |||
| 4c2a1d0012 |
11 changed files with 513 additions and 378 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@ module.exports = grammar({
|
|||
_select_pattern: ($) => choice(
|
||||
$._string_literal,
|
||||
$.boolean_literal,
|
||||
$.integer_literal,
|
||||
alias("any", $.any),
|
||||
$.pattern_binding,
|
||||
alias("default", $.default),
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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
4
src/grammar.json
generated
|
|
@ -757,6 +757,10 @@
|
|||
"type": "SYMBOL",
|
||||
"name": "boolean_literal"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "integer_literal"
|
||||
},
|
||||
{
|
||||
"type": "ALIAS",
|
||||
"content": {
|
||||
|
|
|
|||
4
src/node-types.json
generated
4
src/node-types.json
generated
|
|
@ -531,6 +531,10 @@
|
|||
"type": "default",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "integer_literal",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "interpreted_string_literal",
|
||||
"named": true
|
||||
|
|
|
|||
792
src/parser.c
generated
792
src/parser.c
generated
File diff suppressed because it is too large
Load diff
|
|
@ -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
|
||||
================================================================================
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
================================================================================
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
}
|
||||
],
|
||||
"metadata": {
|
||||
"version": "0.6.0",
|
||||
"version": "0.7.0",
|
||||
"license": "MIT",
|
||||
"description": "Blueprint grammar for tree-sitter",
|
||||
"links": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue