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
118 changed files
with
6,545 additions
and
13,481 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 @@ | ||
{ | ||
"presets": ["es2015-node5"], | ||
"presets": ["node7"], | ||
"plugins": ["transform-flow-strip-types"], | ||
"sourceMaps": "inline" | ||
} |
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,6 @@ | ||
[ignore] | ||
build/* | ||
dist/* | ||
|
||
[include] | ||
|
||
|
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,3 @@ | ||
[submodule "test/test262-parser-tests"] | ||
path = test/test262-parser-tests | ||
url = https://github.com/tc39/test262-parser-tests.git |
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,4 @@ | ||
language: node_js | ||
node_js: | ||
- "5" | ||
- "6" | ||
script: npm run test:full | ||
- "7" | ||
script: npm test |
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,28 +1,17 @@ | ||
'use strict'; | ||
/* | ||
This file makes debugging sweet.js easier. Uses the built version of sweet.js | ||
to compile "test.js". You can use node-inspector to step through the expansion | ||
to compile 'test.js'. You can use node-inspector to step through the expansion | ||
process: | ||
npm install -g node-inspector | ||
node-debug debug.js | ||
*/ | ||
|
||
var compile = require("./build/src/sweet").compile; | ||
var transform = require('babel-core').transform; | ||
var moduleResolver = require('./build/src/node-module-resolver').default; | ||
var moduleLoader = require('./build/src/node-module-loader').default; | ||
|
||
var fs = require("fs"); | ||
|
||
var source = fs.readFileSync("./test.js", "utf8"); | ||
require('babel-register'); | ||
var compile = require('./src/sweet-loader.js').default; | ||
|
||
debugger; | ||
var result = compile(source, { | ||
cwd: __dirname, | ||
// transform: transform, | ||
filename: './test.js', | ||
moduleResolver: moduleResolver, | ||
moduleLoader: moduleLoader, | ||
enforcePragma: true | ||
}); | ||
console.log(result.code); | ||
|
||
let mod = compile('./test.js'); | ||
console.log(mod.codegen()); |
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,4 @@ | ||
#lang "sweet.js"; | ||
|
||
// export var id = function (x) { | ||
// return x; | ||
// } | ||
|
||
export syntax m = ctx => #`1`; | ||
#lang 'base'; | ||
export function id(x) { | ||
return x; | ||
} |
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
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,12 @@ | ||
import reduce from "shift-reducer"; | ||
import ParseReducer from "./parse-reducer"; | ||
import shiftCodegen, { FormattedCodeGen } from "shift-codegen"; | ||
import Term from "./terms"; | ||
import { List } from 'immutable'; | ||
|
||
export default function codegen(modTerm) { | ||
// let ast = reduce(new ParseReducer({phase: 0}), modTerm); | ||
return { | ||
code: shiftCodegen(modTerm, new FormattedCodeGen()) | ||
}; | ||
} |
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
Oops, something went wrong.