Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 0.2: Added multi-line statements and README.
- Loading branch information
Showing
4 changed files
with
122 additions
and
43 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,32 @@ | ||
TypeScript Interpret | ||
================== | ||
|
||
[TypeScript](http://www.typescriptlang.org) is a brand new language which compiles on JavaScript. However, this operation has to be performed manually, using the command-line compiler `tsc` or other tools. But now it can be interpreted straight in your web browser, thanks to TypeScript Interpret! | ||
|
||
TypeScript Interpret automatically interprets your TypeScript code typed into a console, using the [jQuery Terminal](https://github.com/jcubic/jquery.terminal) by Jakub Jankiewicz. | ||
|
||
|
||
Demo | ||
---- | ||
|
||
[Here is a TypeScript terminal emulator](http://niutech.github.com/typescript-interpret/) | ||
|
||
|
||
Download | ||
-------- | ||
|
||
[TypeScript 0.8](https://raw.github.com/niutech/typescript-compile/gh-pages/js/typescript.min.js) (minified JS) | ||
|
||
[TypeScript Interpret 0.2](https://raw.github.com/niutech/typescript-interpret/gh-pages/typescript.interpret.min.js) (minified JS) | ||
|
||
[jQuery Terminal 0.4.22](https://raw.github.com/jcubic/jquery.terminal/master/js/jquery.terminal-0.4.22.min.js) (minified JS) | ||
|
||
|
||
Authors & License | ||
---------------- | ||
|
||
TypeScript is developed by Microsoft Corp. under Apache 2.0 License. | ||
|
||
TypeScript Interpret is developed by Jerzy Głowacki under Apache 2.0 License. | ||
|
||
jQuery Terminal is developed by Jakub Jankiewicz under GNU GPL 3 License. |
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,31 @@ | ||
var TypeScriptInterpret = { | ||
|
||
outfile: { | ||
source: '', | ||
Write: function(s) { | ||
this.source += s; | ||
}, | ||
WriteLine: function(s) { | ||
this.source += s + '\n'; | ||
}, | ||
Clear: function() { | ||
this.source = ''; | ||
}, | ||
Close: function() {} | ||
}, | ||
|
||
interpret: function(cmd) { | ||
this.outfile.Clear(); | ||
var compiler = new TypeScript.TypeScriptCompiler(this.outfile); | ||
compiler.parser.errorRecovery = true; | ||
compiler.setErrorCallback(function(start, len, message, block) { | ||
throw 'TypeScriptError: ' + message + ', char: ' + start + ', length: ' + len; | ||
}); | ||
compiler.addUnit(cmd, ''); | ||
//compiler.typeCheck(); //Disabled due to exclusion of lib.d.ts | ||
compiler.emit(false, function(fileName) { | ||
return this.outfile; | ||
}); | ||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.