lib/rouge/lexers/yaml.rb in rouge-4.0.1 vs lib/rouge/lexers/yaml.rb in rouge-4.1.0

- old
+ new

@@ -16,12 +16,10 @@ def self.detect?(text) # look for the %YAML directive return true if text =~ /\A\s*%YAML/m end - SPECIAL_VALUES = Regexp.union(%w(true false null)) - # NB: Tabs are forbidden in YAML, which is why you see things # like /[ ]+/. # reset the indentation levels def reset_indent @@ -338,10 +336,10 @@ token Text push :plain_scalar_in_block_context_new_line end rule %r/[ ]+/, Str - rule SPECIAL_VALUES, Name::Constant + rule %r((true|false|null)\b), Keyword::Constant rule %r/\d+(?:\.\d+)?(?=(\r?\n)| +#)/, Literal::Number, :pop! # regular non-whitespace characters rule %r/[^\s:]+/, Str end