From ec5fa08c7c10c0d3198018cf5d49cc508de0256b Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Wed, 7 Dec 2022 23:22:40 +0300 Subject: [PATCH] cosmetic changes --- test/corpus/container.txt | 76 +++++++++++++++++++++++++++++++++++++++ test/corpus/shape.txt | 21 +++-------- test/highlight/shape.d2 | 10 ++++-- 3 files changed, 88 insertions(+), 19 deletions(-) create mode 100644 test/corpus/container.txt diff --git a/test/corpus/container.txt b/test/corpus/container.txt new file mode 100644 index 0000000..13e8b8f --- /dev/null +++ b/test/corpus/container.txt @@ -0,0 +1,76 @@ +================================================================================ +Declare a shape inside a container +================================================================================ +foo.baz + +-------------------------------------------------------------------------------- + +(source_file + (shape_key) (dot) (shape_key) +) + +================================================================================ +Use quoted string as a shape key +================================================================================ +'foo'.'baz' + +-------------------------------------------------------------------------------- + +(source_file + (shape_key (string)) (dot) (shape_key (string)) +) + +================================================================================ +Declare container inside a container using block +================================================================================ + +foo: { + bar: { + baz: { + biz + } + } +} + +-------------------------------------------------------------------------------- + +(source_file + (shape_key) + (block + (shape_key) + (block + (shape_key) + (block + (shape_key) + ) + ) + ) +) + +================================================================================ +Declare labaled container inside a labeled container using block +================================================================================ + +foo: Foo { + bar: Bar { + baz: Baz { + biz: Biz + } + } +} + +-------------------------------------------------------------------------------- + +(source_file + (shape_key) (label) + (block + (shape_key) (label) + (block + (shape_key) (label) + (block + (shape_key) (label) + ) + ) + ) +) + diff --git a/test/corpus/shape.txt b/test/corpus/shape.txt index c814671..c73d2f7 100644 --- a/test/corpus/shape.txt +++ b/test/corpus/shape.txt @@ -1,5 +1,5 @@ ================================================================================ -Simple shape +Simple shape key ================================================================================ foo bar @@ -12,7 +12,7 @@ bar ) ================================================================================ -Complex identifier +Complex shape key ================================================================================ Foo bar -Biz-baz- @@ -24,26 +24,15 @@ Complex identifier (shape_key) ) -================================================================================ -Declare a shape inside a container -================================================================================ -foo.baz - --------------------------------------------------------------------------------- - -(source_file - (shape_key) (dot) (shape_key) -) - ================================================================================ Use quoted string as a shape key ================================================================================ -'foo'.'baz' +'foo' -------------------------------------------------------------------------------- (source_file - (shape_key (string)) (dot) (shape_key (string)) + (shape_key (string)) ) ================================================================================ @@ -60,7 +49,7 @@ a;b;c ) ================================================================================ -Aliased shapes +Labeled shapes ================================================================================ a: Foo Bar a: Foo Bar; b: Biz Baz diff --git a/test/highlight/shape.d2 b/test/highlight/shape.d2 index daba794..7df9521 100644 --- a/test/highlight/shape.d2 +++ b/test/highlight/shape.d2 @@ -1,7 +1,11 @@ -foo.baz.biz +foo.'baz'.biz # <- variable -# ^ variable -# ^ variable +# ^ string +# ^ variable + +'biz': 'Baz' +# <- string +# ^ string foo: Foo Bar # <- variable