-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Showing
34 changed files
with
18,865 additions
and
12,926 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 |
---|---|---|
|
@@ -6,5 +6,4 @@ package-lock.json | |
logs | ||
as-tral | ||
*.lockb | ||
*.lockb | ||
.vscode/ |
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
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,7 +1,7 @@ | ||
import { snip_fast } from "../util"; | ||
|
||
// @ts-ignore: Decorator | ||
export function deserializeInteger<T>(data: string): T { | ||
// @ts-ignore: Decorator valid here | ||
@inline export function deserializeInteger<T>(data: string): T { | ||
// @ts-ignore | ||
return snip_fast<T>(data); | ||
} |
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,4 +1,4 @@ | ||
// @ts-ignore | ||
export function serializeDate(data: Date): string { | ||
// @ts-ignore: Decorator valid here | ||
@inline export function serializeDate(data: Date): string { | ||
return `"${data.toISOString()}"` | ||
} |
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,4 +1,4 @@ | ||
// @ts-ignore | ||
export function serializeFloat<T extends number>(data: T): string { | ||
// @ts-ignore: Decorator valid here | ||
@inline export function serializeFloat<T extends number>(data: T): string { | ||
return data.toString(); | ||
} |
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 @@ | ||
// @ts-ignore | ||
export function serializeInteger<T extends number>(data: T): string { | ||
// @ts-ignore: Decorator valid here | ||
@inline export function serializeInteger<T extends number>(data: T): string { | ||
// I have a much faster implementation of itoa that I will port over later. Its ~4x faster | ||
return data.toString(); | ||
} |
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,6 @@ | ||
import { MpZ } from "@hypercubed/as-mpz"; | ||
|
||
// @ts-ignore | ||
export function serializeMpZ(data: MpZ): string { | ||
// @ts-ignore: Decorator valid here | ||
@inline export function serializeMpZ(data: MpZ): string { | ||
return data.toString(); | ||
} |
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,7 +1,7 @@ | ||
interface GeneratedInterface { | ||
__SERIALIZE(): string; | ||
} | ||
// @ts-ignore | ||
export function serializeObject<T extends GeneratedInterface>(data: T): string { | ||
// @ts-ignore: Decoraor valid here | ||
@inline export function serializeObject<T extends GeneratedInterface>(data: T): string { | ||
return changetype<nonnull<T>>(data).__SERIALIZE(); | ||
} |
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,12 +1,25 @@ | ||
import { JSON } from "."; | ||
import { Vec3 as Vec3a } from "./types"; | ||
import { Vec3 as Vec3b } from "./types"; | ||
export function add(a: i32 = 1, b: i32 = 2, c: i32 = 3): i32 { | ||
return a + b + c; | ||
} | ||
|
||
const veca = new Vec3a(); | ||
const vecb = new Vec3b(); | ||
// add() Should transform to | ||
|
||
const serializeda = JSON.stringify(veca); | ||
console.log("SERIALIZED-A: " + serializeda); | ||
// if we call the GraphQL, say add(a: 2, c: 9), b is not defined--this is not possible. | ||
// So, in that case, we set the bits in this order | ||
// 0b1010000000000000 | ||
// abcdefghijklmnop | ||
// ||| | ||
// 2|9 | ||
// 2 <--- set to default since toggle is 0 | ||
// Thus, that gives us the following arguments: | ||
// a: 2, b: 2, c: 9 | ||
|
||
const serialziedb = JSON.stringify(vecb); | ||
console.log("SERIALIZED-B: " + serialziedb); | ||
export function _add(a: i32, b: i32, c: i32, _mask: u64): i32 { | ||
if ((_mask & 1) == 0) a = 1; | ||
if ((_mask >> 1 & 1) == 0) b = 2; | ||
if ((_mask >> 2 & 1) == 0) c = 3; | ||
return a + b + c; | ||
} | ||
|
||
console.log("add(1,2,3: " + add(1,2,3).toString()); | ||
console.log("add(2,nil,9): " + _add(2,0,9,0b101).toString()); |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.