rouge 1.7.7 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rouge.rb +1 -0
  3. data/lib/rouge/cli.rb +1 -1
  4. data/lib/rouge/demos/liquid +11 -0
  5. data/lib/rouge/lexer.rb +8 -0
  6. data/lib/rouge/lexers/apache.rb +1 -0
  7. data/lib/rouge/lexers/apple_script.rb +1 -0
  8. data/lib/rouge/lexers/c.rb +1 -0
  9. data/lib/rouge/lexers/clojure.rb +1 -0
  10. data/lib/rouge/lexers/coffeescript.rb +1 -0
  11. data/lib/rouge/lexers/common_lisp.rb +1 -0
  12. data/lib/rouge/lexers/conf.rb +1 -0
  13. data/lib/rouge/lexers/cpp.rb +1 -0
  14. data/lib/rouge/lexers/csharp.rb +1 -0
  15. data/lib/rouge/lexers/css.rb +1 -0
  16. data/lib/rouge/lexers/dart.rb +1 -0
  17. data/lib/rouge/lexers/diff.rb +1 -0
  18. data/lib/rouge/lexers/elixir.rb +1 -0
  19. data/lib/rouge/lexers/erb.rb +1 -0
  20. data/lib/rouge/lexers/erlang.rb +1 -0
  21. data/lib/rouge/lexers/factor.rb +1 -0
  22. data/lib/rouge/lexers/gherkin.rb +1 -1
  23. data/lib/rouge/lexers/go.rb +1 -0
  24. data/lib/rouge/lexers/groovy.rb +1 -0
  25. data/lib/rouge/lexers/haml.rb +1 -0
  26. data/lib/rouge/lexers/handlebars.rb +1 -0
  27. data/lib/rouge/lexers/haskell.rb +1 -0
  28. data/lib/rouge/lexers/html.rb +1 -0
  29. data/lib/rouge/lexers/http.rb +1 -0
  30. data/lib/rouge/lexers/ini.rb +1 -0
  31. data/lib/rouge/lexers/io.rb +1 -0
  32. data/lib/rouge/lexers/java.rb +1 -0
  33. data/lib/rouge/lexers/javascript.rb +1 -0
  34. data/lib/rouge/lexers/liquid.rb +282 -0
  35. data/lib/rouge/lexers/literate_coffeescript.rb +1 -0
  36. data/lib/rouge/lexers/literate_haskell.rb +2 -2
  37. data/lib/rouge/lexers/llvm.rb +1 -0
  38. data/lib/rouge/lexers/lua.rb +1 -0
  39. data/lib/rouge/lexers/make.rb +1 -0
  40. data/lib/rouge/lexers/markdown.rb +1 -0
  41. data/lib/rouge/lexers/matlab.rb +1 -0
  42. data/lib/rouge/lexers/moonscript.rb +1 -0
  43. data/lib/rouge/lexers/nginx.rb +1 -0
  44. data/lib/rouge/lexers/nim.rb +5 -4
  45. data/lib/rouge/lexers/objective_c.rb +1 -1
  46. data/lib/rouge/lexers/ocaml.rb +1 -1
  47. data/lib/rouge/lexers/perl.rb +1 -0
  48. data/lib/rouge/lexers/php.rb +1 -0
  49. data/lib/rouge/lexers/plain_text.rb +1 -0
  50. data/lib/rouge/lexers/prolog.rb +1 -0
  51. data/lib/rouge/lexers/properties.rb +1 -0
  52. data/lib/rouge/lexers/puppet.rb +1 -0
  53. data/lib/rouge/lexers/python.rb +1 -0
  54. data/lib/rouge/lexers/qml.rb +1 -1
  55. data/lib/rouge/lexers/r.rb +2 -2
  56. data/lib/rouge/lexers/racket.rb +1 -0
  57. data/lib/rouge/lexers/ruby.rb +3 -2
  58. data/lib/rouge/lexers/rust.rb +1 -0
  59. data/lib/rouge/lexers/sass.rb +1 -0
  60. data/lib/rouge/lexers/scala.rb +1 -0
  61. data/lib/rouge/lexers/scheme.rb +1 -0
  62. data/lib/rouge/lexers/scss.rb +1 -0
  63. data/lib/rouge/lexers/sed.rb +1 -0
  64. data/lib/rouge/lexers/shell.rb +1 -0
  65. data/lib/rouge/lexers/slim.rb +3 -2
  66. data/lib/rouge/lexers/smalltalk.rb +1 -0
  67. data/lib/rouge/lexers/sml.rb +1 -1
  68. data/lib/rouge/lexers/sql.rb +1 -0
  69. data/lib/rouge/lexers/swift.rb +24 -7
  70. data/lib/rouge/lexers/tcl.rb +1 -0
  71. data/lib/rouge/lexers/tex.rb +1 -0
  72. data/lib/rouge/lexers/toml.rb +1 -0
  73. data/lib/rouge/lexers/vb.rb +1 -1
  74. data/lib/rouge/lexers/viml.rb +1 -0
  75. data/lib/rouge/lexers/xml.rb +1 -0
  76. data/lib/rouge/lexers/yaml.rb +1 -0
  77. data/lib/rouge/themes/molokai.rb +82 -0
  78. data/lib/rouge/themes/monokai.rb +4 -2
  79. data/lib/rouge/version.rb +1 -1
  80. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eed83627d9abcd8949888faeeb65f50cd9e58acf
