diff --git a/grammar.js b/grammar.js index 3dff64a..1709b89 100644 --- a/grammar.js +++ b/grammar.js @@ -1,6 +1,8 @@ module.exports = grammar({ name: "d2", + extras: ($) => [], + word: ($) => $._word, rules: { diff --git a/src/grammar.json b/src/grammar.json index 5bc6424..59eec41 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -711,12 +711,7 @@ "value": "." } }, - "extras": [ - { - "type": "PATTERN", - "value": "\\s" - } - ], + "extras": [], "conflicts": [], "precedences": [], "externals": [], diff --git a/src/parser.c b/src/parser.c index d6ef1fd..1ffc90f 100644 Binary files a/src/parser.c and b/src/parser.c differ diff --git a/test/corpus/attributes.txt b/test/corpus/attributes.txt index 1dc817d..4223905 100644 --- a/test/corpus/attributes.txt +++ b/test/corpus/attributes.txt @@ -1,7 +1,6 @@ ================== Root attribute ================== - direction: value --- @@ -13,7 +12,6 @@ direction: value ================== Inline shape attribute ================== - foo.shape: oval foo.bar.baz.shape: oval @@ -27,7 +25,6 @@ foo.bar.baz.shape: oval ================== Inline style attribute ================== - foo.style.opacity: 5 --- diff --git a/test/corpus/connection.txt b/test/corpus/connection.txt index 1189558..b351835 100644 --- a/test/corpus/connection.txt +++ b/test/corpus/connection.txt @@ -1,7 +1,6 @@ ================== Simple connection ================== - foo--bar biz->baz biz<->baz @@ -35,7 +34,6 @@ biz<-baz ================== Formatted connection ================== - foo -- bar biz -> baz biz <-> baz @@ -70,7 +68,6 @@ biz <- baz ============================= Complex identifier connection ============================= - Foo Bar -- Biz Baz -Bar-Foo- <- -Baz-Biz- @@ -92,7 +89,6 @@ Foo Bar -- Biz Baz ================== Inline connection ================== - foo--bar->biz->baz --- @@ -112,7 +108,6 @@ foo--bar->biz->baz ================== Many connections inline ================== - foo--bar;biz->baz --- @@ -133,7 +128,6 @@ foo--bar;biz->baz ================== Descripted connection ================== - foo--bar: Question? bar->baz: Yes diff --git a/test/corpus/shape.txt b/test/corpus/shape.txt index 2717c7d..5809a81 100644 --- a/test/corpus/shape.txt +++ b/test/corpus/shape.txt @@ -1,7 +1,6 @@ ================== Simple shape ================== - foo bar @@ -15,7 +14,6 @@ bar ================== Complex identifier ================== - Foo bar -Biz-baz- @@ -29,7 +27,6 @@ Complex identifier ================== Inline shapes ================== - foo.baz --- @@ -46,7 +43,6 @@ foo.baz ================== Many shapes inline ================== - a;b;c --- @@ -60,9 +56,7 @@ a;b;c ================== Aliased shapes ================== - a: Foo Bar - a: Foo Bar; b: Biz Baz ---