Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:jeffsu/js2 into jsml

Conflicts:
	dist/browser/js2-full.js
	dist/gem/CHANGELOG
	dist/gem/lib/js2/js2.js
	dist/npm/CHANGELOG
	dist/npm/lib/js2.js
	flavors/browser-full.js
	flavors/node.js
	flavors/ringo-full.js
	flavors/ruby.js
	src/Common/JSML.js2
  • Loading branch information...
commit 66000044fc52848da6b78ec457fb1e0010c49709 2 parents 57ef10a + bed2395
@jeffsu authored
View
9 CHANGELOG
@@ -1,5 +1,10 @@
0.3.13
* fixed problem that doesn't allow toString methods
+ * JSML POC
+
+0.3.12
+ * fixed parse error in JSMLElement
+ * Yanking 0.3.11
0.3.11
* fixed minor issue finding Rails.root in rack
@@ -18,7 +23,7 @@
0.3.8
* fied "render"
* fixed comment block bug
- * using target-dir instead of out-dir
+ * using target-dir instead of out-dir
0.3.7
* fixed foreach counter
@@ -30,7 +35,7 @@
0.3.5
* Added scope and binding support to shorthand functions
- * Added support for modules
+ * Added support for modules
0.3.4
* coded reduce to clojure spec
View
2  VERSION
@@ -1 +1 @@
-0.3.11
+0.3.12
View
44 dist/browser/js2-full.js
@@ -18,7 +18,7 @@ function mainFunction (arg) {
var JS2 = root.JS2 = mainFunction;
var js2 = root.js2 = JS2;
- js2.VERSION = "0.3.11";
+ js2.VERSION = "0.3.12";
JS2.ROOT = JS2;
@@ -1580,9 +1580,13 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
this.attributes = {};
this.line = line;
var self = this;
+<<<<<<< HEAD
var splitted = line.match(this.SPLIT_REGEX);
splitted[1].replace(this.TOKEN_REGEX, function(match, type, name){
+=======
+ line = line.replace(this.TOKEN_REGEX, function(match, type, name){
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
switch(type) {
case '%': self.nodeType = name; break;
case '.': self.classes.push(name); break;
@@ -1591,6 +1595,7 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
return '';
});
+<<<<<<< HEAD
if (splitted[2] == '=') {
this.jsEQ = splitted[3];
} else if (splitted[2] == '-') {
@@ -1602,17 +1607,23 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (!this.nodeType && (this.classes.length || this.nodeID)) {
this.nodeType = 'div';
}
- });
+ };
- OO.addMember("flatten",function () {
+ function flatten() {
var out = [];
for(var _i1=0,_c1=this.children,_l1=_c1.length,c;(c=_c1[_i1])||(_i1<_l1);_i1++){
var arr = c.flatten();
for(var _i2=0,_c2=arr,_l2=_c2.length,item;(item=_c2[_i2])||(_i2<_l2);_i2++){
out.push(item);
+=======
+ line = line.replace(this.JS_OUT_REGEX, function(match, type, content){
+ switch(type) {
+ case '=': this.jsEQ = content; break;
+ case '-': this.jsExec = content; break;
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
}
- }
+ };
if (this.nodeType) {
this.handleJsEQ(out);
@@ -1626,32 +1637,33 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
}
return out;
- });
+ }
- OO.addMember("handleJsEQ",function (out) {
+ function handleJsEQ(out) {
if (this.jsEQ) {
this.jsEQ = this.jsEQ.replace(/;\s*$/, '');
out.unshift('out.push(' + this.jsEQ + ');\n');
}
- });
+ }
- OO.addMember("handleContent",function (out) {
+ function handleContent(out) {
if (this.content != null && this.content.length > 0) {
out.unshift('out.push(' + JSON.stringify(this.content) + ');\n');
}
- });
+ }
- OO.addMember("handleJsExec",function (out) {
+ function handleJsExec(out) {
if (this.jsExec) {
out.unshift(this.jsExec);
if (this.jsExec.match(/\{\s*$/)) {
out.push("}\n");
}
}
- });
+ }
+<<<<<<< HEAD
- OO.addMember("getAttributes",function () {
+ function getAttributes() {
if (!this.attributes) return '';
var out = [];
@@ -1667,9 +1679,11 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
}
return (out.length ? ' ' : '') + out.join(' ');
- });
-});
-
+ }
+=======
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
+}
+););
JS2.TEMPLATES = { jsml: JS2.JSML };
(function (undefined, JS2) {
View
2  dist/browser/js2.js
@@ -19,7 +19,7 @@ function mainFunction (arg) {
var JS2 = root.JS2 = mainFunction;
var js2 = root.js2 = JS2;
- js2.VERSION = "0.3.11";
+ js2.VERSION = "0.3.12";
JS2.ROOT = JS2;
View
6 dist/gem/CHANGELOG
@@ -1,5 +1,11 @@
+<<<<<<< Updated upstream
0.3.13
* fixed problem that doesn't allow toString methods
+=======
+0.3.12
+ * fixed parse error in JSMLElement
+ * Yanking 0.3.11
+>>>>>>> Stashed changes
0.3.11
* fixed minor issue finding Rails.root in rack
View
2  dist/gem/js2.gemspec
@@ -1,6 +1,6 @@
spec = Gem::Specification.new do |s|
s.name = 'js2'
- s.version = '0.3.11'
+ s.version = '0.3.12'
s.summary = "Javascript Syntactic Sugar"
s.description = %{A superset of the Javascript language to make development easier.}
s.files = Dir['bin/*'] + Dir['lib/**/*.rb'] + Dir['lib/**/*.js'] + [ 'CHANGELOG' ]
View
44 dist/gem/lib/js2/js2.js
@@ -14,7 +14,7 @@ function mainFunction (arg) {
var JS2 = root.JS2 = mainFunction;
var js2 = root.js2 = JS2;
- js2.VERSION = "0.3.11";
+ js2.VERSION = "0.3.12";
JS2.ROOT = JS2;
@@ -1576,9 +1576,13 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
this.attributes = {};
this.line = line;
var self = this;
+<<<<<<< HEAD
var splitted = line.match(this.SPLIT_REGEX);
splitted[1].replace(this.TOKEN_REGEX, function(match, type, name){
+=======
+ line = line.replace(this.TOKEN_REGEX, function(match, type, name){
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
switch(type) {
case '%': self.nodeType = name; break;
case '.': self.classes.push(name); break;
@@ -1587,6 +1591,7 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
return '';
});
+<<<<<<< HEAD
if (splitted[2] == '=') {
this.jsEQ = splitted[3];
} else if (splitted[2] == '-') {
@@ -1598,17 +1603,23 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (!this.nodeType && (this.classes.length || this.nodeID)) {
this.nodeType = 'div';
}
- });
+ };
- OO.addMember("flatten",function () {
+ function flatten() {
var out = [];
for(var _i1=0,_c1=this.children,_l1=_c1.length,c;(c=_c1[_i1])||(_i1<_l1);_i1++){
var arr = c.flatten();
for(var _i2=0,_c2=arr,_l2=_c2.length,item;(item=_c2[_i2])||(_i2<_l2);_i2++){
out.push(item);
+=======
+ line = line.replace(this.JS_OUT_REGEX, function(match, type, content){
+ switch(type) {
+ case '=': this.jsEQ = content; break;
+ case '-': this.jsExec = content; break;
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
}
- }
+ };
if (this.nodeType) {
this.handleJsEQ(out);
@@ -1622,32 +1633,33 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
}
return out;
- });
+ }
- OO.addMember("handleJsEQ",function (out) {
+ function handleJsEQ(out) {
if (this.jsEQ) {
this.jsEQ = this.jsEQ.replace(/;\s*$/, '');
out.unshift('out.push(' + this.jsEQ + ');\n');
}
- });
+ }
- OO.addMember("handleContent",function (out) {
+ function handleContent(out) {
if (this.content != null && this.content.length > 0) {
out.unshift('out.push(' + JSON.stringify(this.content) + ');\n');
}
- });
+ }
- OO.addMember("handleJsExec",function (out) {
+ function handleJsExec(out) {
if (this.jsExec) {
out.unshift(this.jsExec);
if (this.jsExec.match(/\{\s*$/)) {
out.push("}\n");
}
}
- });
+ }
+<<<<<<< HEAD
- OO.addMember("getAttributes",function () {
+ function getAttributes() {
if (!this.attributes) return '';
var out = [];
@@ -1663,9 +1675,11 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
}
return (out.length ? ' ' : '') + out.join(' ');
- });
-});
-
+ }
+=======
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
+}
+););
JS2.TEMPLATES = { jsml: JS2.JSML };
View
6 dist/npm/CHANGELOG
@@ -1,5 +1,11 @@
+<<<<<<< Updated upstream
0.3.13
* fixed problem that doesn't allow toString methods
+=======
+0.3.12
+ * fixed parse error in JSMLElement
+ * Yanking 0.3.11
+>>>>>>> Stashed changes
0.3.11
* fixed minor issue finding Rails.root in rack
View
44 dist/npm/lib/js2.js
@@ -14,7 +14,7 @@ function mainFunction (arg) {
var JS2 = root.JS2 = mainFunction;
var js2 = root.js2 = JS2;
- js2.VERSION = "0.3.11";
+ js2.VERSION = "0.3.12";
JS2.ROOT = JS2;
@@ -1576,9 +1576,13 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
this.attributes = {};
this.line = line;
var self = this;
+<<<<<<< HEAD
var splitted = line.match(this.SPLIT_REGEX);
splitted[1].replace(this.TOKEN_REGEX, function(match, type, name){
+=======
+ line = line.replace(this.TOKEN_REGEX, function(match, type, name){
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
switch(type) {
case '%': self.nodeType = name; break;
case '.': self.classes.push(name); break;
@@ -1587,6 +1591,7 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
return '';
});
+<<<<<<< HEAD
if (splitted[2] == '=') {
this.jsEQ = splitted[3];
} else if (splitted[2] == '-') {
@@ -1598,17 +1603,23 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (!this.nodeType && (this.classes.length || this.nodeID)) {
this.nodeType = 'div';
}
- });
+ };
- OO.addMember("flatten",function () {
+ function flatten() {
var out = [];
for(var _i1=0,_c1=this.children,_l1=_c1.length,c;(c=_c1[_i1])||(_i1<_l1);_i1++){
var arr = c.flatten();
for(var _i2=0,_c2=arr,_l2=_c2.length,item;(item=_c2[_i2])||(_i2<_l2);_i2++){
out.push(item);
+=======
+ line = line.replace(this.JS_OUT_REGEX, function(match, type, content){
+ switch(type) {
+ case '=': this.jsEQ = content; break;
+ case '-': this.jsExec = content; break;
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
}
- }
+ };
if (this.nodeType) {
this.handleJsEQ(out);
@@ -1622,32 +1633,33 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
}
return out;
- });
+ }
- OO.addMember("handleJsEQ",function (out) {
+ function handleJsEQ(out) {
if (this.jsEQ) {
this.jsEQ = this.jsEQ.replace(/;\s*$/, '');
out.unshift('out.push(' + this.jsEQ + ');\n');
}
- });
+ }
- OO.addMember("handleContent",function (out) {
+ function handleContent(out) {
if (this.content != null && this.content.length > 0) {
out.unshift('out.push(' + JSON.stringify(this.content) + ');\n');
}
- });
+ }
- OO.addMember("handleJsExec",function (out) {
+ function handleJsExec(out) {
if (this.jsExec) {
out.unshift(this.jsExec);
if (this.jsExec.match(/\{\s*$/)) {
out.push("}\n");
}
}
- });
+ }
+<<<<<<< HEAD
- OO.addMember("getAttributes",function () {
+ function getAttributes() {
if (!this.attributes) return '';
var out = [];
@@ -1663,9 +1675,11 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
}
return (out.length ? ' ' : '') + out.join(' ');
- });
-});
-
+ }
+=======
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
+}
+););
JS2.TEMPLATES = { jsml: JS2.JSML };
View
2  dist/npm/package.json
@@ -1,6 +1,6 @@
{ "name" : "js2",
"description" : "Javascript Syntactic Sugar",
- "version" : "0.3.11",
+ "version" : "0.3.12",
"author" : "Jeff Su",
"repository" : { "type" : "git" , "url" : "git://github.com/jeffsu/js2.git" },
"bugs" : { "web" : "http://github.com/jeffsu/js2/issues" },
View
44 flavors/browser-full.js
@@ -18,7 +18,7 @@ function mainFunction (arg) {
var JS2 = root.JS2 = mainFunction;
var js2 = root.js2 = JS2;
- js2.VERSION = "0.3.11";
+ js2.VERSION = "0.3.12";
JS2.ROOT = JS2;
@@ -1580,9 +1580,13 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
this.attributes = {};
this.line = line;
var self = this;
+<<<<<<< HEAD
var splitted = line.match(this.SPLIT_REGEX);
splitted[1].replace(this.TOKEN_REGEX, function(match, type, name){
+=======
+ line = line.replace(this.TOKEN_REGEX, function(match, type, name){
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
switch(type) {
case '%': self.nodeType = name; break;
case '.': self.classes.push(name); break;
@@ -1591,6 +1595,7 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
return '';
});
+<<<<<<< HEAD
if (splitted[2] == '=') {
this.jsEQ = splitted[3];
} else if (splitted[2] == '-') {
@@ -1602,17 +1607,23 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (!this.nodeType && (this.classes.length || this.nodeID)) {
this.nodeType = 'div';
}
- });
+ };
- OO.addMember("flatten",function () {
+ function flatten() {
var out = [];
for(var _i1=0,_c1=this.children,_l1=_c1.length,c;(c=_c1[_i1])||(_i1<_l1);_i1++){
var arr = c.flatten();
for(var _i2=0,_c2=arr,_l2=_c2.length,item;(item=_c2[_i2])||(_i2<_l2);_i2++){
out.push(item);
+=======
+ line = line.replace(this.JS_OUT_REGEX, function(match, type, content){
+ switch(type) {
+ case '=': this.jsEQ = content; break;
+ case '-': this.jsExec = content; break;
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
}
- }
+ };
if (this.nodeType) {
this.handleJsEQ(out);
@@ -1626,32 +1637,33 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
}
return out;
- });
+ }
- OO.addMember("handleJsEQ",function (out) {
+ function handleJsEQ(out) {
if (this.jsEQ) {
this.jsEQ = this.jsEQ.replace(/;\s*$/, '');
out.unshift('out.push(' + this.jsEQ + ');\n');
}
- });
+ }
- OO.addMember("handleContent",function (out) {
+ function handleContent(out) {
if (this.content != null && this.content.length > 0) {
out.unshift('out.push(' + JSON.stringify(this.content) + ');\n');
}
- });
+ }
- OO.addMember("handleJsExec",function (out) {
+ function handleJsExec(out) {
if (this.jsExec) {
out.unshift(this.jsExec);
if (this.jsExec.match(/\{\s*$/)) {
out.push("}\n");
}
}
- });
+ }
+<<<<<<< HEAD
- OO.addMember("getAttributes",function () {
+ function getAttributes() {
if (!this.attributes) return '';
var out = [];
@@ -1667,9 +1679,11 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
}
return (out.length ? ' ' : '') + out.join(' ');
- });
-});
-
+ }
+=======
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
+}
+););
JS2.TEMPLATES = { jsml: JS2.JSML };
(function (undefined, JS2) {
View
2  flavors/browser.js
@@ -19,7 +19,7 @@ function mainFunction (arg) {
var JS2 = root.JS2 = mainFunction;
var js2 = root.js2 = JS2;
- js2.VERSION = "0.3.11";
+ js2.VERSION = "0.3.12";
JS2.ROOT = JS2;
View
2  flavors/js2.gemspec
@@ -1,6 +1,6 @@
spec = Gem::Specification.new do |s|
s.name = 'js2'
- s.version = '0.3.11'
+ s.version = '0.3.12'
s.summary = "Javascript Syntactic Sugar"
s.description = %{A superset of the Javascript language to make development easier.}
s.files = Dir['bin/*'] + Dir['lib/**/*.rb'] + Dir['lib/**/*.js'] + [ 'CHANGELOG' ]
View
44 flavors/node.js
@@ -14,7 +14,7 @@ function mainFunction (arg) {
var JS2 = root.JS2 = mainFunction;
var js2 = root.js2 = JS2;
- js2.VERSION = "0.3.11";
+ js2.VERSION = "0.3.12";
JS2.ROOT = JS2;
@@ -1576,9 +1576,13 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
this.attributes = {};
this.line = line;
var self = this;
+<<<<<<< HEAD
var splitted = line.match(this.SPLIT_REGEX);
splitted[1].replace(this.TOKEN_REGEX, function(match, type, name){
+=======
+ line = line.replace(this.TOKEN_REGEX, function(match, type, name){
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
switch(type) {
case '%': self.nodeType = name; break;
case '.': self.classes.push(name); break;
@@ -1587,6 +1591,7 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
return '';
});
+<<<<<<< HEAD
if (splitted[2] == '=') {
this.jsEQ = splitted[3];
} else if (splitted[2] == '-') {
@@ -1598,17 +1603,23 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (!this.nodeType && (this.classes.length || this.nodeID)) {
this.nodeType = 'div';
}
- });
+ };
- OO.addMember("flatten",function () {
+ function flatten() {
var out = [];
for(var _i1=0,_c1=this.children,_l1=_c1.length,c;(c=_c1[_i1])||(_i1<_l1);_i1++){
var arr = c.flatten();
for(var _i2=0,_c2=arr,_l2=_c2.length,item;(item=_c2[_i2])||(_i2<_l2);_i2++){
out.push(item);
+=======
+ line = line.replace(this.JS_OUT_REGEX, function(match, type, content){
+ switch(type) {
+ case '=': this.jsEQ = content; break;
+ case '-': this.jsExec = content; break;
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
}
- }
+ };
if (this.nodeType) {
this.handleJsEQ(out);
@@ -1622,32 +1633,33 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
}
return out;
- });
+ }
- OO.addMember("handleJsEQ",function (out) {
+ function handleJsEQ(out) {
if (this.jsEQ) {
this.jsEQ = this.jsEQ.replace(/;\s*$/, '');
out.unshift('out.push(' + this.jsEQ + ');\n');
}
- });
+ }
- OO.addMember("handleContent",function (out) {
+ function handleContent(out) {
if (this.content != null && this.content.length > 0) {
out.unshift('out.push(' + JSON.stringify(this.content) + ');\n');
}
- });
+ }
- OO.addMember("handleJsExec",function (out) {
+ function handleJsExec(out) {
if (this.jsExec) {
out.unshift(this.jsExec);
if (this.jsExec.match(/\{\s*$/)) {
out.push("}\n");
}
}
- });
+ }
+<<<<<<< HEAD
- OO.addMember("getAttributes",function () {
+ function getAttributes() {
if (!this.attributes) return '';
var out = [];
@@ -1663,9 +1675,11 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
}
return (out.length ? ' ' : '') + out.join(' ');
- });
-});
-
+ }
+=======
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
+}
+););
JS2.TEMPLATES = { jsml: JS2.JSML };
View
2  flavors/node.package.json
@@ -1,6 +1,6 @@
{ "name" : "js2",
"description" : "Javascript Syntactic Sugar",
- "version" : "0.3.11",
+ "version" : "0.3.12",
"author" : "Jeff Su",
"repository" : { "type" : "git" , "url" : "git://github.com/jeffsu/js2.git" },
"bugs" : { "web" : "http://github.com/jeffsu/js2/issues" },
View
44 flavors/ringo-full.js
@@ -16,7 +16,7 @@ function mainFunction (arg) {
var JS2 = root.JS2 = mainFunction;
var js2 = root.js2 = JS2;
- js2.VERSION = "0.3.11";
+ js2.VERSION = "0.3.12";
JS2.ROOT = JS2;
@@ -1578,9 +1578,13 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
this.attributes = {};
this.line = line;
var self = this;
+<<<<<<< HEAD
var splitted = line.match(this.SPLIT_REGEX);
splitted[1].replace(this.TOKEN_REGEX, function(match, type, name){
+=======
+ line = line.replace(this.TOKEN_REGEX, function(match, type, name){
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
switch(type) {
case '%': self.nodeType = name; break;
case '.': self.classes.push(name); break;
@@ -1589,6 +1593,7 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
return '';
});
+<<<<<<< HEAD
if (splitted[2] == '=') {
this.jsEQ = splitted[3];
} else if (splitted[2] == '-') {
@@ -1600,17 +1605,23 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (!this.nodeType && (this.classes.length || this.nodeID)) {
this.nodeType = 'div';
}
- });
+ };
- OO.addMember("flatten",function () {
+ function flatten() {
var out = [];
for(var _i1=0,_c1=this.children,_l1=_c1.length,c;(c=_c1[_i1])||(_i1<_l1);_i1++){
var arr = c.flatten();
for(var _i2=0,_c2=arr,_l2=_c2.length,item;(item=_c2[_i2])||(_i2<_l2);_i2++){
out.push(item);
+=======
+ line = line.replace(this.JS_OUT_REGEX, function(match, type, content){
+ switch(type) {
+ case '=': this.jsEQ = content; break;
+ case '-': this.jsExec = content; break;
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
}
- }
+ };
if (this.nodeType) {
this.handleJsEQ(out);
@@ -1624,32 +1635,33 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
}
return out;
- });
+ }
- OO.addMember("handleJsEQ",function (out) {
+ function handleJsEQ(out) {
if (this.jsEQ) {
this.jsEQ = this.jsEQ.replace(/;\s*$/, '');
out.unshift('out.push(' + this.jsEQ + ');\n');
}
- });
+ }
- OO.addMember("handleContent",function (out) {
+ function handleContent(out) {
if (this.content != null && this.content.length > 0) {
out.unshift('out.push(' + JSON.stringify(this.content) + ');\n');
}
- });
+ }
- OO.addMember("handleJsExec",function (out) {
+ function handleJsExec(out) {
if (this.jsExec) {
out.unshift(this.jsExec);
if (this.jsExec.match(/\{\s*$/)) {
out.push("}\n");
}
}
- });
+ }
+<<<<<<< HEAD
- OO.addMember("getAttributes",function () {
+ function getAttributes() {
if (!this.attributes) return '';
var out = [];
@@ -1665,9 +1677,11 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
}
return (out.length ? ' ' : '') + out.join(' ');
- });
-});
-
+ }
+=======
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
+}
+););
JS2.TEMPLATES = { jsml: JS2.JSML };
View
2  flavors/ringo.js
@@ -18,7 +18,7 @@ function mainFunction (arg) {
var JS2 = root.JS2 = mainFunction;
var js2 = root.js2 = JS2;
js2.ROOT = JS2;
- js2.VERSION = "0.3.11";
+ js2.VERSION = "0.3.12";
// CLASS HELPERS
View
2  flavors/ringo.package.json
@@ -1,6 +1,6 @@
{
"name": "js2-ringo",
- "version": "0.3.11",
+ "version": "0.3.12",
"description": "Javascript Syntactic Sugar",
"keywords": ["rhino", "ringo", "js2", "object oriented programming" ],
"author": "Jeff Su (http://jeffsu.com/) <me@jeffsu.com>",
View
44 flavors/ruby.js
@@ -14,7 +14,7 @@ function mainFunction (arg) {
var JS2 = root.JS2 = mainFunction;
var js2 = root.js2 = JS2;
- js2.VERSION = "0.3.11";
+ js2.VERSION = "0.3.12";
JS2.ROOT = JS2;
@@ -1576,9 +1576,13 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
this.attributes = {};
this.line = line;
var self = this;
+<<<<<<< HEAD
var splitted = line.match(this.SPLIT_REGEX);
splitted[1].replace(this.TOKEN_REGEX, function(match, type, name){
+=======
+ line = line.replace(this.TOKEN_REGEX, function(match, type, name){
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
switch(type) {
case '%': self.nodeType = name; break;
case '.': self.classes.push(name); break;
@@ -1587,6 +1591,7 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
return '';
});
+<<<<<<< HEAD
if (splitted[2] == '=') {
this.jsEQ = splitted[3];
} else if (splitted[2] == '-') {
@@ -1598,17 +1603,23 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (!this.nodeType && (this.classes.length || this.nodeID)) {
this.nodeType = 'div';
}
- });
+ };
- OO.addMember("flatten",function () {
+ function flatten() {
var out = [];
for(var _i1=0,_c1=this.children,_l1=_c1.length,c;(c=_c1[_i1])||(_i1<_l1);_i1++){
var arr = c.flatten();
for(var _i2=0,_c2=arr,_l2=_c2.length,item;(item=_c2[_i2])||(_i2<_l2);_i2++){
out.push(item);
+=======
+ line = line.replace(this.JS_OUT_REGEX, function(match, type, content){
+ switch(type) {
+ case '=': this.jsEQ = content; break;
+ case '-': this.jsExec = content; break;
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
}
- }
+ };
if (this.nodeType) {
this.handleJsEQ(out);
@@ -1622,32 +1633,33 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
}
return out;
- });
+ }
- OO.addMember("handleJsEQ",function (out) {
+ function handleJsEQ(out) {
if (this.jsEQ) {
this.jsEQ = this.jsEQ.replace(/;\s*$/, '');
out.unshift('out.push(' + this.jsEQ + ');\n');
}
- });
+ }
- OO.addMember("handleContent",function (out) {
+ function handleContent(out) {
if (this.content != null && this.content.length > 0) {
out.unshift('out.push(' + JSON.stringify(this.content) + ');\n');
}
- });
+ }
- OO.addMember("handleJsExec",function (out) {
+ function handleJsExec(out) {
if (this.jsExec) {
out.unshift(this.jsExec);
if (this.jsExec.match(/\{\s*$/)) {
out.push("}\n");
}
}
- });
+ }
+<<<<<<< HEAD
- OO.addMember("getAttributes",function () {
+ function getAttributes() {
if (!this.attributes) return '';
var out = [];
@@ -1663,9 +1675,11 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
}
return (out.length ? ' ' : '') + out.join(' ');
- });
-});
-
+ }
+=======
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
+}
+););
JS2.TEMPLATES = { jsml: JS2.JSML };
View
14 src/Common/JSML.js2
@@ -89,9 +89,13 @@ class JSMLElement {
this.attributes = {};
this.line = line;
var self = this;
+<<<<<<< HEAD
var splitted = line.match(this.SPLIT_REGEX);
splitted[1].replace(this.TOKEN_REGEX, #(match, type, name) {
+=======
+ line = line.replace(this.TOKEN_REGEX, #(match, type, name){
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
switch(type) {
case '%': self.nodeType = name; break;
case '.': self.classes.push(name); break;
@@ -100,6 +104,7 @@ class JSMLElement {
return '';
});
+<<<<<<< HEAD
if (splitted[2] == '=') {
this.jsEQ = splitted[3];
} else if (splitted[2] == '-') {
@@ -120,6 +125,12 @@ class JSMLElement {
var arr = c.flatten();
foreach (var item in arr) {
out.push(item);
+=======
+ line = line.replace(this.JS_OUT_REGEX, #(match, type, content){
+ switch(type) {
+ case '=': this.jsEQ = content; break;
+ case '-': this.jsExec = content; break;
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
}
}
@@ -159,6 +170,7 @@ class JSMLElement {
}
}
}
+<<<<<<< HEAD
function getAttributes() {
if (!this.attributes) return '';
@@ -177,4 +189,6 @@ class JSMLElement {
return (out.length ? ' ' : '') + out.join(' ');
}
+=======
+>>>>>>> bed239574b501453ee0f22330c71562aff44ce0b
}
Please sign in to comment.
Something went wrong with that request. Please try again.