ripple 0.2.19 → 0.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -77,6 +77,20 @@ function RipplePlugin(config) {
|
|
|
77
77
|
return this.finishNode(node, 'JSXExpressionContainer');
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
jsx_parseBindingExpression() {
|
|
81
|
+
let node = this.startNode();
|
|
82
|
+
this.next();
|
|
83
|
+
|
|
84
|
+
if (this.type === tt.bracketR) {
|
|
85
|
+
this.raise(node.start, 'bindings must only be assigned a non-empty expression');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
node.expression = this.parseExpression();
|
|
89
|
+
|
|
90
|
+
this.expect(tt.bracketR);
|
|
91
|
+
return this.finishNode(node, 'BindingExpression');
|
|
92
|
+
}
|
|
93
|
+
|
|
80
94
|
jsx_parseTupleContainer() {
|
|
81
95
|
var t = this.startNode();
|
|
82
96
|
return (
|
|
@@ -90,6 +104,7 @@ function RipplePlugin(config) {
|
|
|
90
104
|
|
|
91
105
|
jsx_parseAttribute() {
|
|
92
106
|
let node = this.startNode();
|
|
107
|
+
|
|
93
108
|
if (this.eat(tt.braceL)) {
|
|
94
109
|
if (this.type.label === '@') {
|
|
95
110
|
this.next();
|
|
@@ -129,6 +144,9 @@ function RipplePlugin(config) {
|
|
|
129
144
|
const tok = this.acornTypeScript.tokTypes;
|
|
130
145
|
|
|
131
146
|
switch (this.type) {
|
|
147
|
+
case tt.bracketL:
|
|
148
|
+
var t = this.jsx_parseBindingExpression();
|
|
149
|
+
return t;
|
|
132
150
|
case tt.braceL:
|
|
133
151
|
var t = this.jsx_parseExpressionContainer();
|
|
134
152
|
return (
|
|
@@ -179,6 +197,20 @@ function RipplePlugin(config) {
|
|
|
179
197
|
return this.finishNode(node, 'TryStatement');
|
|
180
198
|
}
|
|
181
199
|
|
|
200
|
+
// updateContext(e) {
|
|
201
|
+
// const s = this.type;
|
|
202
|
+
// const context = this.curContext();
|
|
203
|
+
// const tokContexts = this.acornTypeScript.tokContexts;
|
|
204
|
+
|
|
205
|
+
// if (s == tt.bracketL && context == tokContexts.tc_oTag) {
|
|
206
|
+
// this.context.push(tc.b_expr);
|
|
207
|
+
// } else if (s == tt.bracketR && context == tc.b_expr) {
|
|
208
|
+
// this.context.pop();
|
|
209
|
+
// }
|
|
210
|
+
|
|
211
|
+
// return super.updateContext(e);
|
|
212
|
+
// }
|
|
213
|
+
|
|
182
214
|
jsx_readToken() {
|
|
183
215
|
let out = '',
|
|
184
216
|
chunkStart = this.pos;
|