4
- data.tar.gz: d91dd66f2cd06ff6e51f357024cc94f4b4208ce6
3
+ metadata.gz: fb12f42e4a61412bfcb144f6c7a3f0bdee592a0d
4
+ data.tar.gz: 64ed9c6cd72560e3d34ec0f5476b2643eadf1076
5
5
  SHA512:
6
- metadata.gz: 663f9107a981c45401d5b848a2df1dfbd6c7010872edb94f5037ba2817b3ca0450bbb288b4d9abaceea30ecdc79e16531eea2a8b52127f5deeda1d8911210b59
7
- data.tar.gz: ca028582547991858de77a07be1d41a76dc4095199712d62289786ec1ef106beaad71c8f02e1764c3e6f4340561af079722a98bb0f4a7f82510bdd8b88dd8cc9
6
+ metadata.gz: 9387f40bda37a8b68bbbb21539749bd228fb642f32a1095bed0ec764ee9ec59bb84eb7c5131f66f4240cee32406c5b62986ae98f3ef114be6dd50e04ae5bea32
7
+ data.tar.gz: 733371e70bd2af9a4ec2d989ba69c96a1117525e15375ff2d0175628759c8e64c67f5519dbb0870dc3dc1015821396b2310200f71acd7d3ea4f794f22140f105
data/lib/rouge.rb CHANGED
@@ -53,4 +53,5 @@ load load_dir.join('rouge/themes/colorful.rb')
53
53
  load load_dir.join('rouge/themes/base16.rb')
54
54
  load load_dir.join('rouge/themes/github.rb')
55
55
  load load_dir.join('rouge/themes/monokai.rb')
56
+ load load_dir.join('rouge/themes/molokai.rb')
56
57
  load load_dir.join('rouge/themes/monokai_sublime.rb')
data/lib/rouge/cli.rb CHANGED
@@ -87,7 +87,7 @@ module Rouge
87
87
 
88
88
  def self.class_from_arg(arg)
89
89
  case arg
90
- when 'version', '--version'
90
+ when 'version', '--version', '-v'
91
91
  Version
92
92
  when 'help'
93
93
  Help
@@ -0,0 +1,11 @@
1
+ <ul id="products">
2
+ {% for product in products %}
3
+ <li>
4
+ <h2>{{ product.title }}</h2>
5
+ Only {{ product.price | format_as_money }}
6
+
7
+ <p>{{ product.description | prettyprint | truncate: 200 }}</p>
8
+
9
+ </li>
10
+ {% endfor %}
11
+ </ul>
data/lib/rouge/lexer.rb CHANGED
@@ -65,6 +65,14 @@ module Rouge
65
65
  lexer_class && lexer_class.new(opts)
66
66
  end
67
67
 
68
+ # Specify or get this lexer's title. Meant to be human-readable.
69
+ def title(t=nil)
70
+ if t.nil?
71
+ t = tag.capitalize
72
+ end
73
+ @title ||= t
74
+ end
75
+
68
76
  # Specify or get this lexer's description.
