raka 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/raka/token.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9181e13ec5517b0c40faba8c2e121a9b44c9da29de439bd5303d8fa5ee50870
|
4
|
+
data.tar.gz: a4c9f8d7e03f067f8266cf77cef52b2d153111c3b24c13a37f9927fe5b543fe5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03cfe492010d2621bd84aa0c03f452be71de1d26d1d1e354a608893dca47d512ad666a42fb1c0e1d7b89522ad60acbcdd77a9466da388917a6992c9c9afbc8cd
|
7
|
+
data.tar.gz: f5f1d930083bf7342cac0285ba625219f6eb24fea7e1d61241e81bceda711a49496fa58b899de89759573143671adc74f142c730cfe7343b3663855ca91fcc1a
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.0
|
data/lib/raka/token.rb
CHANGED
@@ -157,12 +157,12 @@ class Token
|
|
157
157
|
symbol = @chain.pop.to_s
|
158
158
|
# if the pattern contains child pattern like percent_(\d+), we change the capture to
|
159
159
|
# named capture so that it can be captured later. The name is symbol with the index, like func0
|
160
|
-
pattern = pattern.gsub(/\(\S+?\)/).with_index { |m, i| "(?<#{symbol}#{i}>#{m})" }
|
160
|
+
pattern = pattern.to_s.gsub(/\(\S+?\)/).with_index { |m, i| "(?<#{symbol}#{i}>#{m})" }
|
161
161
|
|
162
162
|
# if the symbol is _, \S+ will be put in chain, it indicates not to capture,
|
163
163
|
# so just replace it with the refined pattern
|
164
164
|
if symbol == Pattern::ANY # match-everything and not bound
|
165
|
-
@chain.push pattern
|
165
|
+
@chain.push "#{pattern}\\w*"
|
166
166
|
else
|
167
167
|
@chain.push "(?<#{symbol}>(#{pattern}\\w*))"
|
168
168
|
end
|