Skip to content

Commit

Permalink
feat: containers, fix: remove exec
Browse files Browse the repository at this point in the history
  • Loading branch information
ravsii committed Oct 1, 2024
1 parent 7da87e5 commit 01e5436
Show file tree
Hide file tree
Showing 8 changed files with 1,722 additions and 852 deletions.
20 changes: 14 additions & 6 deletions grammar.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
const PREC = {
connection: 100,
conn_identifier: 90,
identifier: 50,

block: 20,
label: 10,
};

const newline = /\n/;
const terminator = choice(newline, ';', '\0');

const opseq = (...x) => optional(seq(...x))
const opfield = (...x) => optional(field(...x))
const rseq = (...x) => repeat(seq(...x))
const r1seq = (...x) => repeat1(seq(...x))

Expand All @@ -30,13 +33,16 @@ module.exports = grammar({
declaration: $ => seq(
choice(
$.connection_refference,
$.expr,
$._expr,
),
opseq(":",
opfield("label", $.label),
opfield("block", $.block),
),
repeat(field("label", $.label)),
terminator,
),

expr: $ => seq(
_expr: $ => seq(
field("identifier", $.identifier),
rseq(
field("connection", $.connection),
Expand All @@ -50,11 +56,13 @@ module.exports = grammar({
/-+>/,
/--+/,
))),
label: _ => seq(":", /.*/),

block: $ => prec(PREC.block, seq("{", repeat($.declaration), "}")),
label: $ => prec(PREC.label, repeat1($._ident_base)),

connection_refference: $ => seq(
"(",
$.expr,
$._expr,
")",
field("connection_identifier", $.connection_identifier),
optional($._fields),
Expand Down
102 changes: 81 additions & 21 deletions src/grammar.json

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

103 changes: 68 additions & 35 deletions src/node-types.json

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

Loading

0 comments on commit 01e5436

Please sign in to comment.