parser 2.0.0.pre5 → 2.0.0.pre6
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/lib/parser/source/comment/associator.rb +2 -2
- data/lib/parser/version.rb +1 -1
- data/test/test_source_comment_associator.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57e819d2cd65b374e49ccdc64313da51dab99dec
|
4
|
+
data.tar.gz: 33288353f3f0585227149c307f5ca3d8a7247012
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df8f0b48532727b9d74a81f91d0293fc9412942280ab02065d36f8578c4086e496ab7aa05de95b9e894be640135502af0c72e1a9aa85cb782153956e531dfafb
|
7
|
+
data.tar.gz: 16b3d4f6db7babe591faa0ae73bfd78602f681a67f1f19bfe654ab7e711905c41c764431498909035f231f3ad24c70cae121787aead0e318d5fea80592e1f7c4
|
@@ -86,12 +86,12 @@ module Parser
|
|
86
86
|
|
87
87
|
def advance_through_directives
|
88
88
|
# Skip shebang.
|
89
|
-
if current_comment.text =~ /^#!/
|
89
|
+
if current_comment && current_comment.text =~ /^#!/
|
90
90
|
advance_comment
|
91
91
|
end
|
92
92
|
|
93
93
|
# Skip encoding line.
|
94
|
-
if current_comment.text =~ Buffer::ENCODING_RE
|
94
|
+
if current_comment && current_comment.text =~ Buffer::ENCODING_RE
|
95
95
|
advance_comment
|
96
96
|
end
|
97
97
|
end
|
data/lib/parser/version.rb
CHANGED
@@ -65,4 +65,22 @@ end
|
|
65
65
|
associations[ast].map(&:text)
|
66
66
|
end
|
67
67
|
|
68
|
+
def test_associate_shebang_only
|
69
|
+
ast, associations = associate(<<-END)
|
70
|
+
#!ruby
|
71
|
+
class Foo
|
72
|
+
end
|
73
|
+
END
|
74
|
+
|
75
|
+
assert_equal 0, associations.size
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_associate_no_comments
|
79
|
+
ast, associations = associate(<<-END)
|
80
|
+
class Foo
|
81
|
+
end
|
82
|
+
END
|
83
|
+
|
84
|
+
assert_equal 0, associations.size
|
85
|
+
end
|
68
86
|
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.0.0.
|
4
|
+
version: 2.0.0.pre6
|
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-
|
11
|
+
date: 2013-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ast
|