add support for docs in source types

This commit is contained in:
Dave Holoway
2020-06-24 23:28:35 +01:00
parent e7e73387aa
commit b45314cc95
4 changed files with 74 additions and 39 deletions

View File

@@ -16,6 +16,7 @@ class TokenList {
/** @type {ParseProblem[]} */
this.problems = [];
this.marks = [];
this.last_mlc = '';
}
/**
@@ -33,8 +34,22 @@ class TokenList {
if (!this.current || this.current.kind !== 'wsc') {
return this.current;
}
const wsc = this.current.value;
if (wsc.startsWith('/*')) {
this.last_mlc = wsc;
}
}
}
clearMLC() {
this.last_mlc = '';
}
getLastMLC() {
const s = this.last_mlc;
this.last_mlc = '';
return s;
}
mark() {
this.marks.unshift(this.idx);