69
77
  def desc(arg=:absent)
70
78
  if arg == :absent
@@ -3,6 +3,7 @@ require 'yaml'
3
3
  module Rouge
4
4
  module Lexers
5
5
  class Apache < RegexLexer
6
+ title "Apache"
6
7
  desc 'configuration files for Apache web server'
7
8
  tag 'apache'
8
9
  mimetypes 'text/x-httpd-conf', 'text/x-apache-conf'
@@ -2,6 +2,7 @@
2
2
  module Rouge
3
3
  module Lexers
4
4
  class AppleScript < RegexLexer
5
+ title "AppleScript"
5
6
  desc "The AppleScript scripting language by Apple Inc. (http://developer.apple.com/applescript/)"
6
7
 
7
8
  tag 'applescript'
@@ -7,6 +7,7 @@ module Rouge
7
7
  filenames '*.c', '*.h', '*.idc'
8
8
  mimetypes 'text/x-chdr', 'text/x-csrc'
9
9
 
10
+ title "C"
10
11
  desc "The C programming language"
11
12
 
12
13
  # optional comment or whitespace
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class Clojure < RegexLexer
6
+ title "Clojure"
6
7
  desc "The Clojure programming language (clojure.org)"
7
8
 
8
9
  tag 'clojure'
@@ -8,6 +8,7 @@ module Rouge
8
8
  filenames '*.coffee', 'Cakefile'
9
9
  mimetypes 'text/coffeescript'
10
10
 
11
+ title "CoffeeScript"
11
12
  desc 'The Coffeescript programming language (coffeescript.org)'
12
13
 
13
14
  def self.analyze_text(text)
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class CommonLisp < RegexLexer
6
+ title "Common Lisp"
6
7
  desc "The Common Lisp variant of Lisp (common-lisp.net)"
7
8
  tag 'common_lisp'
8
9
  aliases 'cl', 'common-lisp'
@@ -6,6 +6,7 @@ module Rouge
6
6
  tag 'conf'
7
7
  aliases 'config', 'configuration'
8
8
 
9
+ title "Config File"
9
10
  desc 'A generic lexer for configuration files'
10
11
  filenames '*.conf', '*.config'
11
12
 
@@ -5,6 +5,7 @@ module Rouge
5
5
  load_const :C, 'c.rb'
6
6
 
7
7
  class Cpp < C
8
+ title "C++"
8
9
  desc "The C++ programming language"
9
10
 
10
11
  tag 'cpp'
@@ -8,6 +8,7 @@ module Rouge
8
8
  filenames '*.cs'
9
9
  mimetypes 'text/x-csharp'
10
10
 
11
+ title "C#"
11
12
  desc 'a multi-paradigm language targeting .NET'
12
13
 
13
14
  # TODO: support more of unicode
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class CSS < RegexLexer
6
+ title "CSS"
6
7
  desc "Cascading Style Sheets, used to style web pages"
7
8
 
8
9
  tag 'css'
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class Dart < RegexLexer
6
+ title "Dart"
6
7
  desc "The Dart programming language (dartlang.com)"
7
8
 
8
9
  tag 'dart'
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class Diff < RegexLexer
6
+ title "diff"
6
7
  desc "Lexes unified diffs or patches"
7
8
 
8
9
  tag 'diff'
@@ -5,6 +5,7 @@ module Rouge
5
5
  # Direct port of pygments Lexer.
6
6
  # See: https://bitbucket.org/birkenfeld/pygments-main/src/7304e4759ae65343d89a51359ca538912519cc31/pygments/lexers/functional.py?at=default#cl-2362
7
7
  class Elixir < RegexLexer
8
+ title "Elixir"
8
9
  desc "Elixir language (elixir-lang.org)"
9
10
 
10
11
  tag 'elixir'
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class ERB < TemplateLexer
6
+ title "ERB"
6
7
  desc "Embedded ruby template files"
7
8
 
8
9
  tag 'erb'
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class Erlang < RegexLexer
6
+ title "Erlang"
6
7
  desc "The Erlang programming language (erlang.org)"
7
8
  tag 'erlang'
