rouge 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rouge/lexers/php.rb +10 -0
- data/lib/rouge/lexers/python.rb +14 -0
- data/lib/rouge/version.rb +1 -1
- metadata +1 -1
data/lib/rouge/lexers/php.rb
CHANGED
@@ -130,6 +130,16 @@ module Rouge
|
|
130
130
|
rule /[${\\]+/, 'Literal.String.Double'
|
131
131
|
end
|
132
132
|
|
133
|
+
state :interp_double do
|
134
|
+
rule /\}\}/, 'Literal.String.Interpol', :pop!
|
135
|
+
mixin :php
|
136
|
+
end
|
137
|
+
|
138
|
+
state :interp_single do
|
139
|
+
rule /\}/, 'Literal.String.Interpol', :pop!
|
140
|
+
mixin :php
|
141
|
+
end
|
142
|
+
|
133
143
|
def stream_tokens(source, &b)
|
134
144
|
super(source) do |tok, val|
|
135
145
|
if tok.name == 'Name.Other' and builtins.include? val
|
data/lib/rouge/lexers/python.rb
CHANGED
@@ -152,6 +152,19 @@ module Rouge
|
|
152
152
|
rule /\n/, 'Literal.String'
|
153
153
|
end
|
154
154
|
|
155
|
+
state :escape do
|
156
|
+
rule %r(\\
|
157
|
+
( [\\abfnrtv"']
|
158
|
+
| \n
|
159
|
+
| N{.*?}
|
160
|
+
| u[a-fA-F0-9]{4}
|
161
|
+
| U[a-fA-F0-9]{8}
|
162
|
+
| x[a-fA-F0-9]{2}
|
163
|
+
| [0-7]{1,3}
|
164
|
+
)
|
165
|
+
)x, 'Literal.String.Escape'
|
166
|
+
end
|
167
|
+
|
155
168
|
state :dqs do
|
156
169
|
rule /"/, 'Literal.String', :pop!
|
157
170
|
rule /\\\\|\\"|\\\n/, 'Literal.String.Escape'
|
@@ -182,6 +195,7 @@ module Rouge
|
|
182
195
|
mixin :"#{qtype}"
|
183
196
|
end
|
184
197
|
end
|
198
|
+
|
185
199
|
end
|
186
200
|
end
|
187
201
|
end
|
data/lib/rouge/version.rb
CHANGED