Permalink
Browse files

Fixed some new warnings.

  • Loading branch information...
1 parent 57f5109 commit 0405680823979c102bc2e2637fee2b1256148201 @chriswailes committed Mar 19, 2016
Showing with 9 additions and 6 deletions.
  1. +7 −4 lib/rltk/parser.rb
  2. +1 −1 test/tc_ast.rb
  3. +1 −1 test/tc_parser.rb
View
@@ -106,7 +106,7 @@ class << self
# The overridden new prevents un-finalized parsers from being
# instantiated.
def new(*args)
- if @symbols.nil?
+ if not @symbols
raise UselessParserException
else
super(*args)
@@ -120,12 +120,15 @@ def install_icvars
@curr_lhs = nil
@curr_prec = nil
- @conflicts = Hash.new {|h, k| h[k] = Array.new}
- @grammar = CFG.new
+ @conflicts = Hash.new {|h, k| h[k] = Array.new}
+ @grammar = CFG.new
+ @grammar_prime = nil
@lh_sides = Hash.new
@procs = Array.new
@states = Array.new
+
+ @symbols = nil
# Variables for dealing with precedence.
@prec_counts = {:left => 0, :right => 0, :non => 0}
@@ -565,7 +568,7 @@ def finalize(opts = {})
# Check to make sure we can load the necessary information
# from the specified object.
if opts[:use] and (
- (opts[:use].is_a?(String) and File.exists?(opts[:use]) and File.mtime(opts[:use]) > File.mtime(def_file)) or
+ (opts[:use].is_a?(String) and File.exist?(opts[:use]) and File.mtime(opts[:use]) > File.mtime(def_file)) or
(opts[:use].is_a?(File) and opts[:use].mtime > File.mtime(def_file))
)
View
@@ -237,7 +237,7 @@ def test_map!
assert_equal(CNode.new, replace_node)
- mapped_tree = @tree5.map! do |c|
+ @tree5.map! do |c|
c.str += '!'
c
View
@@ -271,7 +271,7 @@ def get_op(orig_op)
end
class SelectionParser < RLTK::Parser
- production(:s, 'A+ .B+') { |bs| bs.inject &:+ }
+ production(:s, 'A+ .B+') { |bs| bs.inject(&:+) }
finalize
end

0 comments on commit 0405680

Please sign in to comment.