parser 2.2.0 → 2.2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +8 -1
- data/lib/parser/current.rb +3 -3
- data/lib/parser/lexer.rl +1 -1
- data/lib/parser/lexer/literal.rb +4 -2
- data/lib/parser/ruby22.y +0 -3
- data/lib/parser/version.rb +1 -1
- data/test/test_lexer.rb +9 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f269b1e2401ffe3b9b35319fec5accc3378dfe5e
|
4
|
+
data.tar.gz: 66bff4c72a39532d0a008dc2c45bf597ec9a397a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c05ff7923a950a07a0b202a2a393e4bdc7bf4b8235d5e5517599fbc634b544b82fd24b1ce74e34ae0131d68c982fb7044af6428acd3f62aa580d1a038bb03b63
|
7
|
+
data.tar.gz: 19e74008c7cc99b59811266fd590db6870f6e52ce44077f0430d8a065efc44f0c5bab8b64b77ca3dc52cf431f8e59db7329be2f70dbf191a375e189be06bec11
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
-
v2.2.0 (2014-12-
|
4
|
+
v2.2.0.1 (2014-12-27)
|
5
|
+
---------------------
|
6
|
+
|
7
|
+
Bugs fixed:
|
8
|
+
* lexer.rl, lexer/literal: "{'a'::": don't parse as quoted label. (Peter Zotov)
|
9
|
+
* Update syntax deviation warning to reflect 2.2 release. (Peter Zotov)
|
10
|
+
|
11
|
+
v2.2.0 (2014-12-25)
|
5
12
|
-------------------
|
6
13
|
|
7
14
|
Bugs fixed:
|
data/lib/parser/current.rb
CHANGED
@@ -42,8 +42,8 @@ module Parser
|
|
42
42
|
|
43
43
|
else # :nocov:
|
44
44
|
# Keep this in sync with released Ruby.
|
45
|
-
warn_syntax_deviation 'parser/
|
46
|
-
require 'parser/
|
47
|
-
CurrentRuby =
|
45
|
+
warn_syntax_deviation 'parser/ruby22', '2.2'
|
46
|
+
require 'parser/ruby22'
|
47
|
+
CurrentRuby = Ruby22
|
48
48
|
end
|
49
49
|
end
|
data/lib/parser/lexer.rl
CHANGED
@@ -832,7 +832,7 @@ class Parser::Lexer
|
|
832
832
|
|
833
833
|
# tLABEL_END is only possible in non-cond context on >= 2.2
|
834
834
|
if @version >= 22 && !@cond.active?
|
835
|
-
lookahead = @source[@te...@te+
|
835
|
+
lookahead = @source[@te...@te+2]
|
836
836
|
lookahead = lookahead.encode(@encoding) if lookahead.respond_to?(:encode)
|
837
837
|
end
|
838
838
|
|
data/lib/parser/lexer/literal.rb
CHANGED
@@ -129,11 +129,13 @@ module Parser
|
|
129
129
|
extend_space(ts, ts)
|
130
130
|
end
|
131
131
|
|
132
|
-
|
133
|
-
|
132
|
+
if lookahead && lookahead[0] == ?: && lookahead[1] != ?: &&
|
133
|
+
%w(' ").include?(delimiter) && @start_tok == :tSTRING_BEG
|
134
|
+
# This is a quoted label.
|
134
135
|
flush_string
|
135
136
|
emit(:tLABEL_END, @end_delim, ts, te + 1)
|
136
137
|
elsif @monolithic
|
138
|
+
# Emit the string as a single token.
|
137
139
|
emit(MONOLITHIC[@start_tok], @buffer, @str_s, te)
|
138
140
|
else
|
139
141
|
# If this is a heredoc, @buffer contains the sentinel now.
|
data/lib/parser/ruby22.y
CHANGED
@@ -2329,9 +2329,6 @@ end
|
|
2329
2329
|
|
2330
2330
|
require 'parser'
|
2331
2331
|
|
2332
|
-
warn "warning: you are loading parser/ruby22 from #{caller[0]}."
|
2333
|
-
warn "warning: Ruby 2.2 is not released yet and parser support may be incomplete."
|
2334
|
-
|
2335
2332
|
Parser.check_for_encoding_support
|
2336
2333
|
|
2337
2334
|
---- inner
|
data/lib/parser/version.rb
CHANGED
data/test/test_lexer.rb
CHANGED
@@ -293,6 +293,15 @@ class TestLexer < Minitest::Test
|
|
293
293
|
:tLABEL_END, "'")
|
294
294
|
end
|
295
295
|
|
296
|
+
def test_label_colon2__22
|
297
|
+
setup_lexer 22
|
298
|
+
|
299
|
+
assert_scanned("{'a'::",
|
300
|
+
:tLBRACE, '{',
|
301
|
+
:tSTRING, "a",
|
302
|
+
:tCOLON2, '::')
|
303
|
+
end
|
304
|
+
|
296
305
|
def test_command_start__19
|
297
306
|
setup_lexer 19
|
298
307
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.0
|
4
|
+
version: 2.2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Zotov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ast
|
@@ -371,7 +371,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
371
371
|
version: '0'
|
372
372
|
requirements: []
|
373
373
|
rubyforge_project:
|
374
|
-
rubygems_version: 2.4.
|
374
|
+
rubygems_version: 2.4.2
|
375
375
|
signing_key:
|
376
376
|
specification_version: 4
|
377
377
|
summary: A Ruby parser written in pure Ruby.
|