parser 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parser/lexer/explanation.rb +11 -2
- data/lib/parser/runner/ruby_parse.rb +1 -1
- data/lib/parser/version.rb +1 -1
- data/test/test_parser.rb +2 -2
- 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: d62cbf813cac258da20e47d807e808d4a5d86d98
|
4
|
+
data.tar.gz: e708512bed38b4f38419882d82847f2272c11604
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 250e93427ef7b9907fe8157f1ec494bb8a2e0d589760c137ffb553a81a1056ed079237d3cbe7d9ded2e15ff95a4e27d4bc6e74f19fede3050def8b06b37a9da3
|
7
|
+
data.tar.gz: 05778b96f9bbe5d31ec2e5a071e09b4a9e6336ea06f447b80eb04dd8ed1ae53d45638f0653f3e594abdb35a9bc22d07e68de770e94c0ab190ea5af25022343ef
|
@@ -2,10 +2,19 @@ module Parser
|
|
2
2
|
|
3
3
|
module Lexer::Explanation
|
4
4
|
|
5
|
+
def self.included(klass)
|
6
|
+
klass.class_exec do
|
7
|
+
alias_method :state_before_explanation=, :state=
|
8
|
+
alias_method :advance_before_explanation, :advance
|
9
|
+
|
10
|
+
remove_method :state=, :advance
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
5
14
|
# Like #advance, but also pretty-print the token and its position
|
6
15
|
# in the stream to `stdout`.
|
7
16
|
def advance
|
8
|
-
type, (val, range) =
|
17
|
+
type, (val, range) = advance_before_explanation
|
9
18
|
|
10
19
|
puts decorate(range,
|
11
20
|
"\e[0;32m#{type} #{val.inspect}\e[0m",
|
@@ -18,7 +27,7 @@ module Parser
|
|
18
27
|
puts " \e[1;33m>>> STATE SET <<<\e[0m " +
|
19
28
|
"#{new_state.to_s.ljust(12)} #{@cond} #{@cmdarg}".rjust(66)
|
20
29
|
|
21
|
-
|
30
|
+
self.state_before_explanation = new_state
|
22
31
|
end
|
23
32
|
|
24
33
|
private
|
data/lib/parser/version.rb
CHANGED
data/test/test_parser.rb
CHANGED
@@ -4140,7 +4140,7 @@ class TestParser < MiniTest::Unit::TestCase
|
|
4140
4140
|
#
|
4141
4141
|
|
4142
4142
|
def test_crlf_line_endings
|
4143
|
-
with_versions(ALL_VERSIONS) do |_ver, parser|
|
4143
|
+
with_versions(nil, ALL_VERSIONS) do |_ver, parser|
|
4144
4144
|
source_file = Parser::Source::Buffer.new('(comments)')
|
4145
4145
|
source_file.source = "\r\nfoo"
|
4146
4146
|
|
@@ -4154,7 +4154,7 @@ class TestParser < MiniTest::Unit::TestCase
|
|
4154
4154
|
ast
|
4155
4155
|
|
4156
4156
|
assert_equal range.call(2, 5),
|
4157
|
-
ast.
|
4157
|
+
ast.src.expression
|
4158
4158
|
end
|
4159
4159
|
end
|
4160
4160
|
|
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: 1.4.
|
4
|
+
version: 1.4.2
|
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-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ast
|