diff --git a/fz/semantic.pl b/fz/semantic.pl index 6186c1c..a8c3c9f 100644 --- a/fz/semantic.pl +++ b/fz/semantic.pl @@ -39,9 +39,16 @@ sa_n_traverse(N, NN, ST) :- sa_n(N, NN, ST). % non-list case % id(N) - Name -- identifier % constraint(C,A) - Constraint, Attrib -- constraint % +% variables with an initializer are treated as SSA & will now stand for +% the literal in the initializer itself. -sa_n(var(N,T,I,A), V, ST) :- +sa_n(var(N,T,[],A), V, ST) :- !, sa_attribs(A, AX, ST), + V=var(N,T,[],AX), % new AST node becomes ST entry value + st_insert(ST, N, V). + +sa_n(var(N,T,I,A), NI, ST) :- % non-empty initializer + sa_attribs(A, AX, ST), % should ignore this? sa_n_traverse(I, NI, ST), % parse initializer V=var(N,T,NI,AX), % new AST node becomes ST entry value st_insert(ST, N, V). -- libgit2 0.21.2