diff options
author | Matthäus G. Chajdas <dev@anteru.net> | 2022-12-31 16:29:56 +0100 |
---|---|---|
committer | Matthäus G. Chajdas <dev@anteru.net> | 2022-12-31 16:38:28 +0100 |
commit | dd52102c38ebe78cd57748e09f38929fd283ad04 (patch) | |
tree | 4483b20252f0955d14c843927763fc62be2a7d9c /tests | |
parent | 92b77b268178721b69531113afd933d1900984d3 (diff) | |
download | pygments-git-dd52102c38ebe78cd57748e09f38929fd283ad04.tar.gz |
Improve the Smithy metadata matcher.
Previously, metadata foo bar baz = 23 was accepted, but according to
the definition https://smithy.io/2.0/spec/idl.html#grammar-token-smithy-MetadataSection
it should be "metadata"<whitespace>Identifier/String<optional whitespace>.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/examplefiles/smithy/test.smithy | 12 | ||||
-rw-r--r-- | tests/examplefiles/smithy/test.smithy.output | 52 |
2 files changed, 64 insertions, 0 deletions
diff --git a/tests/examplefiles/smithy/test.smithy b/tests/examplefiles/smithy/test.smithy index 3d20f064..9317fee9 100644 --- a/tests/examplefiles/smithy/test.smithy +++ b/tests/examplefiles/smithy/test.smithy @@ -2,6 +2,18 @@ $version: "1.0" namespace test +metadata "foo" = ["bar", "baz"] +metadata validators = [ + { + name: "ValidatorName" + id: "ValidatorId" + message: "Some string" + configuration: { + selector: "operation" + } + } +] + /// Define how an HTTP request is serialized given a specific protocol, /// authentication scheme, and set of input parameters. @trait(selector: "operation") diff --git a/tests/examplefiles/smithy/test.smithy.output b/tests/examplefiles/smithy/test.smithy.output index 1f224897..db44a381 100644 --- a/tests/examplefiles/smithy/test.smithy.output +++ b/tests/examplefiles/smithy/test.smithy.output @@ -7,6 +7,58 @@ ' test' Name.Class '\n\n' Text.Whitespace +'metadata' Keyword.Declaration +' ' Text.Whitespace +'"foo"' Name.Class +' ' Text.Whitespace +'=' Name.Decorator +' ' Text.Whitespace +'[' Text +'"bar"' Literal.String.Double +',' Punctuation +' ' Text.Whitespace +'"baz"' Literal.String.Double +']' Text +'\n' Text.Whitespace + +'metadata' Keyword.Declaration +' ' Text.Whitespace +'validators' Name.Class +' ' Text.Whitespace +'=' Name.Decorator +' ' Text.Whitespace +'[' Text +'\n ' Text.Whitespace +'{' Text +'\n ' Text.Whitespace +'name:' Name.Label +' ' Text.Whitespace +'"ValidatorName"' Literal.String.Double +'\n ' Text.Whitespace +'id:' Name.Label +' ' Text.Whitespace +'"ValidatorId"' Literal.String.Double +'\n ' Text.Whitespace +'message:' Name.Label +' ' Text.Whitespace +'"Some string"' Literal.String.Double +'\n ' Text.Whitespace +'configuration:' Name.Label +' ' Text.Whitespace +'{' Text +'\n ' Text.Whitespace +'selector:' Name.Label +' ' Text.Whitespace +'"operation"' Literal.String.Double +'\n ' Text.Whitespace +'}' Text +'\n ' Text.Whitespace +'}' Text +'\n' Text.Whitespace + +']' Text +'\n\n' Text.Whitespace + '/// Define how an HTTP request is serialized given a specific protocol,' Comment.Multiline '\n' Text.Whitespace |