parser 2.0.0.beta1 → 2.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/lib/parser/base.rb +1 -3
- data/lib/parser/version.rb +1 -1
- data/parser.gemspec +1 -1
- data/test/test_current.rb +1 -1
- data/test/test_diagnostic.rb +1 -1
- data/test/test_diagnostic_engine.rb +1 -1
- data/test/test_encoding.rb +1 -1
- data/test/test_lexer.rb +1 -1
- data/test/test_lexer_stack_state.rb +1 -1
- data/test/test_parse_helper.rb +1 -1
- data/test/test_parser.rb +13 -3
- data/test/test_source_buffer.rb +1 -1
- data/test/test_source_comment.rb +1 -1
- data/test/test_source_comment_associator.rb +1 -1
- data/test/test_source_range.rb +1 -1
- data/test/test_source_rewriter.rb +1 -1
- data/test/test_source_rewriter_action.rb +1 -1
- data/test/test_static_environment.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07879ee1d09632725a820a2ebe8cffd8ab8b96df
|
4
|
+
data.tar.gz: e6e2daa3f5ce930d63f72457fceded6a319309aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebb7af02e3f6c83c57d221857c8a4c3f3606aa61ab84f33cb1ccc10ec6b3433da0fbc44af7a26bc8beb7e3cc6df1ef1feafc30734fa20a86060db212adc92d05
|
7
|
+
data.tar.gz: 97d3ba4a5f88a4dbdaaa9521aa5a24ecae3397d9d5d7f39691a757b74f2aadaa48e14b08fd8b28343ec94c8d6d7b5254663d57407c60f384bb4c17019e5bc9db
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
-
2.0.0.
|
4
|
+
2.0.0.beta2 (2013-05-27)
|
5
5
|
------------------------
|
6
6
|
|
7
|
+
Bugs fixed:
|
8
|
+
* Actually return comments from Parser::Base#tokenize instead of nil. (Peter Zotov)
|
9
|
+
|
10
|
+
v2.0.0 (2013-05-25)
|
11
|
+
-------------------
|
12
|
+
|
7
13
|
API modifications:
|
8
14
|
* Completely rewrite whitespace handling in lexer (fixes #36). (Peter Zotov)
|
9
15
|
* Rename Parser::AST::Node#source_map to #location, #src to #loc (closes #40). (Peter Zotov)
|
data/lib/parser/base.rb
CHANGED
@@ -33,8 +33,6 @@ module Parser
|
|
33
33
|
|
34
34
|
@static_env = StaticEnvironment.new
|
35
35
|
|
36
|
-
@comments = []
|
37
|
-
|
38
36
|
@lexer = Lexer.new(version)
|
39
37
|
@lexer.diagnostics = @diagnostics
|
40
38
|
@lexer.static_env = @static_env
|
@@ -90,7 +88,7 @@ module Parser
|
|
90
88
|
def tokenize(source_buffer)
|
91
89
|
@lexer.tokens = []
|
92
90
|
|
93
|
-
ast, comments =
|
91
|
+
ast, comments = parse_with_comments(source_buffer)
|
94
92
|
|
95
93
|
[ ast, comments, @lexer.tokens ]
|
96
94
|
ensure
|
data/lib/parser/version.rb
CHANGED
data/parser.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_development_dependency 'rake', '~> 0.9'
|
32
32
|
spec.add_development_dependency 'racc'
|
33
33
|
|
34
|
-
spec.add_development_dependency 'minitest', '~>
|
34
|
+
spec.add_development_dependency 'minitest', '~> 5.0'
|
35
35
|
spec.add_development_dependency 'simplecov', '~> 0.7'
|
36
36
|
spec.add_development_dependency 'coveralls'
|
37
37
|
spec.add_development_dependency 'json_pure' # for coveralls on 1.9.2
|
data/test/test_current.rb
CHANGED
data/test/test_diagnostic.rb
CHANGED
data/test/test_encoding.rb
CHANGED
data/test/test_lexer.rb
CHANGED
data/test/test_parse_helper.rb
CHANGED
data/test/test_parser.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'helper'
|
4
4
|
require 'parse_helper'
|
5
5
|
|
6
|
-
class TestParser <
|
6
|
+
class TestParser < Minitest::Test
|
7
7
|
include ParseHelper
|
8
8
|
|
9
9
|
def parser_for_ruby_version(version)
|
@@ -4214,7 +4214,10 @@ class TestParser < MiniTest::Unit::TestCase
|
|
4214
4214
|
Parser::Source::Range.new(source_file, from, to)
|
4215
4215
|
end
|
4216
4216
|
|
4217
|
-
|
4217
|
+
ast, comments = parser.parse_with_comments(source_file)
|
4218
|
+
|
4219
|
+
assert_equal s(:send, s(:int, 1), :+, s(:int, 2)),
|
4220
|
+
ast
|
4218
4221
|
|
4219
4222
|
assert_equal [
|
4220
4223
|
Parser::Source::Comment.new(range.call(4, 9))
|
@@ -4231,7 +4234,14 @@ class TestParser < MiniTest::Unit::TestCase
|
|
4231
4234
|
Parser::Source::Range.new(source_file, from, to)
|
4232
4235
|
end
|
4233
4236
|
|
4234
|
-
|
4237
|
+
ast, comments, tokens = parser.tokenize(source_file)
|
4238
|
+
|
4239
|
+
assert_equal s(:send, s(:int, 1), :+, s(:int, 2)),
|
4240
|
+
ast
|
4241
|
+
|
4242
|
+
assert_equal [
|
4243
|
+
Parser::Source::Comment.new(range.call(4, 9))
|
4244
|
+
], comments
|
4235
4245
|
|
4236
4246
|
assert_equal [
|
4237
4247
|
[:tINTEGER, [ 1, range.call(0, 1) ]],
|
data/test/test_source_buffer.rb
CHANGED
data/test/test_source_comment.rb
CHANGED
data/test/test_source_range.rb
CHANGED
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.0.0.
|
4
|
+
version: 2.0.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Zotov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ast
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '5.0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: '5.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: simplecov
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|