-
-
Notifications
You must be signed in to change notification settings - Fork 149
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 #90 from mint-lang/development
0.3.0
- Loading branch information
Showing
222 changed files
with
4,824 additions
and
1,115 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: mint | ||
version: 0.2.1 | ||
version: 0.3.0 | ||
|
||
targets: | ||
mint: | ||
|
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,61 @@ | ||
enum A(a) { | ||
B(a) | ||
} | ||
|
||
enum C(a) { | ||
D(A(a)) | ||
} | ||
|
||
module Test { | ||
fun a (b : C(a)) : a { | ||
case (b) { | ||
C::D a => | ||
case (a) { | ||
A::B c => | ||
c | ||
} | ||
} | ||
} | ||
} | ||
-------------------------------------------------------------------------------- | ||
class $$A_B extends Enum { | ||
constructor(_0) { | ||
super() | ||
|
||
this._0 = _0 | ||
|
||
this.length = 1 | ||
} | ||
}; | ||
|
||
class $$C_D extends Enum { | ||
constructor(_0) { | ||
super() | ||
|
||
this._0 = _0 | ||
|
||
this.length = 1 | ||
} | ||
}; | ||
|
||
const $Test = new(class { | ||
a(b) { | ||
return (() => { | ||
let __condition = b | ||
|
||
if (__condition instanceof $$C_D) { | ||
const a = __condition._0 | ||
|
||
return (() => { | ||
let __condition = a | ||
|
||
if (__condition instanceof $$A_B) { | ||
const c = __condition._0 | ||
|
||
return c | ||
} | ||
})() | ||
} | ||
})() | ||
} | ||
}) |
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 |
---|---|---|
@@ -1,19 +1,92 @@ | ||
enum Test { | ||
enum Test(a) { | ||
X | ||
Y | ||
Z(Result(a, Number)) | ||
} | ||
|
||
enum Result(error, value) { | ||
Error(error) | ||
Ok(value) | ||
Other(error, value) | ||
} | ||
|
||
module X { | ||
fun a : Test { | ||
fun a : Test(a) { | ||
Test::X | ||
} | ||
|
||
fun b : Result(String, String) { | ||
Result::Other("", "") | ||
} | ||
|
||
fun c : Test(String) { | ||
Test::Z(Result::Error("")) | ||
} | ||
} | ||
-------------------------------------------------------------------------------- | ||
$Test_X = Symbol.for(`Test_X`) | ||
$Test_Y = Symbol.for(`Test_Y`) | ||
class $$Test_X extends Enum { | ||
constructor() { | ||
super() | ||
|
||
this.length = 0 | ||
} | ||
}; | ||
class $$Test_Y extends Enum { | ||
constructor() { | ||
super() | ||
|
||
this.length = 0 | ||
} | ||
}; | ||
class $$Test_Z extends Enum { | ||
constructor(_0) { | ||
super() | ||
|
||
this._0 = _0 | ||
|
||
this.length = 1 | ||
} | ||
}; | ||
|
||
class $$Result_Error extends Enum { | ||
constructor(_0) { | ||
super() | ||
|
||
this._0 = _0 | ||
|
||
this.length = 1 | ||
} | ||
}; | ||
class $$Result_Ok extends Enum { | ||
constructor(_0) { | ||
super() | ||
|
||
this._0 = _0 | ||
|
||
this.length = 1 | ||
} | ||
}; | ||
class $$Result_Other extends Enum { | ||
constructor(_0, _1) { | ||
super() | ||
|
||
this._0 = _0 | ||
this._1 = _1 | ||
|
||
this.length = 2 | ||
} | ||
}; | ||
|
||
const $X = new(class { | ||
a() { | ||
return $Test_X | ||
return new $$Test_X() | ||
} | ||
|
||
b() { | ||
return new $$Result_Other(``, ``) | ||
} | ||
|
||
c() { | ||
return new $$Test_Z(new $$Result_Error(``)) | ||
} | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
component Parallel { | ||
fun test : Promise(Never, String) { | ||
parallel { | ||
a = "Hello" | ||
b = "World" | ||
} then { | ||
a + b | ||
} | ||
} | ||
|
||
fun render : Html { | ||
<div/> | ||
} | ||
} | ||
-------------------------------------------------------------------------------- | ||
class $Parallel extends Component { | ||
test() { | ||
return (async () => { | ||
let _result = null; | ||
|
||
try { | ||
let a = null; | ||
let b = null; | ||
|
||
await Promise.all([ | ||
(async () => { | ||
a = await `Hello` | ||
})(), | ||
|
||
(async () => { | ||
b = await `World` | ||
})() | ||
]) | ||
|
||
_result = a + b | ||
} catch (_error) { | ||
if (_error instanceof DoError) {} else { | ||
console.warn(`Unhandled error in parallel expression:`) | ||
console.warn(_error) | ||
} | ||
} | ||
|
||
return _result | ||
})() | ||
} | ||
|
||
render() { | ||
return _createElement("div", {}) | ||
} | ||
} | ||
|
||
$Parallel.displayName = "Parallel" |
Oops, something went wrong.