diff --git a/grammar.js b/grammar.js index c4ad86d..196bbc8 100644 --- a/grammar.js +++ b/grammar.js @@ -111,7 +111,7 @@ module.exports = grammar({ _new_container_block_definition: ($) => prec( PREC.CONTAINER, - choice($._eol, seq(choice($.shape, $.container), $._end)) + choice($._eol, seq(choice($.shape, $.container, $.connection), $._end)) ), // -------------------------------------------- diff --git a/src/grammar.json b/src/grammar.json index ad1a7f4..eff3577 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -428,6 +428,10 @@ { "type": "SYMBOL", "name": "container" + }, + { + "type": "SYMBOL", + "name": "connection" } ] }, diff --git a/src/parser.c b/src/parser.c index bc35e88..e023a52 100644 Binary files a/src/parser.c and b/src/parser.c differ diff --git a/test/corpus/connection.txt b/test/corpus/connection.txt index f1d8b64..50ef980 100644 --- a/test/corpus/connection.txt +++ b/test/corpus/connection.txt @@ -196,3 +196,29 @@ foo.biz.baz -> bar.baz.biz: Label (label) ) ) + +================================================================================ +Connection of shapes inside a block of container +================================================================================ +foo.baz: { + foo -> biz: Label +} + +-------------------------------------------------------------------------------- + +(source_file + (container + (container_key) (dot) + (container + (container_key) + (block + (connection + (shape_key) + (arrow) + (shape_key) + (label) + ) + ) + ) + ) +)