Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlei committed Dec 13, 2016
1 parent 4df266b commit acf2d2e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion smop/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def main():
if options.execfile:
execfile(f)
except:
if options.delete-on-error:
if options.delete_on_error:
os.unlink(f)
if options.verbose:
print "Removed",f
Expand Down
31 changes: 27 additions & 4 deletions smop/resolve.pl
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,34 @@
let(a, ai),
let(mv, [])]).

% TODO
% 0. Copy state of is_def/is_ref --> resolve statements
% 4, const rank shape
% 6. SSA
% 8. Macroexpand
% 10. parser
% 12. backend
do_resolve(A) :-
retractall(is_def),
retractall(is_ref),
resolve(A).

is_unused(A) :-
is_def(A),
\+ is_ref(A).

is_arrayref(A) :-
is_def(A).

is_funcall(A) :-
is_ref(A),
\+ is_def.

resolve(A) :-
atom(A),
!,
writeln(A).
%assertz(is_ref(A)).
writeln(A),
assertz(is_ref(A)).

resolve(A) :-
number(A),
Expand Down Expand Up @@ -50,8 +73,8 @@
lhs_resolve(A) :- % A=...
atom(A),
!,
writeln(A).
% assertz(is_def(A)).
writeln(A),
assertz(is_def(A)).

%lhs_resolve(A) :-
% number(A).
Expand Down

0 comments on commit acf2d2e

Please sign in to comment.