sirop 0.8.2 → 0.9

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: 381002abea803a80294a60a14da4118f7a62bc8c4f910fdda1ee196607d0b61e
4
- data.tar.gz: 19a6c1f5da67bd6d7eeb87de82ee49fbf17cf88053b6869ff70f22147c78ad77
3
+ metadata.gz: 4d475eb4c57f828b193d42ae84700166e27b3a75dea70b45e5db06ed794c0bfc
4
+ data.tar.gz: 9e3862c38a622de3b2201793b3ce46926992c6293ccc6d08d06c0e92d86cfa4f
5
5
  SHA512:
6
- metadata.gz: 24639a0bdf3e8be3c04c8486ed81eb11281bb2f55bf96a22f593ff9212f93e455c32443f2701779a62b0f90407c5d5fbd3f5f0c86ea18c5bb1d4b937f547a8b7
7
- data.tar.gz: 332816278386fb8a80e3396f680a662c70d24f91a0eb32ca4aef615e42bbf08f4b0d1ed2a7ce4a074b7ec601a09627190387667fb0f03ef7835b70cee55aea1c
6
+ metadata.gz: 9483256cc41c894eb859dabeb48d3156b6b7debb15a24e0179da4c11807910ca474754a58d87270ea862861b7c2e21bf479ff3e591597f78ff6ec47586f8fa5a
7
+ data.tar.gz: 31cfc2c1bc8f4159b365479ddb02a92f545d33ffc89b506040c72927bd565326fde580d9fef625c4ab25a5309ba4c09090c5a677ce1ea642200f4f0dcf6bcea9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 0.9 2025-08-17
2
+
3
+ - Add advance_to_end option to `Sourcifier#adjust_whitespace`
4
+
5
+ # 0.8.3 2025-08-08
6
+
7
+ - Add support for `it`
8
+
1
9
  # 0.8.2 2025-08-07
2
10
 
3
11
  - Fix source map calculation
@@ -46,6 +46,8 @@ module Sirop
46
46
  instance_variable_target: :emit_verbatim,
47
47
  instance_variable_write: [:name_loc, :operator_loc, :value],
48
48
  integer: :emit_verbatim,
49
+ it_parameters: :emit_nothing,
50
+ it_local_variable_read: :emit_verbatim,
49
51
  keyword_rest_parameter: [:operator_loc, :name_loc],
50
52
  keyword_parameter: :emit_verbatim,
51
53
  local_variable_and_write: [:name_loc, :operator_loc, :value],
@@ -120,11 +122,11 @@ module Sirop
120
122
  end
121
123
 
122
124
  def emit(str)
123
- update_source_map
125
+ update_source_map(str)
124
126
  @buffer << str
125
127
  end
126
128
 
127
- def update_source_map
129
+ def update_source_map(str = nil)
128
130
  return if !@source_map
129
131
 
130
132
  buffer_cur_line = @buffer.count("\n") + 1
@@ -132,7 +134,7 @@ module Sirop
132
134
  @source_map[buffer_cur_line + @source_map_line_ofs] ||= orig_source_cur_line
133
135
  end
134
136
 
135
- def adjust_whitespace(loc)
137
+ def adjust_whitespace(loc, advance_to_end: true)
136
138
  return if loc.is_a?(Sirop::Injection)
137
139
 
138
140
  if @last_loc_start
@@ -152,7 +154,7 @@ module Sirop
152
154
  end
153
155
  @last_loc = loc
154
156
  @last_loc_start = loc_start(loc)
155
- @last_loc_end = loc_end(loc)
157
+ @last_loc_end = advance_to_end ? loc_end(loc) : @last_loc_start
156
158
  end
157
159
 
158
160
  def emit_code(loc, semicolon: false, chomp: false)
data/lib/sirop/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Sirop
2
2
  # Sirop version
3
- VERSION = '0.8.2'
3
+ VERSION = '0.9'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sirop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: '0.9'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sharon Rosner