diff --git a/lib/rouge/lexers/yang.rb b/lib/rouge/lexers/yang.rb index 59e1182171..7b5ba66ca2 100644 --- a/lib/rouge/lexers/yang.rb +++ b/lib/rouge/lexers/yang.rb @@ -140,7 +140,7 @@ def self.types end end - rule %r/[^;{}\s*+'"]+/, Name + rule %r/[^;{}\s'"]+/, Name end end end diff --git a/spec/lexers/yang_spec.rb b/spec/lexers/yang_spec.rb index f7448c31cf..b98176245e 100644 --- a/spec/lexers/yang_spec.rb +++ b/spec/lexers/yang_spec.rb @@ -68,6 +68,16 @@ ['Punctuation', ';'] end + it 'parse complex name' do + assert_tokens_equal ' +abc*iu{ asd;}', + ['Text.Whitespace', ' '], + ['Name', '+abc*iu'], + ['Punctuation', '{'], + ['Text.Whitespace', ' '], + ['Name', 'asd'], + ['Punctuation', ';}'] + end + end end