-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b3f1a8
commit c07c715
Showing
16 changed files
with
31 additions
and
90 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ dist | |
pnpm-lock.yaml | ||
0x | ||
tmp | ||
data/test.no |
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 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 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 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,30 +1,17 @@ | ||
import { VidType } from '../typecheck' | ||
import { holeType, unknownType } from '../typecheck/type' | ||
import { vidFromString } from './util' | ||
import { Identifier } from '../ast/operand' | ||
import { idFromString } from '../typecheck' | ||
|
||
export const preludeVid = vidFromString('std::prelude') | ||
export const preludeVid = idFromString('std::prelude') | ||
|
||
// TODO: lack of std types must throw notFoundError | ||
export const bool: VidType = { kind: 'vid-type', identifier: vidFromString('std::bool::Bool'), typeArgs: [] } | ||
export const string: VidType = { kind: 'vid-type', identifier: vidFromString('std::string::String'), typeArgs: [] } | ||
export const list: VidType = { kind: 'vid-type', identifier: vidFromString('std::list::List'), typeArgs: [holeType] } | ||
export const bool: Identifier = idFromString('std::bool::Bool') | ||
export const string: Identifier = idFromString('std::string::String') | ||
export const list: Identifier = idFromString('std::list::List') | ||
|
||
export const show: VidType = { kind: 'vid-type', identifier: vidFromString('std::io::show::Show'), typeArgs: [] } | ||
export const trace: VidType = { kind: 'vid-type', identifier: vidFromString('std::io::trace::Trace'), typeArgs: [] } | ||
export const show: Identifier = idFromString('std::io::show::Show') | ||
export const trace: Identifier = idFromString('std::io::trace::Trace') | ||
|
||
export const iter: VidType = { kind: 'vid-type', identifier: vidFromString('std::iter::Iter'), typeArgs: [unknownType] } | ||
export const iterable: VidType = { | ||
kind: 'vid-type', | ||
identifier: vidFromString('std::iter::Iterable'), | ||
typeArgs: [holeType] | ||
} | ||
export const unwrap: VidType = { | ||
kind: 'vid-type', | ||
identifier: vidFromString('std::unwrap::Unwrap'), | ||
typeArgs: [holeType] | ||
} | ||
export const future: VidType = { | ||
kind: 'vid-type', | ||
identifier: vidFromString('std::future::Future'), | ||
typeArgs: [holeType] | ||
} | ||
export const iter: Identifier = idFromString('std::iter::Iter') | ||
export const iterable: Identifier = idFromString('std::iter::Iterable') | ||
export const unwrap: Identifier = idFromString('std::unwrap::Unwrap') | ||
export const future: Identifier = idFromString('std::future::Future') |
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 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 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 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,20 +1,20 @@ | ||
import { AstNodeKind } from '../ast' | ||
import { vidFromString } from '../scope/util' | ||
import { VirtualIdentifier } from '../scope/vid' | ||
import { Identifier } from '../ast/operand' | ||
import { idFromString } from '../typecheck' | ||
|
||
export const operatorImplMap: Map<AstNodeKind, VirtualIdentifier> = new Map([ | ||
['add-op', vidFromString('std::num::Num::add')], | ||
['sub-op', vidFromString('std::num::Num::sub')], | ||
['mult-op', vidFromString('std::num::Num::mult')], | ||
['div-op', vidFromString('std::num::Num::div')], | ||
['exp-op', vidFromString('std::num::Num::exp')], | ||
['eq-op', vidFromString('std::eq::Eq::eq')], | ||
['ne-op', vidFromString('std::eq::Eq::ne')], | ||
['ge-op', vidFromString('std::ord::Ord::ge')], | ||
['le-op', vidFromString('std::ord::Ord::le')], | ||
['gt-op', vidFromString('std::ord::Ord::gt')], | ||
['lt-op', vidFromString('std::ord::Ord::lt')], | ||
['and-op', vidFromString('std::bool::Bool::and')], | ||
['or-op', vidFromString('std::bool::Bool::or')], | ||
['mod-op', vidFromString('std::int::Int::mod')] | ||
export const operatorImplMap: Map<AstNodeKind, Identifier> = new Map([ | ||
['add-op', idFromString('std::num::Num::add')], | ||
['sub-op', idFromString('std::num::Num::sub')], | ||
['mult-op', idFromString('std::num::Num::mult')], | ||
['div-op', idFromString('std::num::Num::div')], | ||
['exp-op', idFromString('std::num::Num::exp')], | ||
['eq-op', idFromString('std::eq::Eq::eq')], | ||
['ne-op', idFromString('std::eq::Eq::ne')], | ||
['ge-op', idFromString('std::ord::Ord::ge')], | ||
['le-op', idFromString('std::ord::Ord::le')], | ||
['gt-op', idFromString('std::ord::Ord::gt')], | ||
['lt-op', idFromString('std::ord::Ord::lt')], | ||
['and-op', idFromString('std::bool::Bool::and')], | ||
['or-op', idFromString('std::bool::Bool::or')], | ||
['mod-op', idFromString('std::int::Int::mod')] | ||
]) |
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