Class: Peruby::Validator
- Inherits:
-
Object
- Object
- Peruby::Validator
- Defined in:
- lib/peruby/validator.rb
Overview
Compile-time lexical checks for the strict pragma.
Defined Under Namespace
Classes: State
Constant Summary collapse
- SPECIAL =
%w[_ a b ARGV ENV INC SIG].freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(runtime = nil, strict = Set.new, warnings = Set.new) ⇒ Validator
constructor
A new instance of Validator.
- #validate(node) ⇒ Object
Constructor Details
#initialize(runtime = nil, strict = Set.new, warnings = Set.new) ⇒ Validator
Returns a new instance of Validator.
16 17 18 19 20 21 22 |
# File 'lib/peruby/validator.rb', line 16 def initialize(runtime = nil, strict = Set.new, warnings = Set.new) @runtime = runtime @strict = strict @warnings = warnings @package_uses = Hash.new { |uses, key| uses[key] = [] } @loop_labels = [] end |
Class Method Details
.validate(node, runtime: nil, strict: Set.new, warnings: Set.new) ⇒ Object
12 13 14 |
# File 'lib/peruby/validator.rb', line 12 def self.validate(node, runtime: nil, strict: Set.new, warnings: Set.new) new(runtime, strict, warnings).validate(node) end |