Skip to content

Commit

Permalink
Allow generating source maps. (#702)
Browse files Browse the repository at this point in the history
* Allow generating source maps.
* Removing decoding part of VLQ since it's not used.
* Implement code review suggestions.
* Remove unused constant from VLQ.
  • Loading branch information
gdotdesign authored Nov 11, 2024
1 parent fd07efb commit 2599842
Show file tree
Hide file tree
Showing 155 changed files with 1,422 additions and 1,123 deletions.
18 changes: 9 additions & 9 deletions spec/compilers/block_with_early_return
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ component Main {
}
--------------------------------------------------------------------------------
import {
patternVariable as H,
destructure as E,
newVariant as F,
pattern as G,
variant as B
patternVariable as E,
destructure as B,
newVariant as C,
pattern as D,
variant as A
} from "./runtime.js";

export const
A = B(1),
C = B(1),
D = () => {
const a = E(F(A)(`Some string...`), G(A, [H]));
F = A(1),
G = A(1),
H = () => {
const a = B(C(F)(`Some string...`), D(F, [E]));
if (a === false) {
return `RETURN`
};
Expand Down
18 changes: 9 additions & 9 deletions spec/compilers/block_with_early_return_await
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ component Main {
}
--------------------------------------------------------------------------------
import {
patternVariable as H,
destructure as E,
newVariant as F,
pattern as G,
variant as B
patternVariable as E,
destructure as B,
newVariant as C,
pattern as D,
variant as A
} from "./runtime.js";

export const
A = B(1),
C = B(1),
D = () => {
F = A(1),
G = A(1),
H = () => {
(async () => {
const a = E(await F(A)(`Some string...`), G(A, [H]));
const a = B(await C(F)(`Some string...`), D(F, [E]));
if (a === false) {
return `RETURN`
};
Expand Down
22 changes: 11 additions & 11 deletions spec/compilers/bracket_access
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ component Main {
}
--------------------------------------------------------------------------------
import {
bracketAccess as E,
mapAccess as F,
variant as B
bracketAccess as B,
mapAccess as C,
variant as A
} from "./runtime.js";

export const
A = B(0),
C = B(1),
D = () => {
E([
D = A(0),
E = A(1),
F = () => {
B([
`Hello`,
`Blah`,
`Joe`
], 1, C, A);
E([], 1, C, A);
F([[
], 1, E, D);
B([], 1, E, D);
C([[
`key`,
`value`
]], `key`, C, A);
]], `key`, E, D);
return ``
};
10 changes: 5 additions & 5 deletions spec/compilers/builtin
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ component Main {
}
--------------------------------------------------------------------------------
import {
createElement as C,
decodeBoolean as B
createElement as B,
decodeBoolean as A
} from "./runtime.js";

export const A = () => {
(B);
return C(`div`, {})
export const C = () => {
(A);
return B(`div`, {})
};
36 changes: 18 additions & 18 deletions spec/compilers/bundling
Original file line number Diff line number Diff line change
Expand Up @@ -57,46 +57,46 @@ component Main {
--------------------------------------------------------------------------------
---=== /__mint__/index.js ===---
import {
lazyComponent as I,
createElement as G,
useEffect as E,
useSignal as D,
fragment as H,
variant as K,
load as F,
lazy as B
lazyComponent as G,
createElement as E,
useEffect as C,
useSignal as B,
fragment as F,
variant as H,
load as D,
lazy as A
} from "./runtime.js";

export const
a = `./1.js`,
b = (c) => {
return `Hello ${c}!`
},
A = B(`./2.js`),
C = () => {
const d = D(``);
E(() => {
I = A(`./2.js`),
J = () => {
const d = B(``);
C(() => {
(async () => {
const e = await F(a);
const e = await D(a);
return (() => {
d.value = e
})()
})()
}, []);
return G(H, {}, [
G(I, {
return E(F, {}, [
E(G, {
c: [],
key: `Greeter`,
p: {
a: `World`
},
x: A
x: I
}),
b(`Me`)
])
},
J = K(0),
L = K(0);
K = H(0),
L = H(0);

---=== /__mint__/1.js ===---
export const a = `Hello, I was loaded later...`;
Expand Down
6 changes: 3 additions & 3 deletions spec/compilers/case
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ component Main {
}
}
--------------------------------------------------------------------------------
import { match as B } from "./runtime.js";
import { match as A } from "./runtime.js";

export const A = () => {
B(`Hello`, [
export const B = () => {
A(`Hello`, [
[
`test`,
() => {
Expand Down
6 changes: 3 additions & 3 deletions spec/compilers/case_await
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ component Main {
}
}
--------------------------------------------------------------------------------
import { match as B } from "./runtime.js";
import { match as A } from "./runtime.js";

export const A = () => {
export const B = () => {
(async () => {
return B(await `Hello`, [
return A(await `Hello`, [
[
`test`,
() => {
Expand Down
6 changes: 3 additions & 3 deletions spec/compilers/case_empty
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ component Main {
}
}
--------------------------------------------------------------------------------
import { match as B } from "./runtime.js";
import { match as A } from "./runtime.js";

export const A = () => {
return B(`Hello`, [[
export const B = () => {
return A(`Hello`, [[
null,
() => {
return `false`
Expand Down
22 changes: 11 additions & 11 deletions spec/compilers/case_with_array_destructuring
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ component Main {
}
--------------------------------------------------------------------------------
import {
patternVariable as C,
patternSpread as D,
match as B
patternVariable as B,
patternSpread as C,
match as A
} from "./runtime.js";

export const A = () => {
return B([], [
export const D = () => {
return A([], [
[
[],
() => {
Expand All @@ -31,15 +31,15 @@ export const A = () => {
}
],
[
[C],
[B],
(a) => {
return [a]
}
],
[
[
C,
C
B,
B
],
(b, c) => {
return [
Expand All @@ -50,9 +50,9 @@ export const A = () => {
],
[
[
C,
C,
D
B,
B,
C
],
(d, e, f) => {
return f
Expand Down
14 changes: 7 additions & 7 deletions spec/compilers/case_with_nested_tuple_destructuring
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ component Main {
}
--------------------------------------------------------------------------------
import {
patternVariable as C,
match as B
patternVariable as B,
match as A
} from "./runtime.js";

export const A = () => {
return B([
export const C = () => {
return A([
`A`,
[
`B`,
Expand Down Expand Up @@ -52,10 +52,10 @@ export const A = () => {
],
[
[
C,
B,
[
C,
C
B,
B
]
],
(a, b, c) => {
Expand Down
14 changes: 7 additions & 7 deletions spec/compilers/case_with_tuple_destructuring
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ component Main {
}
--------------------------------------------------------------------------------
import {
patternVariable as C,
match as B
patternVariable as B,
match as A
} from "./runtime.js";

export const A = () => {
return B([
export const C = () => {
return A([
`A`,
0,
true
Expand All @@ -46,9 +46,9 @@ export const A = () => {
],
[
[
C,
C,
C
B,
B,
B
],
(a, b, c) => {
return a
Expand Down
6 changes: 3 additions & 3 deletions spec/compilers/case_with_tuple_destructuring_bool
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ component Main {
}
}
--------------------------------------------------------------------------------
import { match as B } from "./runtime.js";
import { match as A } from "./runtime.js";

export const A = () => {
return B([
export const B = () => {
return A([
false,
true
], [
Expand Down
28 changes: 14 additions & 14 deletions spec/compilers/case_with_type_destructuring
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ component Main {
}
--------------------------------------------------------------------------------
import {
patternVariable as I,
newVariant as G,
pattern as H,
variant as B,
match as F
patternVariable as E,
newVariant as C,
pattern as D,
variant as A,
match as B
} from "./runtime.js";

export const
A = B(1),
C = B(0),
D = B(1),
E = () => {
F(G(A)(G(D)(``)), [
F = A(1),
G = A(0),
H = A(1),
I = () => {
B(C(F)(C(H)(``)), [
[
H(C, []),
D(G, []),
() => {
return ``
}
],
[
H(A, [I]),
D(F, [E]),
(a) => {
return F(a, [[
H(D, [I]),
return B(a, [[
D(H, [E]),
(b) => {
return b
}
Expand Down
Loading

0 comments on commit 2599842

Please sign in to comment.