8
9
  aliases 'erl'
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class Factor < RegexLexer
6
+ title "Factor"
6
7
  desc "Factor, the practical stack language (factorcode.org)"
7
8
  tag 'factor'
8
9
  filenames '*.factor'
@@ -6,6 +6,7 @@ module Rouge
6
6
  tag 'gherkin'
7
7
  aliases 'cucumber', 'behat'
8
8
 
9
+ title "Gherkin"
9
10
  desc 'A business-readable spec DSL ( github.com/cucumber/cucumber/wiki/Gherkin )'
10
11
 
11
12
  filenames '*.feature'
@@ -134,4 +135,3 @@ module Rouge
134
135
  end
135
136
  end
136
137
  end
137
-
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class Go < RegexLexer
6
+ title "Go"
6
7
  desc 'The Go programming language (http://golang.org)'
7
8
  tag 'go'
8
9
  aliases 'go', 'golang'
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class Groovy < RegexLexer
6
+ title "Groovy"
6
7
  desc 'The Groovy programming language (groovy.codehaus.org)'
7
8
  tag 'groovy'
8
9
  filenames '*.groovy'
@@ -7,6 +7,7 @@ module Rouge
7
7
  class Haml < RegexLexer
8
8
  include Indentation
9
9
 
10
+ title "Haml"
10
11
  desc "The Haml templating system for Ruby (haml.info)"
11
12
 
12
13
  tag 'haml'
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class Handlebars < TemplateLexer
6
+ title "Handlebars"
6
7
  desc 'the Handlebars and Mustache templating languages'
7
8
  tag 'handlebars'
8
9
  aliases 'hbs', 'mustache'
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class Haskell < RegexLexer
6
+ title "Haskell"
6
7
  desc "The Haskell programming language (haskell.org)"
7
8
 
8
9
  tag 'haskell'
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class HTML < RegexLexer
6
+ title "HTML"
6
7
  desc "HTML, the markup language of the web"
7
8
  tag 'html'
8
9
  filenames '*.htm', '*.html', '*.xhtml'
@@ -4,6 +4,7 @@ module Rouge
4
4
  module Lexers
5
5
  class HTTP < RegexLexer
6
6
  tag 'http'
7
+ title "HTTP"
7
8
  desc 'http requests and responses'
8
9
 
9
10
  def self.methods
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class INI < RegexLexer
6
+ title "INI"
6
7
  desc 'the INI configuration format'
7
8
  tag 'ini'
8
9
 
@@ -4,6 +4,7 @@ module Rouge
4
4
  module Lexers
5
5
  class IO < RegexLexer
6
6
  tag 'io'
7
+ title "Io"
7
8
  desc 'The IO programming language (http://iolanguage.com)'
8
9
  mimetypes 'text/x-iosrc'
9
10
  filenames '*.io'
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class Java < RegexLexer
6
+ title "Java"
6
7
  desc "The Java programming language (java.com)"
7
8
 
8
9
  tag 'java'
@@ -3,6 +3,7 @@
3
3
  module Rouge
4
4
  module Lexers
5
5
  class Javascript < RegexLexer
6
+ title "JavaScript"
6
7
  desc "JavaScript, the browser scripting language"
7
8
 
8
9
  tag 'javascript'
