parser 2.1.4 → 2.1.5
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 +6 -0
- data/README.md +17 -3
- data/lib/parser/base.rb +3 -1
- data/lib/parser/ruby18.y +1 -1
- data/lib/parser/version.rb +1 -1
- data/test/test_base.rb +18 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bba2ec073df00075ce10a7fab1964034be23dcf6
|
4
|
+
data.tar.gz: 6cf53d4941550e6599ed47b9141a09fd00b43f8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 563cdddc9e10b21b35432d386725ddc809c17f78a1098fb56bde5a05d8b4004f39ec466dd0979bcfefb659d81478978111776d180ce9e353fbb389555d5c45bc
|
7
|
+
data.tar.gz: 66a7b6e8b06354163146c54d93f124598a65c673cf864012faeed3f3643ea68c2915b33de75055ea03c1d4e34ca1c41a1bf8c3ec329359c36f12e3f6d6812440
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -125,7 +125,7 @@ Several Parser nodes seem to be confusing enough to warrant a dedicated README s
|
|
125
125
|
|
126
126
|
#### (block)
|
127
127
|
|
128
|
-
The `(block)` node passes a Ruby block, that is, a closure, to a method call represented by its first child, a `send` node. To demonstrate:
|
128
|
+
The `(block)` node passes a Ruby block, that is, a closure, to a method call represented by its first child, a `(send)`, `(super)` or `(zsuper)` node. To demonstrate:
|
129
129
|
|
130
130
|
```
|
131
131
|
$ ruby-parse -e 'foo { |x| x + 2 }'
|
@@ -230,13 +230,27 @@ Ruby MRI 1.9+ permits to specify invalid Unicode codepoints in Unicode escape se
|
|
230
230
|
|
231
231
|
As of 2013-07-25, affected gems are: aws_cloud_search.
|
232
232
|
|
233
|
+
### Dollar-dash
|
234
|
+
|
235
|
+
(This one is so obscure I couldn't even think of a saner name for this issue.) Pre-2.1 Ruby allows
|
236
|
+
to specify a global variable named `$-`. Ruby 2.1 and later treat it as a syntax error. Parser
|
237
|
+
follows 2.1 behavior.
|
238
|
+
|
239
|
+
No known code is affected by this issue.
|
240
|
+
|
233
241
|
## Contributors
|
234
242
|
|
235
243
|
* Peter Zotov ([whitequark][])
|
244
|
+
* Markus Schirp ([mbj][])
|
245
|
+
* Yorick Peterse ([yorickpeterse][])
|
236
246
|
* Magnus Holm ([judofyr][])
|
247
|
+
* Bozhidar Batsov ([bbatsov][])
|
237
248
|
|
238
|
-
[whitequark]:
|
239
|
-
[
|
249
|
+
[whitequark]: https://github.com/whitequark
|
250
|
+
[mbj]: https://github.com/mbj
|
251
|
+
[yorickpeterse]: https://github.com/yorickpeterse
|
252
|
+
[judofyr]: https://github.com/judofyr
|
253
|
+
[bbatsov]: https://github.com/bbatsov
|
240
254
|
|
241
255
|
## Acknowledgements
|
242
256
|
|
data/lib/parser/base.rb
CHANGED
@@ -93,7 +93,9 @@ module Parser
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def self.setup_source_buffer(file, line, string, encoding)
|
96
|
-
|
96
|
+
if string.respond_to? :force_encoding
|
97
|
+
string = string.dup.force_encoding(encoding)
|
98
|
+
end
|
97
99
|
|
98
100
|
source_buffer = Source::Buffer.new(file, line)
|
99
101
|
|
data/lib/parser/ruby18.y
CHANGED
data/lib/parser/version.rb
CHANGED
data/test/test_base.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'helper'
|
2
|
+
require 'parser/current'
|
3
|
+
|
4
|
+
class TestBase < Minitest::Test
|
5
|
+
include AST::Sexp
|
6
|
+
|
7
|
+
def test_parse
|
8
|
+
ast = Parser::CurrentRuby.parse('1')
|
9
|
+
assert_equal s(:int, 1), ast
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_parse_with_comments
|
13
|
+
ast, comments = Parser::CurrentRuby.parse_with_comments('1 # foo')
|
14
|
+
assert_equal s(:int, 1), ast
|
15
|
+
assert_equal 1, comments.size
|
16
|
+
assert_equal '# foo', comments.first.text
|
17
|
+
end
|
18
|
+
end
|
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.1.
|
4
|
+
version: 2.1.5
|
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-
|
11
|
+
date: 2014-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ast
|
@@ -303,6 +303,7 @@ files:
|
|
303
303
|
- test/helper.rb
|
304
304
|
- test/parse_helper.rb
|
305
305
|
- test/racc_coverage_helper.rb
|
306
|
+
- test/test_base.rb
|
306
307
|
- test/test_current.rb
|
307
308
|
- test/test_diagnostic.rb
|
308
309
|
- test/test_diagnostic_engine.rb
|
@@ -343,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
343
344
|
version: '0'
|
344
345
|
requirements: []
|
345
346
|
rubyforge_project:
|
346
|
-
rubygems_version: 2.0.
|
347
|
+
rubygems_version: 2.0.0
|
347
348
|
signing_key:
|
348
349
|
specification_version: 4
|
349
350
|
summary: A Ruby parser written in pure Ruby.
|
@@ -351,6 +352,7 @@ test_files:
|
|
351
352
|
- test/helper.rb
|
352
353
|
- test/parse_helper.rb
|
353
354
|
- test/racc_coverage_helper.rb
|
355
|
+
- test/test_base.rb
|
354
356
|
- test/test_current.rb
|
355
357
|
- test/test_diagnostic.rb
|
356
358
|
- test/test_diagnostic_engine.rb
|