Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniform data #46

Merged
merged 35 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b78b8e1
preexpand_body converted
azizghuloum Dec 16, 2024
ec05361
preexpand_forms
azizghuloum Dec 16, 2024
cf48a58
preexpand-body-curly
azizghuloum Dec 16, 2024
63c03df
refactored preexpand_block
azizghuloum Dec 16, 2024
ebf5934
refactored extract parameters
azizghuloum Dec 16, 2024
58f0543
added imp to data
azizghuloum Dec 16, 2024
61998a6
expand_type_parameters
azizghuloum Dec 16, 2024
6c162ca
core syntax takes data
azizghuloum Dec 16, 2024
dd21506
core syntax handlers are now walkers
azizghuloum Dec 16, 2024
c495b9b
minor refactor
azizghuloum Dec 16, 2024
65aeade
gen_bindings is now more conservative in what it takes and returns
azizghuloum Dec 16, 2024
88f05db
more simplifications
azizghuloum Dec 16, 2024
a7b5401
added modular to data
azizghuloum Dec 16, 2024
66f8b69
simplified handle_core_syntax
azizghuloum Dec 16, 2024
80d9820
simplified postexpand_program
azizghuloum Dec 16, 2024
441e3c1
refacrored postexpand_body
azizghuloum Dec 17, 2024
ab18f1b
progress
azizghuloum Dec 17, 2024
b93868d
progress
azizghuloum Dec 17, 2024
2a2f7b3
more refactoring
azizghuloum Dec 17, 2024
432d3b9
refactoring
azizghuloum Dec 17, 2024
c3ebbaa
refactored expand_arrow_function
azizghuloum Dec 17, 2024
2af84d2
more refactoring
azizghuloum Dec 17, 2024
3001ac5
refactoring
azizghuloum Dec 17, 2024
610e5c1
more
azizghuloum Dec 17, 2024
34fb667
removed ppdata
azizghuloum Dec 17, 2024
7334cd4
removed goodies
azizghuloum Dec 17, 2024
84d0dd0
simplified
azizghuloum Dec 17, 2024
92413a9
simplified expand concise body
azizghuloum Dec 17, 2024
11fe755
fixed wrong counter
azizghuloum Dec 17, 2024
3e9b9e3
fixed arrow functions
azizghuloum Dec 17, 2024
ba15f38
simplified in_isolation
azizghuloum Dec 17, 2024
0048194
removed ugly types
azizghuloum Dec 17, 2024
c6194ac
more
azizghuloum Dec 17, 2024
409e63d
currying sort parameter
azizghuloum Dec 17, 2024
7a12a77
simplified handling concise bodies
azizghuloum Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions examples/arrow-function-1.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const h = (x) => x((x) => f(x));
### Output Program

```typescript
export const f_2 = (x_8) => x_8;
export const g_4 = (x_9) => f_2(x_9);
export const h_6 = (x_10) => x_10((x_11) => f_2(x_11));
export const f_2 = (x_9) => x_9;
export const g_4 = (x_12) => f_2(x_12);
export const h_6 = (x_15) => x_15((x_18) => f_2(x_18));
```

