Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch '0.2.0'

Conflicts:
	lib/xjst/compiler.js
  • Loading branch information...
commit 49f4f044f9ecac085147b4498c4785d735bced04 2 parents ef96b7a + 5a45494
@indutny indutny authored
View
1  .travis.yml
@@ -1,4 +1,3 @@
language: node_js
node_js:
- - 0.4
- 0.6
View
1  lib/xjst.js
@@ -9,6 +9,7 @@ xjst.ometa = require('./xjst/ometa/xjst');
// XXX this is temporary fix to make API compatible
xjst.XJSTParser = xjst.ometa.XJSTParser;
+xjst.XJSTIdentity = xjst.ometa.XJSTIdentity;
xjst.XJSTTranslator = xjst.ometa.XJSTTranslator;
xjst.XJSTCompiler = xjst.ometa.XJSTCompiler;
View
21 lib/xjst/ometa/xjst.ometajs
@@ -35,14 +35,14 @@ ometa XJSTParser <: BSJSParser {
applyFactory =
// Handle super apply(...)
[:type #super anything*:rest]
- applyFactory([type].concat(rest[0])):sub -> [
+ applyFactory([type].concat(rest[0] || [])):sub -> [
type === #stmt ? #superStmt : #superExpr,
sub
]
// Handle applyNext
| [:type #next anything*:rest]
- applyNextFlag():flag applyFactory([type].concat(rest[0])):sub
+ applyNextFlag():flag applyFactory([type].concat(rest[0] || [])):sub
{ [#local, flag, sub] }:local
(?(type === #stmt) localStmt(local) | localExpr(local)):r -> r
@@ -91,12 +91,25 @@ ometa XJSTParser <: BSJSParser {
)+:ts spaces end -> ts
}
-ometa XJSTTranslator <: BSJSIdentity {
-
+ometa XJSTIdentity <: BSJSIdentity {
const = [#string :s] | [#number :n],
extends :filename -> [#extends, filename],
+ superStmt :op -> [#superStmt, op],
+ superExpr :op -> [#superExpr, op],
+
+ nhApplyStmt :p -> [#nhApplyStmt, p],
+ nhApplyExpr -> [#nhApplyExpr],
+ applyStmt :p -> [#applyStmt, p],
+
+ localStmt trans:as trans:t -> [#localStmt, as, t],
+ localExpr trans:as trans:t -> [#localExpr, as, t],
+
+ template trans:m trans:b -> [#template, m, b]
+}
+
+ometa XJSTTranslator <: XJSTIdentity {
superStmt :op localStmt([
#json,
[#binding, '__d' + this.id, [#get, true]]
View
4 package.json
@@ -1,7 +1,7 @@
{
"name": "xjst",
"description": "XSLT inspired JavaScript templates (with spices)",
- "version": "0.2.33",
+ "version": "0.3.0",
"homepage": "http://github.com/veged/xjst",
"author": "Sergey Berezhnoy <veged@mail.ru> (http://github.com/veged)",
"contributors": [
@@ -20,7 +20,7 @@
},
"dependencies": {
"coa": "0.3.1",
- "ometajs": "~ 3.0.13",
+ "ometajs": "~ 3.1.3",
"q": "0.7.x",
"uglify-js": "1.2.x"
},
Please sign in to comment.
Something went wrong with that request. Please try again.