Skip to content

Commit e458633

Browse files
hmm
1 parent 814567c commit e458633

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

SRC/std-apply-macro-candidates.lsts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ let std-apply-macro-candidates(tctx: TContext?, mname: CString, margs: AST, cand
1010
for Tuple{ctype=first, second:Abs{mlhs=lhs,rhs:App{left:Lit{key:c":"},right:App{mrhs=left}}}} in candidates {
1111
if not(non-zero(t)) {
1212
(let new-tctx, let mctx) = std-try-destructure-macro(tctx, margs, ctype, mlhs);
13-
print("Apply Candidate \{mname} \{mlhs}\nContext: \{new-tctx}\n");
1413
if mctx.is-some then mctx = union(mctx, Some{extract-uuids(mrhs)});
1514
if mctx.is-some then t = with-location-preserve(substitute(mctx.get-or-panic, mrhs), margs.location);
1615
}
@@ -19,7 +18,6 @@ let std-apply-macro-candidates(tctx: TContext?, mname: CString, margs: AST, cand
1918
);
2019

2120
let std-try-destructure-macro(tctx: TContext?, margs: AST, mtype: Type, mcandidate: AST): (TContext?, AContext?) = (
22-
print("Destructure \{mtype}\nArgs: \{margs}\nCandidate \{mcandidate}\n");
2321
let no = None :: AContext?;
2422
if let Abs{lhs=lhs, rhs=rhs} = mcandidate then std-try-destructure-macro(tctx, margs, mtype, lhs)
2523
else {
@@ -49,7 +47,6 @@ let std-try-destructure-macro(tctx: TContext?, margs: AST, mtype: Type, mcandida
4947
App{left:Var{maybe-helper=key}, helper-args=right} => (
5048
if macro-helper==maybe-helper {
5149
(tctx, let helped) = std-apply-macro-weak(tctx, macro-helper, helper-args);
52-
print("Macro Helper \{macro-helper}: \{helped}\n");
5350
if non-zero(helped)
5451
then (tctx, std-direct-destructure-macro(helped, mstruct))
5552
else (tctx, no)
@@ -58,7 +55,6 @@ let std-try-destructure-macro(tctx: TContext?, margs: AST, mtype: Type, mcandida
5855
_ => (
5956
if macro-helper==c"macro::variable" {
6057
(tctx, let helped) = std-apply-macro-weak(tctx, macro-helper, margs);
61-
print("Macro Helper \{macro-helper}: \{helped}\n");
6258
if non-zero(helped)
6359
then (tctx, std-direct-destructure-macro(helped, mstruct))
6460
else (tctx, no)

SRC/std-apply-macro.lsts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ let std-apply-macro-location(tctx: Maybe<TContext>, mname: CString, margs: AST):
3030

3131
let std-apply-macro(tctx: Maybe<TContext>, mname: CString, margs: AST, strong: Bool): (TContext?, AST) = (
3232
let result = ASTEOF;
33-
print("Apply Macro: \{mname} \{margs}\n");
3433
if mname==c"macro::concat" then (tctx, result) = std-apply-macro-concat(tctx, mname, margs)
3534
else if mname==c"macro::location" then (tctx, result) = std-apply-macro-location(tctx, mname, margs)
3635
else if mname==c"macro::variable" then (tctx, result) = std-apply-macro-variable(tctx, mname, margs)
@@ -71,7 +70,6 @@ let std-apply-macro(tctx: Maybe<TContext>, mname: CString, margs: AST, strong: B
7170
};
7271
(tctx, result) = std-apply-macro-candidates(tctx, mname, margs, candidates);
7372
};
74-
print("Applied Macro: \{mname} \{margs}\nResult: \{result}\n");
7573
if strong && not(non-zero(result)) then exit-error("Failed to Apply Macro: \{mname}\nArgs: \{margs}\n", margs);
7674
if strong then (tctx, result) = std-infer-expr(tctx, result, false, Used, TAny);
7775
(tctx, result)

SRC/tctx-to-string.lsts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,13 @@ let .into(tctx: Maybe<TContext>, tt: Type<String>): String = (
88
);
99

1010
let to-smart-string(tctx: Maybe<TContext>): String = tctx.into(type(String));
11+
12+
let .into(ctx: Maybe<AContext>, tt: Type<String>): String = (
13+
let result = "";
14+
for Tuple{first=first,second=second} in ctx.get-or([] :: AContext) {
15+
result = result + "\{first} : \{second}\n";
16+
};
17+
result
18+
);
19+
20+
let to-smart-string(ctx: Maybe<AContext>): String = ctx.into(type(String));

0 commit comments

Comments
 (0)