Permalink
Browse files

Prevent 'require' loops by 'registering' the required file as empty a…

…t the outset
  • Loading branch information...
vidarh committed Sep 16, 2014
1 parent 15b6aa0 commit 72d255eb2481c57de98bce5102fab475967c197c
Showing with 1 addition and 0 deletions.
  1. +1 −0 parser.rb
View
@@ -309,6 +309,7 @@ def require q
f = nil
paths.detect { |path| f = File.open(path) rescue nil }
error("Unable to load '#{q}'") if !f
@@requires[q] = [] # Prevent include/require loops
s = Scanner.new(f)
pos = position
expr = Parser.new(s, @opts).parse(false)

0 comments on commit 72d255e

Please sign in to comment.