rkelly-remix 0.0.2 → 0.0.3
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.
- data/CHANGELOG.rdoc +8 -0
- data/lib/rkelly/constants.rb +1 -1
- data/lib/rkelly/generated_parser.rb +746 -725
- data/lib/rkelly/parser.rb +14 -0
- metadata +2 -2
data/lib/rkelly/parser.rb
CHANGED
@@ -49,6 +49,20 @@ module RKelly
|
|
49
49
|
raise "something bad happened, please report a bug with sample JavaScript"
|
50
50
|
end
|
51
51
|
|
52
|
+
# When parsing finishes without all tokens being parsed, returns
|
53
|
+
# the token at which the parsing stopped. Returns nil when parser
|
54
|
+
# reached to the very last token (but possibly still failed as it
|
55
|
+
# expeced more tokens).
|
56
|
+
#
|
57
|
+
# Useful for pin-pointing the position of a syntax error.
|
58
|
+
def stopped_at
|
59
|
+
if @position < @tokens.length
|
60
|
+
@tokens[@position-1]
|
61
|
+
else
|
62
|
+
nil
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
52
66
|
private
|
53
67
|
def on_error(error_token_id, error_value, value_stack)
|
54
68
|
if logger
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rkelly-remix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-07-
|
13
|
+
date: 2013-07-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rdoc
|