node.computed = !!computed
if (computed) this.expect(tt.bracketR)
base = this.finishNode(node, "MemberExpression")
+ } else if (this.eat(tt.hash)) { // Nick
+ let node = this.startNodeAt(startPos, startLoc)
+ node.object = base
+ //node.property = this.parseIdent(true)
+ node.property = this.type === tt.string ? this.parseLiteral(this.value) : this.parseIdent(true) // Nick
+ base = this.finishNode(node, "MemberExpressionHash")
} else if (!noCalls && this.eat(tt.parenL)) {
let refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos
this.yieldPos = 0
semi: new TokenType(";", beforeExpr),
colon: new TokenType(":", beforeExpr),
dot: new TokenType("."),
+ hash: new TokenType("#"), // Nick
question: new TokenType("?", beforeExpr),
arrow: new TokenType("=>", beforeExpr),
template: new TokenType("template"),
if (!expr_to_tag(node.right, context, html_allowed, call_allowed))
return false;
}
- else if (node.type === 'MemberExpression') {
+ else if (node.type === 'MemberExpression' && !node.computed) {
if (!expr_to_tag(node.object, context, false, false))
return false;
context.tag[context.tag_type].push(context.name.join('-'))
if (!expr_to_tag(node.property, context, html_allowed, call_allowed))
return false;
}
+ else if (node.type === 'MemberExpressionHash') {
+ if (!expr_to_tag(node.object, context, false, false))
+ return false;
+ context.tag[context.tag_type].push(context.name.join('-'))
+ context.name = []
+ context.tag_type = 2
+ if (!expr_to_tag(node.property, context, html_allowed, call_allowed))
+ return false;
+ }
else if (html_allowed && node.type === 'HTMLExpression') {
if (!expr_to_tag(node.tag, context, false, true))
return false;
if (context.tag[1].length)
prefix += ' class="' + context.tag[1].join(' ') + '"'
+ if (context.tag[2].length)
+ prefix += ' id="' + context.tag[2].join(' ') + '"'
+
let expr = undefined
for (var i = 0; i < context.arguments.length; ++i) {
let argument = context.arguments[i]
node.expression.type === 'MemberExpression' ||
node.expression.type === 'HTMLExpression'
) {
- context = {name: [], tag: [[], []], tag_type: 0, arguments: []}
+ context = {name: [], tag: [[], [], []], tag_type: 0, arguments: []}
if (
expr_to_tag(node.expression, context, true, false) &&
context.body !== undefined
node.type === 'MemberExpression' ||
node.type === 'HTMLExpression'
) {
- context = {name: [], tag: [[], []], tag_type: 0, arguments: []}
+ context = {name: [], tag: [[], [], []], tag_type: 0, arguments: []}
if (
expr_to_tag(node, context, true, false) &&
context.body !== undefined