hamlit 2.8.6 → 2.8.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a81acbe27600ac91e5a827a8ce114666a78a6d4e6d4928ead844f6d45dd36e3b
4
- data.tar.gz: 83021e624060ae3a5bac115e8bb4f0134208bd34b1e3f2deec23d815973cf2e6
3
+ metadata.gz: 1f85249809ae3c05e918d5fb69f544d908c1573aa0835ea9804df69e2f94d5b4
4
+ data.tar.gz: dded39056d8210c15156774fe4bb3a60e270bf62ae5f4b803cb058b0a0369810
5
5
  SHA512:
6
- metadata.gz: 11a5de507de1470d1c615446454ad3f32595ee55ca2ea8183f594d3fc92095f5f0fe78980e0c4f000b221743a3afd5d87b5f94411c5b1f1c532c538e3c6bb47e
7
- data.tar.gz: f29126f085e3148e9d79147a6f12b4b4a94d03e4ea64999027bd01474af8b526f8038104698f96c0d2a6cedb5b57ca662cdfdfa559219e4f843604b4d7dd3986
6
+ metadata.gz: ef3929f4707374a2c826005ca325cb23c6a2903ff8fc27efbe3eaed3dcc99d47b607e0c963c6cda5261761d7e0da69609602ca67365e4b631a228a496e722324
7
+ data.tar.gz: d4519892eeb2946af49181d2ddd9a56bdc3477718ae5c637d70e5b59da23d14420f7c9bca7256ef3e27613ef2012efb8e7f678bc1a1bba5b8ff4779633d72613
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. This
4
4
  project adheres to [Semantic Versioning](http://semver.org/). This change log is based upon
5
5
  [keep-a-changelog](https://github.com/olivierlacan/keep-a-changelog).
6
6
 
7
+ ## [2.8.7](https://github.com/k0kubun/hamlit/compare/v2.8.6...v2.8.7) - 2018-02-17
8
+
9
+ ### Fixed
10
+
11
+ - Fix parser error on string interpolation in attributes
12
+
7
13
  ## [2.8.6](https://github.com/k0kubun/hamlit/compare/v2.8.5...v2.8.6) - 2017-12-22
8
14
 
9
15
  ### Fixed
data/Gemfile CHANGED
@@ -13,7 +13,8 @@ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.2')
13
13
  end
14
14
 
15
15
  gem 'benchmark-ips', '2.3.0'
16
- gem 'm'
16
+ gem 'maxitest'
17
+ gem 'minitest-line'
17
18
  gem 'pry-byebug'
18
19
 
19
20
  # To resolve circular require warning
@@ -71,31 +71,33 @@ module Hamlit
71
71
 
72
72
  def each_attr(tokens)
73
73
  attr_tokens = []
74
- array_open = 0
75
- brace_open = 0
76
- paren_open = 0
74
+ open_tokens = Hash.new { |h, k| h[k] = 0 }
77
75
 
78
76
  tokens.each do |token|
79
77
  _, type, _ = token
80
78
  case type
81
79
  when :on_comma
82
- if array_open == 0 && brace_open == 0 && paren_open == 0
80
+ if open_tokens.values.all?(&:zero?)
83
81
  yield(attr_tokens)
84
82
  attr_tokens = []
85
83
  next
86
84
  end
87
85
  when :on_lbracket
88
- array_open += 1
86
+ open_tokens[:array] += 1
89
87
  when :on_rbracket
90
- array_open -= 1
88
+ open_tokens[:array] -= 1
91
89
  when :on_lbrace
92
- brace_open += 1
90
+ open_tokens[:block] += 1
93
91
  when :on_rbrace
94
- brace_open -= 1
92
+ open_tokens[:block] -= 1
95
93
  when :on_lparen
96
- paren_open += 1
94
+ open_tokens[:paren] += 1
97
95
  when :on_rparen
98
- paren_open -= 1
96
+ open_tokens[:paren] -= 1
97
+ when :on_embexpr_beg
98
+ open_tokens[:embexpr] += 1
99
+ when :on_embexpr_end
100
+ open_tokens[:embexpr] -= 1
99
101
  when :on_sp
100
102
  next if attr_tokens.empty?
101
103
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hamlit
3
- VERSION = '2.8.6'
3
+ VERSION = '2.8.7'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hamlit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.6
4
+ version: 2.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-22 00:00:00.000000000 Z
11
+ date: 2018-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: temple
@@ -368,7 +368,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
368
368
  version: '0'
369
369
  requirements: []
370
370
  rubyforge_project:
371
- rubygems_version: 2.7.3
371
+ rubygems_version: 2.7.5
372
372
  signing_key:
373
373
  specification_version: 4
374
374
  summary: High Performance Haml Implementation