CoffeeScript-in-CoffeeScript can compile dotted accessors

This commit is contained in:
Jeremy Ashkenas
2010-02-08 23:42:03 -05:00
parent 32098e5a13
commit cb57a1ca1f
4 changed files with 45 additions and 11 deletions

View File

@@ -107,12 +107,12 @@
if (tag === 'IDENTIFIER' && this.value() === '::') {
this.tag(-1, 'PROTOTYPE_ACCESS');
}
if (tag === 'IDENTIFIER' && this.value() === '.' && !(this.value(-2) === '.')) {
if (this.tag(-2) === '?') {
this.tag(-1, 'SOAK_ACCESS');
if (tag === 'IDENTIFIER' && this.value() === '.' && !(this.value(2) === '.')) {
if (this.tag(2) === '?') {
this.tag(1, 'SOAK_ACCESS');
this.tokens.splice(-2, 1);
} else {
this.tag(-1, 'PROPERTY_ACCESS');
this.tag(1, 'PROPERTY_ACCESS');
}
}
this.token(tag, id);