struct RNode
(NODE) 結構的使用方式可以從 node.h 定義的 macro 裡面猜一下,一組一組的應該對應到不同 node_type
,只是沒註解也看不出直接規則。比較好猜的是 nd_lit
,應該是 literal 存在 u1.value
。
#define nd_head u1.node
#define nd_alen u2.argc
#define nd_next u3.node
#define nd_cond u1.node
#define nd_body u2.node
#define nd_else u3.node
#define nd_resq u2.node
#define nd_ensr u3.node
#define nd_1st u1.node
#define nd_2nd u2.node
#define nd_stts u1.node
#define nd_entry u3.id
#define nd_vid u1.id
#define nd_var u1.node
#define nd_iter u3.node
#define nd_value u2.node
#define nd_aid u3.id
#define nd_lit u1.value
#define nd_recv u1.node
#define nd_mid u2.id
#define nd_args u3.node
#define nd_ainfo u3.args
#define nd_defn u3.node
#define nd_cpath u1.node
#define nd_super u3.node
#define nd_beg u1.node
#define nd_end u2.node
#define nd_state u3.state
#define nd_nth u2.argc
#define nd_alias u1.id
#define nd_orig u2.id
#define nd_undef u2.node
#define nd_brace u2.argc
#define nd_pconst u1.node
#define nd_pkwargs u2.node
#define nd_pkwrestarg u3.node
#define nd_apinfo u3.apinfo
#define nd_fpinfo u3.fpinfo
// for NODE_SCOPE
#define nd_tbl u1.tbl
// for NODE_ARGS_AUX
#define nd_pid u1.id
#define nd_plen u2.argc
#define nd_cflag u2.id
// for ripper
#define nd_cval u3.value
#define nd_rval u2.value
#define nd_tag u1.id