lib/faml/text_compiler.rb in faml-0.3.2 vs lib/faml/text_compiler.rb in faml-0.3.3
- old
+ new
@@ -31,13 +31,13 @@
s = StringScanner.new(text)
temple = [:multi]
pos = s.pos
while s.scan_until(INTERPOLATION_BEGIN)
escapes = s[1].size
- pre = s.string.byteslice(pos ... (s.pos - s.matched.size))
- temple << [:static, pre] << [:static, "\\" * (escapes/2)]
- if escapes % 2 == 0
+ pre = s.string.byteslice(pos...(s.pos - s.matched.size))
+ temple << [:static, pre] << [:static, '\\' * (escapes / 2)]
+ if escapes.even?
# perform interpolation
if s[2] == '#{'
temple << [:escape, escape_html, [:dynamic, find_close_brace(s, lineno)]]
else
var = s[2][-1]
@@ -61,10 +61,10 @@
pos = scanner.pos
depth = HamlParser::Utils.balance(scanner, '{', '}')
if depth != 0
raise InvalidInterpolation.new(scanner.string, lineno)
else
- scanner.string.byteslice(pos ... (scanner.pos-1))
+ scanner.string.byteslice(pos...(scanner.pos - 1))
end
end
end
end