haml 7.2.0 → 7.2.1
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/.github/workflows/test.yml +1 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -0
- data/lib/haml/parser.rb +13 -5
- data/lib/haml/version.rb +1 -1
- 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: f4665a2a3c561765d35c0eeec78fdc87d2574cd640249089ace5035cc672e46f
|
|
4
|
+
data.tar.gz: 02146e70c4ace1a58a1598ccfe25b08a22f06d0aa0554244806b1593cce85caa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3b24e11afe577f0b175fca4ae8fe5bdc45ae245e2f654a6d832ac2c619e25f2aeefb700e5ba51742f22ad5e849cc06d8831ef2a2c30083aab7a2bab727fcfe01
|
|
7
|
+
data.tar.gz: ad77cc1be2d2831de2cbac2568efbc368fb1627626c19138e7059b120fb2e85c88057b8f9fb705c22f82b7d910497018e156acbc61691ce52db4de5d39a0e764
|
data/.github/workflows/test.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/lib/haml/parser.rb
CHANGED
|
@@ -688,8 +688,17 @@ module Haml
|
|
|
688
688
|
#
|
|
689
689
|
# To scan such code correctly, this scans `a( hash, foo: bar }` instead, stops when there is
|
|
690
690
|
# 1 more :on_embexpr_end (the last '}') than :on_embexpr_beg, and resurrects '{' afterwards.
|
|
691
|
-
|
|
692
|
-
|
|
691
|
+
#
|
|
692
|
+
# Old attributes allow invalid Hash constructs (e.g., `{ hash, foo: bar }`).
|
|
693
|
+
# Replacing the opening `{` with `a(` makes the syntax look like a method call so
|
|
694
|
+
# Ripper can lex it reliably.
|
|
695
|
+
|
|
696
|
+
attributes_hash, rest = balance_tokens(
|
|
697
|
+
text.sub(?{, METHOD_CALL_PREFIX),
|
|
698
|
+
[:on_lbrace, :on_tlambeg, :on_embexpr_beg],
|
|
699
|
+
[:on_rbrace, :on_embexpr_end],
|
|
700
|
+
count: 1)
|
|
701
|
+
attributes_hash = attributes_hash.sub(METHOD_CALL_PREFIX, ?{)
|
|
693
702
|
rescue SyntaxError => e
|
|
694
703
|
if e.message == Error.message(:unbalanced_brackets) && !@template.empty?
|
|
695
704
|
text << "\n#{@next_line.text}"
|
|
@@ -850,10 +859,9 @@ module Haml
|
|
|
850
859
|
text = ''.dup
|
|
851
860
|
Ripper.lex(buf).each do |_, token, str|
|
|
852
861
|
text << str
|
|
853
|
-
|
|
854
|
-
when start
|
|
862
|
+
if start.include?(token)
|
|
855
863
|
count += 1
|
|
856
|
-
|
|
864
|
+
elsif finish.include?(token)
|
|
857
865
|
count -= 1
|
|
858
866
|
end
|
|
859
867
|
|
data/lib/haml/version.rb
CHANGED