mirror of
https://github.com/github/semantic.git
synced 2024-12-26 16:33:03 +03:00
Leaf terms capture their text.
This commit is contained in:
parent
cc7030701e
commit
699e6ee30d
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user