rouge 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Rouge
2
2
  def self.version
3
- "0.1.0"
3
+ "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rouge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: