Method: Nendo::Evaluator#__expandSyntaxRules

Defined in:
lib/nendo/ruby/evaluator.rb

#__expandSyntaxRules(rules, syntaxArray, lexicalVars) ⇒ Object

expand (syntax-rules …) => (%syntax-rules …)



903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
# File 'lib/nendo/ruby/evaluator.rb', line 903

def __expandSyntaxRules( rules, syntaxArray, lexicalVars )
  if :"%syntax-rules" == rules.car
    rules
  else
    ellipse = rules.second
    pattern_body_list = rules.cdr.cdr

    lst = []
    lst << :"syntax-rules"
    lst << ellipse
    pattern_body_list.each {|xx|
      pattern_body = xx.car
      pattern = pattern_body.first
      body = pattern_body.second
      new_pattern_body = [ pattern, macroexpandEngine( body, syntaxArray, lexicalVars ) ].to_list
      lst << new_pattern_body
    }
    lst.to_list
  end
end