-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1209 from andrew-johnson-4/lm-to-lsts-faemwlq
Lm to lsts faemwlq
- Loading branch information
Showing
12 changed files
with
21,634 additions
and
21,750 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
|
||
import SRC/with-location.lm; | ||
import SRC/without-location.lm; | ||
import SRC/with-key.lm; | ||
import SRC/to-smart-string.lsts; | ||
import SRC/formatted-location.lsts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
let unify-hint(hint: Type, tt: Type): Type = ( | ||
match Tuple{hint, tt} { | ||
Tuple{first:TGround{hint-tag=tag, hint-args=parameters}, | ||
second:TGround{tt-tag=tag, tt-args=parameters}} => ( | ||
if hint-tag == tt-tag { hint } | ||
else { TGround{ tt-tag, close(unify-hint(hint,tt-args)) } }; | ||
); | ||
Tuple{second:TAnd{lt=left,rt=right}} => ( | ||
TAnd{ close(unify-hint(hint,lt)), close(unify-hint(hint,rt)) }; | ||
); | ||
_ => tt; | ||
} | ||
); | ||
|
||
let unify-hint(hint: Type, tt: List<Type>): List<Type> = ( | ||
match tt { | ||
LCons{ th=head, tl=tail } => cons( unify-hint(hint,th), unify-hint(hint,tl) ); | ||
_ => tt; | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
# without-location is mainly used to scrub macro location information so that the preprocessor knows to overwrite them | ||
|
||
let without-location(term: AST): AST = ( | ||
match term { | ||
Var{key=key,token=token} => Var{key,without-location(token)}; | ||
Lit{key=key,token=token} => Lit{key,without-location(token)}; | ||
App{left=left,right=right} => App{close(without-location(left)),close(without-location(right))}; | ||
Seq{left=left,right=right} => Seq{close(without-location(left)),close(without-location(right))}; | ||
Abs{lhs=lhs,rhs=rhs,tt=tt} => Abs{close(without-location(lhs)),close(without-location(rhs)),tt}; | ||
Typedef{lhs=lhs,rhs=rhs} => Typedef{close(without-location(lhs)),close(without-location(rhs))}; | ||
Glb{key=key,val=val} => Glb{key,close(without-location(val))}; | ||
_ => term; | ||
} | ||
); | ||
|
||
let without-location(t: Token): Token = ( | ||
Token{ t.key, t.nonce, mk-location() } | ||
); |