slimi 0.9.0 → 0.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df7564efc95dcfc968f262e77fff5be0daa2c779c43f8da3ee858a9508264685
4
- data.tar.gz: 414c5620fb99766908c117ef3ae49d14df04206d6121714fb167ec4a4773678b
3
+ metadata.gz: 6989d1c4e4e23b38c72bb2d4e45c93670a483af75341a7a4335272440705de63
4
+ data.tar.gz: 1a70a7daeb5fe5feb811dfba0a9f66b1a4949964ead59bd7b4a3a6a67c02eee5
5
5
  SHA512:
6
- metadata.gz: 12999b7675a1e9aa480cc32c8380a4a09f906376ce34e545db48f481991e1edb6d10bd3b8d6c0f1e09596d357b084b2f92d9958bee66149c27eacb50d0c76991
7
- data.tar.gz: 037a95dd6470e185b63c6c145706cf27c9271aa2d1017c8ab5806dd87f96a8a05d0f779d5dcb279c7bd242043f80d9af43e2da2515997f0fcbb4b33aa303defd
6
+ metadata.gz: 52f7902ed8840052c40a072d88c5949f66e017e0d1faca562baef7fb5dd8dcd88fe0d9d2585085f053e1c66acf37f046a12ec2a41600b0e52ad13999d62995cc
7
+ data.tar.gz: 7c11eb7a7fc1e8ebba1fd811726cf7658f95076523ef755ddf2d7078cb7dddafa7dafd29c583c135b18401252e18a3799f9922a2a2be94efc03b0a749cc65c8b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- slimi (0.9.0)
4
+ slimi (0.10.0)
5
5
  temple
6
6
  thor
7
7
  tilt
data/lib/slimi/parser.rb CHANGED
@@ -139,7 +139,9 @@ module Slimi
139
139
  @stacks.last << tag
140
140
  @stacks.last << [:static, ' '] if with_trailing_white_space
141
141
 
142
- if @scanner.skip(/[ \t]*(?=\R|$)/)
142
+ if @scanner.skip(/[ \t]*:[ \t]*/)
143
+ parse_block_expansion(tag)
144
+ elsif @scanner.skip(/[ \t]*(?=\R|$)/)
143
145
  content = [:multi]
144
146
  tag << content
145
147
  @stacks << content
@@ -166,6 +168,18 @@ module Slimi
166
168
  end
167
169
  end
168
170
 
171
+ # Parse the tag after a colon as the only child of the tag before it.
172
+ # e.g. li: a href="/" Home
173
+ # @param [Array] tag
174
+ def parse_block_expansion(tag)
175
+ content = [:multi]
176
+ tag << content
177
+ index = @stacks.size
178
+ @stacks << content
179
+ parse_tag_inner || syntax_error!(Errors::UnknownLineIndicatorError)
180
+ @stacks.delete_at(index)
181
+ end
182
+
169
183
  # Parse tag name part.
170
184
  # e.g. div.foo
171
185
  # ^^^
data/lib/slimi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Slimi
4
- VERSION = '0.9.0'
4
+ VERSION = '0.10.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slimi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  requirements: []
119
- rubygems_version: 3.6.7
119
+ rubygems_version: 4.0.20
120
120
  specification_version: 4
121
121
  summary: Yet another implementation for Slim template language.
122
122
  test_files: []