Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A language that compiles down to pure javascript
Ruby JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
spec
.gitignore
.rspec
CHANGELOG.md
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
SweetTea.gemspec

README.md

SweetTea

SweetTea is a language that compiles down to javascript, similar to coffeescript.

Syntax

Classes

Empty Class
// SweetTea
class-> MyClass
<-class

// JavaScript
var MyClass = (function() {
  function MyClass() {}
  return MyClass;
})();
Class Init
// SweetTea
class-> MyClass
  function-> init arg1 arg2
    var-> someVar = "value"
  <-function
<-class

// JavaScript
var MyClass = (function() {
  function MyClass(arg1, arg2) {
    var someVar = "value";
  }
  return MyClass;
})();
Class Variables
// SweeTea
class-> MyClass
  variable-> myVar = "Hello World"
<-class

// JavaScript
var MyClass = (function() {
  function MyClass() {}
  MyClass.prototype.myVar = "Hello World";
  return MyClass;
})();
Class Functions
// SweetTea
class-> MyClass
  function-> myFunction <-function
<-class

// JavaScript
var MyClass = (function() {
  function MyClass() {}
  MyClass.prototype.myFunction = function() {
  };
  return MyClass;
})();

Functions

Empty Function
// SweetTea
function-> myFunc <-function

// JavaScript
var myFunc = function() {
};
Function with arguments
// SweetTea
function-> myFunc arg1 arg2 arg3 <-function

// JavaScript
var myFunc = function(arg1, arg2, arg3) {
};

Variables

Empty Variable
// SweetTea
var-> myVar

// JavasScript
var myVar = null;
Variable with value
// SweetTea
var-> myVar = "Hello"

// JavaScript
var myVar = "Hello";

Data Types

// Strings
"I am a String"

Note: Strings are currently the only data type

Aliases

// Classes
class->
c->

// Functions
function->
func->
f->

// Variables
variable->
var->
v->

License

All code in this project is licensed under MIT which can be found in the LICENSE file or at this url http://www.opensource.org/licenses/MIT

Something went wrong with that request. Please try again.