Chervil is a toy Lisp interpreter written in Ruby
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

conditional.rb 438B

1234567891011121314151617
  1. module Chervil::AST
  2. class Conditional
  3. attr_reader :predicate
  4. attr_reader :true_branch
  5. attr_reader :false_branch
  6. def initialize(predicate, true_branch, false_branch)
  7. @predicate = predicate
  8. @true_branch = true_branch
  9. @false_branch = false_branch
  10. end
  11. def ==(other)
  12. @predicate == other.predicate && @true_branch == other.true_branch && @false_branch == other.false_branch
  13. end
  14. end
  15. end