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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/sirop/sourcifier.rb +6 -4
- data/lib/sirop/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: 4d475eb4c57f828b193d42ae84700166e27b3a75dea70b45e5db06ed794c0bfc
|
4
|
+
data.tar.gz: 9e3862c38a622de3b2201793b3ce46926992c6293ccc6d08d06c0e92d86cfa4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9483256cc41c894eb859dabeb48d3156b6b7debb15a24e0179da4c11807910ca474754a58d87270ea862861b7c2e21bf479ff3e591597f78ff6ec47586f8fa5a
|
7
|
+
data.tar.gz: 31cfc2c1bc8f4159b365479ddb02a92f545d33ffc89b506040c72927bd565326fde580d9fef625c4ab25a5309ba4c09090c5a677ce1ea642200f4f0dcf6bcea9
|
data/CHANGELOG.md
CHANGED
data/lib/sirop/sourcifier.rb
CHANGED
@@ -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