Compare commits
2 Commits
8aac147e8e
...
9828b023cd
Author | SHA1 | Date |
---|---|---|
Dmitriy Pleshevskiy | 9828b023cd | |
Dmitriy Pleshevskiy | e67c50d7cb |
|
@ -1,12 +1,7 @@
|
|||
# Actors
|
||||
hans: Hans Niemann
|
||||
|
||||
defendants: |md
|
||||
# Defendants
|
||||
|
||||
hello world
|
||||
| {
|
||||
shape: text
|
||||
defendants: {
|
||||
mc: Magnus Carlsen
|
||||
playmagnus: Play Magnus Group
|
||||
chesscom: Chess.com
|
||||
|
|
|
@ -32,16 +32,16 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1686737040,
|
||||
"narHash": "sha256-R+JicNaI9mcxodtHkci894txjt4IMsfOnlAarA/r0xQ=",
|
||||
"lastModified": 1686736559,
|
||||
"narHash": "sha256-YyUSVoOKIDAscTx7IZhF9x3qgZ9dPNF19fKk+4c5irc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6d1d80a232a355a65dc4d3bfea1f108e8dac1340",
|
||||
"rev": "ddf4688dc7aeb14e8a3c549cb6aa6337f187a884",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"ref": "nixos-23.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
tools.url = "git+https://git.pleshevski.ru/mynix/tools";
|
||||
};
|
||||
|
|
|
@ -188,7 +188,7 @@ module.exports = grammar({
|
|||
)
|
||||
),
|
||||
|
||||
shape_key: ($) => choice($.string, $._identifier),
|
||||
shape_key: ($) => choice($.keyword_underscore, $.string, $._identifier),
|
||||
|
||||
_identifier: ($) =>
|
||||
seq(
|
||||
|
@ -348,6 +348,7 @@ module.exports = grammar({
|
|||
_connection_arrowhead_attr_key: ($) =>
|
||||
choice("source-arrowhead", "target-arrowhead"),
|
||||
|
||||
keyword_underscore: (_) => "_",
|
||||
keyword_classes: (_) => "classes",
|
||||
keyword_class: (_) => "class",
|
||||
keyword_style: (_) => "style",
|
||||
|
|
|
@ -4,12 +4,15 @@
|
|||
(shape_key) @variable
|
||||
(attr_key) @property
|
||||
(reserved) @error
|
||||
(class_name) @constant
|
||||
|
||||
[
|
||||
(keyword_style)
|
||||
(keyword_classes)
|
||||
(keyword_class)
|
||||
] @keyword
|
||||
(class_name) @constant
|
||||
|
||||
(keyword_underscore) @keyword.return
|
||||
|
||||
; Literals
|
||||
;-------------------------------------------------------------------------------
|
||||
|
@ -27,9 +30,11 @@
|
|||
; Comments
|
||||
;-------------------------------------------------------------------------------
|
||||
|
||||
(language) @comment
|
||||
(line_comment) @comment.line
|
||||
(block_comment) @comment.block
|
||||
[
|
||||
(language)
|
||||
(line_comment)
|
||||
(block_comment)
|
||||
] @comment
|
||||
|
||||
; Punctiation
|
||||
;-------------------------------------------------------------------------------
|
||||
|
|
|
@ -853,6 +853,10 @@
|
|||
"shape_key": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "keyword_underscore"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "string"
|
||||
|
@ -1818,6 +1822,10 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"keyword_underscore": {
|
||||
"type": "STRING",
|
||||
"value": "_"
|
||||
},
|
||||
"keyword_classes": {
|
||||
"type": "STRING",
|
||||
"value": "classes"
|
||||
|
|
|
@ -186,6 +186,10 @@
|
|||
"type": "escape_sequence",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "keyword_underscore",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"named": true
|
||||
|
@ -314,6 +318,10 @@
|
|||
"type": "escape_sequence",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "keyword_underscore",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"named": true
|
||||
|
@ -392,6 +400,10 @@
|
|||
"type": "escape_sequence",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "keyword_underscore",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"named": true
|
||||
|
@ -612,6 +624,10 @@
|
|||
"type": "keyword_style",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "keyword_underscore",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"named": false
|
||||
|
|
BIN
src/parser.c
BIN
src/parser.c
Binary file not shown.
|
@ -267,3 +267,25 @@ primty: Primitive types {
|
|||
)
|
||||
)
|
||||
)
|
||||
|
||||
================================================================================
|
||||
Declare a container with a references to the parent container
|
||||
================================================================================
|
||||
container: {
|
||||
_.foo: baz
|
||||
}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(container
|
||||
(container_key)
|
||||
(block
|
||||
(container
|
||||
(container_key (keyword_underscore))
|
||||
(dot)
|
||||
(shape (shape_key) (label))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -278,3 +278,13 @@ bar
|
|||
(block_comment)
|
||||
(shape (shape_key))
|
||||
)
|
||||
|
||||
================================================================================
|
||||
Declare a shape with a parent container reference
|
||||
================================================================================
|
||||
_
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(shape (shape_key (keyword_underscore)))
|
||||
)
|
||||
|
|
|
@ -33,6 +33,12 @@ foo: Foo Bar {
|
|||
bar.baz
|
||||
# <- string.special
|
||||
# ^ variable
|
||||
|
||||
_.foo.style.fill: "#8800aa"
|
||||
# <- keyword.return
|
||||
# ^ variable
|
||||
# ^ keyword
|
||||
# ^ property
|
||||
}
|
||||
# <- punctuation.bracket
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue