1
1
mirror of https://github.com/github/semantic.git synced 2024-11-25 11:04:00 +03:00

Leaf terms capture their text.

This commit is contained in:
Rob Rix 2015-10-21 16:53:47 -04:00
parent cc7030701e
commit 699e6ee30d

View File

@ -60,6 +60,9 @@
function Term(json, source) {
this.range = json.extract;
this.syntax = syntax(json.unwrap, function(x) { return new Term(x, source); });
if (this.syntax instanceof Leaf) {
this.textContent = source.substr(this.range[0], this.range[1] - this.range[0]);
}
return this;
}