Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lm to lsts qpeofjf #1214

Merged
merged 2 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44,404 changes: 22,163 additions & 22,241 deletions BOOTSTRAP/cli.c

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions SRC/index-ast.lm

This file was deleted.

1 change: 0 additions & 1 deletion SRC/index-index.lm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import SRC/index-globals.lm;
import SRC/index-tokenize.lm;
import SRC/index-types.lm;
import SRC/index-context.lm;
import SRC/index-ast.lm;
import SRC/index-preprocess.lm;
import SRC/index-plugins.lm;

Expand Down
2 changes: 0 additions & 2 deletions SRC/index-tokenize.lm
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

import SRC/with-location.lm;
import SRC/with-key.lm;
import SRC/to-smart-string.lsts;
import SRC/formatted-location.lsts;
3 changes: 3 additions & 0 deletions SRC/unit-ast.lsts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ import SRC/smart-token-location.lsts;
import SRC/plus.lsts;
import SRC/unique.lsts;
import SRC/without-location.lsts;
import SRC/with-location.lsts;
import SRC/with-key.lsts;
import SRC/var-name-if-var.lsts;
12 changes: 0 additions & 12 deletions SRC/var-name-if-var.lm

This file was deleted.

8 changes: 8 additions & 0 deletions SRC/var-name-if-var.lsts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

let var-name-if-var(t: AST): CString = (
match t {
Var{key=key} => key;
Lit{key=key} => key;
_ => c"";
}
);
10 changes: 0 additions & 10 deletions SRC/with-key.lm

This file was deleted.

4 changes: 4 additions & 0 deletions SRC/with-key.lsts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

let with-key(t: Token, k: CString): Token = (
Token{ k, iuid(), t.location }
);
68 changes: 0 additions & 68 deletions SRC/with-location.lm

This file was deleted.

17 changes: 17 additions & 0 deletions SRC/with-location.lsts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

let with-location(term: AST, loc: SourceLocation): AST = (
match term {
Var{key=key,token=token} => Var{key,with-location(token,loc)};
Lit{key=key,token=token} => Lit{key,with-location(token,loc)};
App{left=left,right=right} => App{close(with-location(left,loc)),close(with-location(right,loc))};
Seq{left=left,right=right} => Seq{close(with-location(left,loc)),close(with-location(right,loc))};
Abs{lhs=lhs,rhs=rhs,tt=tt} => Abs{close(with-location(lhs,loc)),close(with-location(rhs,loc)),tt};
Typedef{lhs=lhs,rhs=rhs} => Typedef{close(with-location(lhs,loc)),close(with-location(rhs,loc))};
Glb{key=key,val=val} => Glb{with-location(key,loc),close(with-location(val,loc))};
_ => term;
}
);

let with-location(t: Token, loc: SourceLocation): Token = (
if non-zero(t.location) then t else Token{ t.key, iuid(), loc }
);