ruby_parser 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ruby_parser might be problematic. Click here for more details.

data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,13 @@
1
+ === 3.0.3 / 2012-11-23
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * Improved error output on invalid char in expression.
6
+
7
+ * 1 bug fix:
8
+
9
+ * Fixed lexing of no-name ivars. (whitequark)
10
+
1
11
  === 3.0.2 / 2012-11-21
2
12
 
3
13
  52 down makes 99.9767% or 3.7σ. 130 files failed to parse out of 558k.
data/lib/ruby_lexer.rb CHANGED
@@ -774,7 +774,7 @@ class RubyLexer
774
774
  self.lex_strterm = [:strterm, STR_DQUOTE, '"', "\0"] # TODO: question this
775
775
  self.yacc_value = "\""
776
776
  return :tSTRING_BEG
777
- elsif src.scan(/\@\@?\w*/) then
777
+ elsif src.scan(/\@\@?\w+/) then
778
778
  self.token = src.matched
779
779
 
780
780
  rb_compile_error "`#{token}` is not allowed as a variable name" if
@@ -1244,9 +1244,8 @@ class RubyLexer
1244
1244
  if src.scan(/\004|\032|\000/) || src.eos? then # ^D, ^Z, EOF
1245
1245
  return RubyLexer::EOF
1246
1246
  else # alpha check
1247
- unless src.check IDENT_RE then
1248
- rb_compile_error "Invalid char #{src.matched.inspect} in expression"
1249
- end
1247
+ rb_compile_error "Invalid char #{src.rest[0].chr} in expression" unless
1248
+ src.check IDENT_RE
1250
1249
  end
1251
1250
 
1252
1251
  self.token = src.matched if self.src.scan IDENT_RE
@@ -1419,7 +1418,6 @@ class RubyLexer
1419
1418
 
1420
1419
  self.yacc_value = token
1421
1420
 
1422
-
1423
1421
  self.lex_state = :expr_end if
1424
1422
  last_state != :expr_dot && self.parser.env[token.to_sym] == :lvar
1425
1423
 
@@ -108,7 +108,7 @@ class RPStringScanner < StringScanner
108
108
  end
109
109
 
110
110
  module RubyParserStuff
111
- VERSION = '3.0.2' unless constants.include? "VERSION" # SIGH
111
+ VERSION = '3.0.3' unless constants.include? "VERSION" # SIGH
112
112
 
113
113
  attr_accessor :lexer, :in_def, :in_single, :file
114
114
  attr_reader :env, :comments
@@ -973,6 +973,10 @@ class TestRubyLexer < MiniTest::Unit::TestCase
973
973
  util_bad_token "@1"
974
974
  end
975
975
 
976
+ def test_yylex_ivar_bad_0_length
977
+ util_bad_token "1+@\n", :tINTEGER, 1, :tPLUS, "+"
978
+ end
979
+
976
980
  def test_yylex_keyword_expr
977
981
  @lex.lex_state = :expr_endarg
978
982
 
@@ -1969,4 +1973,3 @@ class TestRubyLexer < MiniTest::Unit::TestCase
1969
1973
  deny @lex.advance, "must be empty, but had #{[@lex.token, @lex.yacc_value].inspect}"
1970
1974
  end
1971
1975
  end
1972
-
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_parser
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 2
10
- version: 3.0.2
9
+ - 3
10
+ version: 3.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Davis
@@ -36,7 +36,7 @@ cert_chain:
36
36
  FBHgymkyj/AOSqKRIpXPhjC6
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2012-11-21 00:00:00 Z
39
+ date: 2012-11-23 00:00:00 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sexp_processor
@@ -61,11 +61,11 @@ dependencies:
61
61
  requirements:
62
62
  - - ~>
63
63
  - !ruby/object:Gem::Version
64
- hash: 31
64
+ hash: 29
65
65
  segments:
66
66
  - 4
67
- - 2
68
- version: "4.2"
67
+ - 3
68
+ version: "4.3"
69
69
  type: :development
70
70
  version_requirements: *id002
71
71
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file