From 0518c836361824f94c1f44285e0ca7dbea505582 Mon Sep 17 00:00:00 2001 From: ash Date: Tue, 27 Aug 2024 22:41:52 +0100 Subject: [PATCH] toml: support inline tables in arrays --- lib/rouge/lexers/toml.rb | 1 + spec/visual/samples/toml | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/rouge/lexers/toml.rb b/lib/rouge/lexers/toml.rb index a3e5ae1eba..242bd5dd00 100644 --- a/lib/rouge/lexers/toml.rb +++ b/lib/rouge/lexers/toml.rb @@ -67,6 +67,7 @@ class TOML < RegexLexer mixin :esc_str rule %r/\,/, Punctuation rule %r/\[/, Punctuation, :array + rule %r/\{/, Punctuation, :inline end state :dq do diff --git a/spec/visual/samples/toml b/spec/visual/samples/toml index 1f012d3ff9..fefd4424c5 100644 --- a/spec/visual/samples/toml +++ b/spec/visual/samples/toml @@ -135,6 +135,7 @@ nested_arrays_of_ints = [ [ 1, 2 ], [3, 4, 5] ] nested_mixed_array = [ [ 1, 2 ], ["a", "b", "c"] ] string_array = [ "all", 'strings', """are the same""", '''type''' ] link-libraries = ["mylib::mylib"] +points = [ { x = 1, y = 2 }, { x = 3, y = 4 } ] # Dotted keys physical.color = "orange"