@@ -370,10 +370,10 @@ def _is_recipe_comment(tok):
370370 except Exception as err :
371371 # My code crashed. For shame!
372372 logger .exception (err )
373- logger .error ("INTERNAL ERROR eval exception during token makefile=\" \" \" \n %s\n \" \" \" " , statement .makefile ())
374- logger .error ("INTERNAL ERROR eval exception during token string=%s" , str (statement ))
373+ logger .error ("INTERNAL ERROR exception during token makefile=\" \" \" \n %s\n \" \" \" " , statement .makefile ())
374+ logger .error ("INTERNAL ERROR exception during token string=%s" , str (statement ))
375375 filename ,pos = statement .get_pos ()
376- logger .error ("eval failed statement =%r file=%s pos=%s " , statement , filename , pos )
376+ logger .error ("execute failed pos =%r file=%s statement=%r " , pos , filename , statement )
377377 exit_code = 1
378378
379379 # leave early on error
@@ -580,7 +580,20 @@ def execute(makefile, args):
580580 # Basically, we have context sensitive evaluation.
581581 curr_rules = []
582582
583- # XXX experimental for handling $(eval)
583+ # For handling $(eval) This is not my proudest moment. I originally
584+ # designed my make function implementations to be truly functional (no side
585+ # effects). My plan was for $(eval) to return a string of Make code that
586+ # would be re-interpretted. But now I'm deep enough into implementation to
587+ # understand that won't work. The $(eval) function is entirely a side
588+ # effect. The $(eval) function can add rules, execute other functions,
589+ # anything. And the $(eval) has to happen exactly in the place where it's
590+ # called.
591+ # $(info $(eval foo:bar)) # add a rule; $(info) would consume the string
592+ # if I simply returned "foo:bar" from $(eval)
593+ #
594+ # I need a way to send down the current state of the make (specifically,
595+ # rules). The symbol table is the only argument passed between make
596+ # functions.
584597 symtable .curr_rules = curr_rules
585598 symtable .rulesdb = rulesdb
586599
0 commit comments