-
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.
generating markdown for test results (#2)
* generating markdown for test results * capitalizing section names and fixing md for errors * moved md files to examples dir * removed old tests
- Loading branch information
1 parent
87bba6b
commit d41cbd8
Showing
35 changed files
with
377 additions
and
84 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
## `arrow-function-1.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
const f = (x) => x; | ||
const g = (x) => f(x); | ||
const h = (x) => x((x) => f(x)); | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
const f_3 = (x_9) => x_9; | ||
const g_5 = (x_9) => f_3(x_9); | ||
const h_7 = (x_9) => x_9((x_12) => f_3(x_12)); | ||
``` | ||
|
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,23 @@ | ||
## `arrow-function-2.ts` | ||
|
||
### Status: `SyntaxError` | ||
|
||
``` | ||
x is already defined in normal_env | ||
``` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
const foo = (x) => { | ||
// should give a syntax error | ||
const x = 13; | ||
}; | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
const /*>>>*/ x /*<<<*/ = 13; | ||
``` | ||
|
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,20 @@ | ||
## `arrow-function-3.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
const foo = (x) => { | ||
const bar = x(13); | ||
}; | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
const foo_3 = (x_5) => { | ||
const bar_8 = x_5(13); | ||
}; | ||
``` | ||
|
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,20 @@ | ||
## `arrow-function-4.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
const foo = (x) => { | ||
using_syntax_rules([t,t,x]).rewrite(t); | ||
} | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
const foo_3 = (x_5) => { | ||
x_5; | ||
}; | ||
``` | ||
|
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,22 @@ | ||
## `arrow-function-5.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
const foo = (x) => { | ||
using_syntax_rules([t,t,x]).rewrite(splice(() => { | ||
t | ||
})); | ||
} | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
const foo_3 = (x_5) => { | ||
x_5; | ||
}; | ||
``` | ||
|
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,18 @@ | ||
## `left-matching-1.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
using_syntax_rules( | ||
[foo, op(x,foo,y), op - x + y], | ||
).rewrite(12(1,foo,3)) | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
12 - 1 + 3; | ||
``` | ||
|
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,23 @@ | ||
## `left-matching-2.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
using_syntax_rules( | ||
[foo, [pre](xs,foo,ys)(args), [[pre],[xs],[ys],[args]]], | ||
).rewrite([7,8,9](1,2,3,foo,4,5,6)(10,11,12)) | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
[ | ||
[7, 8, 9], | ||
[1, 2, 3], | ||
[4, 5, 6], | ||
[10, 11, 12], | ||
]; | ||
``` | ||
|
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,20 @@ | ||
## `macro-generating-macro-1.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
using_syntax_rules( | ||
[capture, | ||
capture(expr, id, body), | ||
using_syntax_rules([id, id, expr]).rewrite(body)], | ||
).rewrite((x) => capture(x, t, (x) => x + t)) | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
(x_5) => (x_11) => x_11 + x_5; | ||
``` | ||
|
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,20 @@ | ||
## `not-test-1.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
using_syntax_rules( | ||
[not, not(x) ? a : b, x ? b : a], | ||
[not, not(x), !x], | ||
[not, not, (x) => not(x)], | ||
).rewrite(not(not(not(1))) ? not : not(3)) | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
1 ? !3 : (x_10) => !x_10; | ||
``` | ||
|
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,24 @@ | ||
## `splice-1.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
const t = 13; | ||
splice(() => { | ||
const x = 17; | ||
const y = x + t; | ||
}); | ||
const q = t + x; | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
const t_3 = 13; | ||
const x_5 = 17; | ||
const y_7 = x_5 + t_3; | ||
const q_9 = t_3 + x_5; | ||
``` | ||
|
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,24 @@ | ||
## `splice-2.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
const foo = (x) => { | ||
using_syntax_rules([t,t,x]).rewrite(splice(() => { | ||
t; | ||
t; | ||
})); | ||
} | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
const foo_3 = (x_5) => { | ||
x_5; | ||
x_5; | ||
}; | ||
``` | ||
|
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,18 @@ | ||
## `test-1.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
const x = 12; | ||
x; | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
const x_3 = 12; | ||
x_3; | ||
``` | ||
|
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,18 @@ | ||
## `test-2.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
const x = 12; | ||
x + x; | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
const x_3 = 12; | ||
x_3 + x_3; | ||
``` | ||
|
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,21 @@ | ||
## `using-syntax-rules-1.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
using_syntax_rules( | ||
[foo, foo(x), x], | ||
//[foo, { literals: [name], capturing: [d], nonrecursive: [bar] }, foo.name, "foo"], | ||
//[foo, foo.prop, "foo"], | ||
//[foo, foo, 17], | ||
).rewrite(foo(12)); | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
12; | ||
``` | ||
|
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,21 @@ | ||
## `using-syntax-rules-2.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
using_syntax_rules( | ||
[foo, foo(x), x + x], | ||
[foo, foo, x] | ||
).rewrite(foo(foo)); | ||
const x = 12; | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
x_8 + x_8; | ||
const x_8 = 12; | ||
``` | ||
|
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,21 @@ | ||
## `using-syntax-rules-3.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
using_syntax_rules( | ||
[foo, foo(x), (foo) => x + x], | ||
[foo, foo, x] | ||
).rewrite(foo(foo)); | ||
const x = 12; | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
(foo_8) => x_6 + x_6; | ||
const x_6 = 12; | ||
``` | ||
|
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,22 @@ | ||
## `using-syntax-rules-4.ts` | ||
|
||
### Status: `DONE` | ||
|
||
### Input Program | ||
|
||
```typescript | ||
using_syntax_rules( | ||
[foo, foo(x), foo + ((x, foo) => foo + x)], | ||
[foo, foo, x] | ||
).rewrite(foo(foo)) | ||
|
||
const x = 12; | ||
``` | ||
|
||
### Output Program | ||
|
||
```typescript | ||
x_7 + ((foo_9, foo_11) => foo_11 + foo_9); | ||
const x_7 = 12; | ||
``` | ||
|
Oops, something went wrong.