@@ -0,0 +1,282 @@
1
+ # -*- coding: utf-8 -*- #
2
+
3
+ module Rouge
4
+ module Lexers
5
+ class Liquid < RegexLexer
6
+ title "Liquid"
7
+ desc 'Liquid is a templating engine for Ruby (liquidmarkup.org)'
8
+ tag 'liquid'
9
+ filenames '*.liquid'
10
+
11
+ state :root do
12
+ rule /[^\{]+/, Text
13
+
14
+ rule /(\{%)(\s*)/ do
15
+ groups Punctuation, Text::Whitespace
16
+ push :tag_or_block
17
+ end
18
+
19
+ rule /(\{\{)(\s*)/ do
20
+ groups Punctuation, Text::Whitespace
21
+ push :output
22
+ end
23
+
24
+ rule /\{/, Text
25
+ end
26
+
27
+ state :tag_or_block do
28
+ # builtin logic blocks
29
+ rule /(if|unless|elsif|case)(?=\s+)/, Keyword::Reserved, :condition
30
+
31
+ rule /(when)(\s+)/ do
32
+ groups Keyword::Reserved, Text::Whitespace
33
+ push :when
34
+ end
35
+
36
+ rule /(else)(\s*)(%\})/ do
37
+ groups Keyword::Reserved, Text::Whitespace, Punctuation
38
+ pop!
39
+ end
40
+
41
+ # other builtin blocks
42
+ rule /(capture)(\s+)([^\s%]+)(\s*)(%\})/ do
43
+ groups Name::Tag, Text::Whitespace, Name::Attribute, Text::Whitespace, Punctuation
44
+ pop!
45
+ end
46
+
47
+ rule /(comment)(\s*)(%\})/ do
48
+ groups Name::Tag, Text::Whitespace, Punctuation
49
+ push :comment
50
+ end
51
+
52
+ rule /(raw)(\s*)(%\})/ do
53
+ groups Name::Tag, Text::Whitespace, Punctuation
54
+ push :raw
55
+ end
56
+
57
+ rule /assign/, Name::Tag, :assign
58
+ rule /include/, Name::Tag, :include
59
+
60
+ # end of block
61
+ rule /(end(case|unless|if))(\s*)(%\})/ do
62
+ groups Keyword::Reserved, nil, Text::Whitespace, Punctuation
63
+ pop!
64
+ end
65
+
66
+ rule /(end([^\s%]+))(\s*)(%\})/ do
67
+ groups Name::Tag, nil, Text::Whitespace, Punctuation
68
+ pop!
69
+ end
70
+
71
+ # builtin tags
72
+ rule /(cycle)(\s+)(([^\s:]*)(:))?(\s*)/ do |m|
73
+ token Name::Tag, m[1]
74
+ token Text::Whitespace, m[2]
75
+
76
+ if m[4] =~ /'[^']*'/
77
+ token Str::Single, m[4]
78
+ elsif m[4] =~ /"[^"]*"/
79
+ token Str::Double, m[4]
80
+ else
81
+ token Name::Attribute, m[4]
82
+ end
83
+
84
+ token Punctuation, m[5]
85
+ token Text::Whitespace, m[6]
86
+
87
+ push :variable_tag_markup
88
+ end
89
+
90
+ # other tags or blocks
91
+ rule /([^\s%]+)(\s*)/ do
92
+ groups Name::Tag, Text::Whitespace
93
+ push :tag_markup
94
+ end
95
+ end
96
+
97
+ state :output do
98
+ mixin :whitespace
99
+ mixin :generic
100
+
101
+ rule /\}\}/, Punctuation, :pop!
102
+ rule /\|/, Punctuation, :filters
103
+ end
104
+
105
+ state :filters do
106
+ mixin :whitespace
107
+
108
+ rule (/\}\}/) { token Punctuation; reset_stack }
109
+
110
+ rule /([^\s\|:]+)(:?)(\s*)/ do
111
+ groups Name::Function, Punctuation, Text::Whitespace
112
+ push :filter_markup
113
+ end
114
+ end
115
+
116
+ state :filter_markup do
117
+ rule /\|/, Punctuation, :pop!
118
+
119
+ mixin :end_of_tag
120
+ mixin :end_of_block
121
+ mixin :default_param_markup
122
+ end
123
+
124
+ state :condition do
125
+ mixin :end_of_block
126
+ mixin :whitespace
127
+
128
+ rule /([=!><]=?)/, Operator
129
+
130
+ rule /\b((!)|(not\b))/ do
131
+ groups nil, Operator, Operator::Word
132
+ end
133
+
134
+ rule /([\w\.\'"]+)(\s+)(contains)(\s+)([\w\.\'"]+)/ do
135
+ groups nil, Text::Whitespace, Operator::Word, Text::Whitespace
136
+ end
137
+
138
+ mixin :generic
139
+ mixin :whitespace
140
+ end
141
+
142
+ state :when do
143
+ mixin :end_of_block
144
+ mixin :whitespace
145
+ mixin :generic
146
+ end
147
+
148
+ state :operator do
149
+ rule /(\s*)((=|!|>|<)=?)(\s*)/ do
150
+ groups Text::Whitespace, Operator, nil, Text::Whitespace
151
+ pop!
152
+ end
153
+
154
+ rule /(\s*)(\bcontains\b)(\s*)/ do
155
+ groups Text::Whitespace, Operator::Word, Text::Whitespace
156
+ pop!
157
+ end
158
+ end
159
+
160
+ state :end_of_tag do
161
+ rule (/\}\}/) { token Punctuation; reset_stack }
162
+ end
163
+
164
+ state :end_of_block do
165
+ rule (/%\}/) { token Punctuation; reset_stack }
166
+ end
167
+
168
+ # states for unknown markup
169
+ state :param_markup do
170
+ mixin :whitespace
171
+
172
+ rule /([^\s=:]+)(\s*)(=|:)/ do
173
+ groups Name::Attribute, Text::Whitespace, Operator
174
+ end
175
+
176
+ rule /(\{\{)(\s*)([^\s\}])(\s*)(\}\})/ do
177
+ groups Punctuation, Text::Whitespace, nil, Text::Whitespace, Punctuation
178
+ end
179
+
180
+ mixin :string
181
+ mixin :number
182
+ mixin :keyword
183
+
184
+ rule /,/, Punctuation
185
+ end
186
+
187
+ state :default_param_markup do
188
+ mixin :param_markup
189
+ rule /./, Text
190
+ end
191
+
192
+ state :variable_param_markup do
193
+ mixin :param_markup
194
+ mixin :variable
195
+ rule /./, Text
196
+ end
197
+
198
+ state :tag_markup do
199
+ rule (/%\}/) { token Punctuation; reset_stack }
200
+ mixin :default_param_markup
201
+ end
202
+
203
+ state :variable_tag_markup do
204
+ rule (/%\}/) { token Punctuation; reset_stack }
205
+ mixin :variable_param_markup
206
+ end
207
+
208
+ # states for different values types
209
+ state :keyword do
210
+ rule /\b(false|true)\b/, Keyword::Constant
211
+ end
212
+
213
+ state :variable do
214
+ rule /\.(?=\w)/, Punctuation
215
+ rule /[a-zA-Z_]\w*/, Name::Variable
216
+ end
217
+
218
+ state :string do
219
+ rule /'[^']*'/, Str::Single
220
+ rule /"[^"]*"/, Str::Double
221
+ end
222
+
223
+ state :number do
224
+ rule /\d+\.\d+/, Num::Float
225
+ rule /\d+/, Num::Integer
226
+ end
227
+
228
+ state :generic do
229
+ mixin :keyword
230
+ mixin :string
231
+ mixin :variable
232
+ mixin :number
233
+ end
234
+
235
+ state :whitespace do
236
+ rule /[ \t]+/, Text::Whitespace
237
+ end
238
+
239
+ state :comment do
240
+ rule /(\{%)(\s*)(endcomment)(\s*)(%\})/ do
241
+ groups Punctuation, Text::Whitespace, Name::Tag, Text::Whitespace, Punctuation
242
+ reset_stack
243
+ end
244
+
245
+ rule /./, Comment
246
+ end
247
+
248
+ state :raw do
249
+ rule /[^\{]+/, Text
250
+
251
+ rule /(\{%)(\s*)(endraw)(\s*)(%\})/ do
252
+ groups Punctuation, Text::Whitespace, Name::Tag, Text::Whitespace, Punctuation
253
+ reset_stack
254
+ end
255
+
256
+ rule /\{/, Text
257
+ end
258
+
259
+ state :assign do
260
+ mixin :whitespace
261
+
262
+ rule /(\s*)(=)(\s*)/ do
263
+ groups Text::Whitespace, Operator, Text::Whitespace
264
+ end
265
+
266
+ rule /\|/, Punctuation, :filters
267
+
268
+ mixin :generic
269
+ end
270
+
271
+ state :include do
272
+ mixin :whitespace
273
+
274
+ rule /([^\.]+)(\.)(html|liquid)/ do
275
+ groups Name::Attribute, Punctuation, Name::Attribute
276
+ end
277
+
278
+ mixin :variable_tag_markup
279
+ end
280
+ end
281
+ end
282
+ end