parser 2.1.4 → 2.1.5

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
  SHA1:
3
- metadata.gz: e88ebe1de51e22363aed8e3c19386b88145f8bdf
4
- data.tar.gz: bfa19788a7bd3ea433bceb98227e4b6a8fe856d5
3
+ metadata.gz: bba2ec073df00075ce10a7fab1964034be23dcf6
4
+ data.tar.gz: 6cf53d4941550e6599ed47b9141a09fd00b43f8a
5
5
  SHA512:
6
- metadata.gz: 9c45ee15b7d3acfcd6c77504d0aae08f47bf4bc109fc9ecb59398d8bea0538f356e4ee8e6a7bea3eacc50e79086a6ed9ead574e5ee0defc175e531310352dc5a
7
- data.tar.gz: 264a6216cc8a86c372b58fc4aa3dc5afab9b905773170e17161abee39ad30d2c586e875eeaf6a99b93f9bf0ddff3915ed9274a7db29f7acf38a619d8c25b2015
6
+ metadata.gz: 563cdddc9e10b21b35432d386725ddc809c17f78a1098fb56bde5a05d8b4004f39ec466dd0979bcfefb659d81478978111776d180ce9e353fbb389555d5c45bc
7
+ data.tar.gz: 66a7b6e8b06354163146c54d93f124598a65c673cf864012faeed3f3643ea68c2915b33de75055ea03c1d4e34ca1c41a1bf8c3ec329359c36f12e3f6d6812440
@@ -1,6 +1,12 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ v2.1.5 (2014-02-24)
5
+ -------------------
6
+
7
+ Bugs fixed:
8
+ * Parser::Base, ruby18.y: don't try to lookup Encoding on 1.8 (fixes #133). (Peter Zotov)
9
+
4
10
  v2.1.4 (2014-01-11)
5
11
  -------------------
6
12
 
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]: https://github.com/whitequark
239
- [judofyr]: https://github.com/judofyr
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
 
@@ -93,7 +93,9 @@ module Parser
93
93
  end
94
94
 
95
95
  def self.setup_source_buffer(file, line, string, encoding)
96
- string = string.dup.force_encoding(encoding)
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
 
@@ -1913,5 +1913,5 @@ require 'parser'
1913
1913
  end
1914
1914
 
1915
1915
  def default_encoding
1916
- Encoding::BINARY
1916
+ Encoding::BINARY if defined? Encoding
1917
1917
  end
@@ -1,3 +1,3 @@
1
1
  module Parser
2
- VERSION = '2.1.4'
2
+ VERSION = '2.1.5'
3
3
  end
@@ -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
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-01-10 00:00:00.000000000 Z
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.14
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