4 changes: 2 additions & 2 deletions examples/arrow-function-3.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const foo = (x) => {
### Output Program

```typescript
export const foo_2 = (x_4) => {
const bar_5 = x_4(13);
export const foo_2 = (x_5) => {
const bar_7 = x_5(13);
};
```

4 changes: 2 additions & 2 deletions examples/arrow-function-4.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const foo = (x) => {
### Output Program

```typescript
export const foo_2 = (x_4) => {
x_4;
export const foo_2 = (x_5) => {
x_5;
};
```

4 changes: 2 additions & 2 deletions examples/arrow-function-5.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const foo = (x) => {
### Output Program

```typescript
export const foo_2 = (x_4) => {
x_4;
export const foo_2 = (x_5) => {
x_5;
};
```

6 changes: 3 additions & 3 deletions examples/confused-parens-with-calls.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const foo = (x) => {
### Output Program

```typescript
export const foo_2 = (x_4) => {
x_4;
x_4;
export const foo_2 = (x_5) => {
x_5;
x_5;
};
```

2 changes: 1 addition & 1 deletion examples/curry-1.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ using_rewrite_rules(
### Output Program

```typescript
(a_5) => (b_7) => (c_9) => (d_11) => a_5 + b_7 + c_9 + d_11;
(a_6) => (b_10) => (c_14) => (d_18) => a_6 + b_10 + c_14 + d_18;
```

2 changes: 1 addition & 1 deletion examples/curry-2.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ const curried =
### Output Program

```typescript
export const curried_3 = (a_6) => (b_8) => (c_10) => (d_12) => a_6 + b_8 + c_10 + d_12;
export const curried_3 = (a_7) => (b_11) => (c_15) => (d_19) => a_7 + b_11 + c_15 + d_19;
```

2 changes: 1 addition & 1 deletion examples/expr-dot-where.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ console.log(x + y).where(x = 1, y = x + 2);
### Output Program

```typescript
((x_4) => ((y_6) => console.log(x_4 + y_6))(x_4 + 2))(1);
((x_5) => ((y_9) => console.log(x_5 + y_9))(x_5 + 2))(1);
```

4 changes: 2 additions & 2 deletions examples/lexical-declarations-1.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export const y_4 = 13,
z_6: t_2 = y_4,
q_8: t_2,
r_10;
export const x_12 = (z_14) => {
const t_15 = z_14;
export const x_12 = (z_15) => {
const t_17 = z_15;
};
```

2 changes: 1 addition & 1 deletion examples/macro-generating-macro-1.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ using_rewrite_rules(
### Output Program

```typescript
(x_4) => (x_8) => x_8 + x_4;
(x_5) => (x_11) => x_11 + x_5;
```

6 changes: 3 additions & 3 deletions examples/macro-generating-macro-2.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ using_rewrite_rules(
### Output Program

```typescript
(x_4) => {
const using_rewrite_rules_5 = 10;
(x_10) => x_10 + x_4;
(x_5) => {
const using_rewrite_rules_7 = 10;
(x_13) => x_13 + x_5;
};
```

2 changes: 1 addition & 1 deletion examples/not-test-1.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ using_rewrite_rules(
### Output Program

```typescript
1 ? !3 : (x_9) => !x_9;
1 ? !3 : (x_10) => !x_10;
```

6 changes: 3 additions & 3 deletions examples/splice-2.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ const foo = (x) => {
### Output Program

```typescript
export const foo_2 = (x_4) => {
x_4;
x_4;
export const foo_2 = (x_5) => {
x_5;
x_5;
};
```

2 changes: 1 addition & 1 deletion examples/using-rewrite-rules-3.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const x = 12;
### Output Program

```typescript
(foo_7) => x_5 + x_5;
(foo_8) => x_5 + x_5;
export const x_5 = 12;
```

2 changes: 1 addition & 1 deletion examples/using-rewrite-rules-4.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const x = 12;
### Output Program

```typescript
x_6 + ((foo_8, foo_10) => foo_10 + foo_8);
x_6 + ((foo_9, foo_11) => foo_11 + foo_9);
export const x_6 = 12;
```

2 changes: 1 addition & 1 deletion rtsc/.rts/testing-file-extensions.rts.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"cid": "rtsc/testing-file-extensions.rts rewrite-ts-visualized 0.0.0",
"cookie": "rewrite-ts-007",
"cookie": "rewrite-ts-008",
"exported_identifiers": {
"x": [
{
Expand Down
20 changes: 20 additions & 0 deletions src/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { preexpand_helpers } from "./preexpand-helpers";
import { import_req, lexical_extension, modular_extension } from "./stx";
import { CompilationUnit, Context, Loc } from "./syntax-structures";

export type data = {
loc: Loc;
lexical: lexical_extension;
context: Context;
counter: number;
unit: CompilationUnit;
helpers: preexpand_helpers;
imp: import_req;
modular: modular_extension;
};

export type walker = (data: data) => Promise<data>;

export type walkerplus<T> = (data: data & T) => Promise<data>;

export type swalker = (data: data) => data;
Loading
Loading