1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Assign the source and range to syntax nodes.

This commit is contained in:
Rob Rix 2015-10-21 17:15:25 -04:00
parent fe274fc595
commit c9e08610eb

View File

@ -58,7 +58,8 @@
function Term(json, source) {
this.range = json.extract;
this.syntax = syntax(json.unwrap, function(x) { return new Term(x, source); });
this.textContent = source.substr(this.range[0], this.range[1]);
this.syntax.source = source.substr(this.range[0], this.range[1]);
this.syntax.range = this.range;
return this;
}