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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e8919acfe7f9be5a6458e9a9be7ecb82dfa93519b36b037167631cdd60a7eba
4
- data.tar.gz: 07cdfaa58a518b5498c289e0edac1b4a8b628311233f9ca1a32afb9fddfd77b8
3
+ metadata.gz: 4b399230a80d0496dd2acece235f43228b8f131ecc6feb3a2755a769e6f1c29a
4
+ data.tar.gz: 510f1be3916920fc0127685769a829499e45d3eb61e6881dbfd24ba0a0b7e16d
5
5
  SHA512:
6
- metadata.gz: a4bea256724d0ab3f55ad5fdd0bb41cfd0ee869330ec1c83665b4d09e925e6b67f9647500836092822cda924d7ce7b0621e06ae07d7d93c0bfb13dcd7397b722
7
- data.tar.gz: 0bc07ca76b25009571cb1d0c64e2ebd5218f6fb50840f1bb8d97af88fa450220b80e4f052107ecad642b81b50afa9207d1795bca26f2686e151e56a4d59f79b2
6
+ metadata.gz: 9141a6e8d4a5d9e3b0139e0bf98bf24c927c5bb6d26a9d2efce4fe04f4b915479392b9602bb609ba5a470f059d4380ff7ba001e3a770fdfdd0e8ad449e3b2db3
7
+ data.tar.gz: 1e26da497804de73c765bcd20636eb86a4a9d5a0b91e235606759385764b655a1d96bb30789706d0f35f240da102b97e787a5ca502eedb75b83a09e78fa945be
data/bin/smoke CHANGED
@@ -24,6 +24,7 @@ def main(repo, branch = 'master')
24
24
  open(url) do |f|
25
25
  IO.copy_stream f, tar
26
26
  end
27
+ tar.close
27
28
  sh! 'tar', 'xf', tar.path
28
29
  Pathname.glob('**/*.rb').each do |f|
29
30
  print "checking: #{f}"
@@ -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.size]
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.size]
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.size]
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.size]
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.size-1]
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)
@@ -1,3 +1,3 @@
1
1
  module Iro
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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.0
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-06-15 00:00:00.000000000 Z
11
+ date: 2018-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler