iro 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/smoke +1 -0
- data/lib/iro/ruby/parser.rb +11 -12
- data/lib/iro/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b399230a80d0496dd2acece235f43228b8f131ecc6feb3a2755a769e6f1c29a
|
4
|
+
data.tar.gz: 510f1be3916920fc0127685769a829499e45d3eb61e6881dbfd24ba0a0b7e16d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9141a6e8d4a5d9e3b0139e0bf98bf24c927c5bb6d26a9d2efce4fe04f4b915479392b9602bb609ba5a470f059d4380ff7ba001e3a770fdfdd0e8ad449e3b2db3
|
7
|
+
data.tar.gz: 1e26da497804de73c765bcd20636eb86a4a9d5a0b91e235606759385764b655a1d96bb30789706d0f35f240da102b97e787a5ca502eedb75b83a09e78fa945be
|
data/bin/smoke
CHANGED
data/lib/iro/ruby/parser.rb
CHANGED
@@ -30,6 +30,8 @@ module Iro
|
|
30
30
|
heredoc_end: 'Delimiter',
|
31
31
|
tstring_beg: 'Delimiter',
|
32
32
|
tstring_end: 'Delimiter',
|
33
|
+
qwords_beg: 'Delimiter', # For `**%w[**foo]`
|
34
|
+
words_sep: 'Delimiter', # For `%w[foo**]**` in Ruby 2.4 or older
|
33
35
|
embexpr_beg: 'Delimiter',
|
34
36
|
embexpr_end: 'Delimiter',
|
35
37
|
backtick: 'Delimiter',
|
@@ -64,7 +66,7 @@ module Iro
|
|
64
66
|
# TODO: Maybe multiline support is needed.
|
65
67
|
def register_scanner_event(group, event)
|
66
68
|
pos = event.position
|
67
|
-
register_token group, [pos[0], pos[1]+1, event.content.
|
69
|
+
register_token group, [pos[0], pos[1]+1, event.content.bytesize]
|
68
70
|
end
|
69
71
|
|
70
72
|
def highlight_end_as(group)
|
@@ -77,7 +79,7 @@ module Iro
|
|
77
79
|
(scanner_event.kw_type? && kw_group(scanner_event.content))
|
78
80
|
raise 'bug' unless group
|
79
81
|
|
80
|
-
t = scanner_event.position + [scanner_event.content.
|
82
|
+
t = scanner_event.position + [scanner_event.content.bytesize]
|
81
83
|
t[1] += 1
|
82
84
|
@tokens[group].reject! { |ev| ev == t }
|
83
85
|
@end_stack.reject!{|e| e == scanner_event} if scanner_event.kw_type? && scanner_event.content == 'end'
|
@@ -90,7 +92,7 @@ module Iro
|
|
90
92
|
register_token #{group.inspect}, [
|
91
93
|
lineno + idx,
|
92
94
|
idx == 0 ? column+1 : 1,
|
93
|
-
s.
|
95
|
+
s.bytesize]
|
94
96
|
end
|
95
97
|
super
|
96
98
|
end
|
@@ -103,7 +105,7 @@ module Iro
|
|
103
105
|
@end_stack << result
|
104
106
|
else
|
105
107
|
group = kw_group(str)
|
106
|
-
register_token group, [lineno, column+1, str.
|
108
|
+
register_token group, [lineno, column+1, str.bytesize]
|
107
109
|
end
|
108
110
|
end
|
109
111
|
end
|
@@ -112,7 +114,7 @@ module Iro
|
|
112
114
|
# ^^^ rubySymbol
|
113
115
|
# ^ no highlight
|
114
116
|
def on_label(str)
|
115
|
-
register_token 'rubySymbol', [lineno, column+1, str.
|
117
|
+
register_token 'rubySymbol', [lineno, column+1, str.bytesize-1]
|
116
118
|
super
|
117
119
|
end
|
118
120
|
|
@@ -158,16 +160,13 @@ module Iro
|
|
158
160
|
nil
|
159
161
|
end
|
160
162
|
|
161
|
-
def on_top_const_ref(name)
|
162
|
-
register_scanner_event 'Type', name
|
163
|
-
nil
|
164
|
-
end
|
165
|
-
alias on_const_ref on_top_const_ref
|
166
|
-
|
167
|
-
def on_const_path_ref(_base, name)
|
163
|
+
def on_top_const_ref(*, name)
|
168
164
|
register_scanner_event 'Type', name
|
169
165
|
nil
|
170
166
|
end
|
167
|
+
alias on_const_ref on_top_const_ref
|
168
|
+
alias on_const_path_ref on_top_const_ref
|
169
|
+
alias on_const_path_field on_top_const_ref
|
171
170
|
|
172
171
|
def on_fcall(ident)
|
173
172
|
highlight_keyword_like_method(ident)
|
data/lib/iro/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masataka Pocke Kuwabara
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|