Skip to content

Commit

Permalink
Merge pull request #12 from ambassify/feature/tree-printability
Browse files Browse the repository at this point in the history
[operators] add more operators
  • Loading branch information
JorgenEvens authored Feb 13, 2019
2 parents 8c0f245 + 92f82c6 commit 011afa4
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ class Token {
Object.assign(this, options);
this.type_id = type;
this.type = NAMES[type];
this.parent = undefined;
this.source = undefined;
this.children = [];

this.start = start;
Expand All @@ -98,6 +96,22 @@ class Token {
this.closing = undefined; // Used by TAG_CONTROL to indicate a closing tag
this.value = undefined; // Used to store parsed values of expressions.
this.expr = undefined; // Used to hold the specific expressions on EXPRESSION node.

Object.defineProperty(this, 'source', {
value: undefined,
enumerable: false,
writable: true
});

Object.defineProperty(this, 'parent', {
value: undefined,
enumerable: false,
writable: true
});
}

get match() {
return this.source.substr(this.start, this.end - this.start + 1);
}

is(type) {
Expand Down

0 comments on commit 011afa4

Please sign in to comment.