lib/rouge/lexers/yaml.rb in rouge-0.2.0 vs lib/rouge/lexers/yaml.rb in rouge-0.2.1

- old
+ new

@@ -1,8 +1,9 @@ module Rouge module Lexers class YAML < RegexLexer + desc "Yaml Ain't Markup Language (yaml.org)" tag 'yaml' aliases 'yml' filenames '*.yaml', '*.yml' # NB: Tabs are forbidden in YAML, which is why you see things @@ -121,11 +122,11 @@ end # indented line in the block context state :block_line do # line end - rule /[ ]*(?=#|$)/, 'Text', :pop! + rule /[ ]*(?=#|$)/, 'Text', :pop! rule /[ ]+/, 'Text' # tags, anchors, and aliases mixin :descriptors # block collections and scalars mixin :block_nodes @@ -143,11 +144,11 @@ # a full-form tag rule /!<[0-9A-Za-z;\/?:@&=+$,_.!~*'()\[\]%-]+>/, 'Keyword.Type' # a tag in the form '!', '!suffix' or '!handle!suffix' rule %r( - !(?:[\w-]+)? #handle - (?:![\w;/?:@&=+$,.!~*\'()\[\]%-]+)? #suffix + (?:![\w-]+)? # handle + !(?:[\w;/?:@&=+$,.!~*\'()\[\]%-]*) # suffix )x, 'Keyword.Type' # an anchor rule /&[\w-]+/, 'Name.Label'