783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
|
console.error(e);
}
}
}
return bChange;
}
_createErrorFromRegex (sText, sText0, sSugg, nOffset, m, iGroup, sLineId, sRuleId, bUppercase, sMsg, sURL, bShowRuleId, sOption, bContext) {
let nStart = nOffset + m.start[iGroup];
let nEnd = nOffset + m.end[iGroup];
// suggestions
let lSugg = [];
if (sSugg.startsWith("=")) {
sSugg = oEvalFunc[sSugg.slice(1)](sText, m);
lSugg = (sSugg) ? sSugg.split("|") : [];
} else if (sSugg == "_") {
lSugg = [];
} else {
lSugg = sSugg.gl_expand(m).split("|");
}
if (bUppercase && lSugg.length > 0 && m[iGroup].slice(0,1).gl_isUpperCase()) {
lSugg = capitalizeArray(lSugg);
}
// Message
let sMessage = (sMsg.startsWith("=")) ? oEvalFunc[sMsg.slice(1)](sText, m) : sMsg.gl_expand(m);
if (bShowRuleId) {
sMessage += " #" + sLineId + " / " + sRuleId;
}
//
|
|
|
|
|
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
|
console.error(e);
}
}
}
return bChange;
}
_createErrorFromRegex (sText, sText0, sSugg, nOffset, m, iGroup, sLineId, sRuleId, bCaseSvty, sMsg, sURL, bShowRuleId, sOption, bContext) {
let nStart = nOffset + m.start[iGroup];
let nEnd = nOffset + m.end[iGroup];
// suggestions
let lSugg = [];
if (sSugg.startsWith("=")) {
sSugg = oEvalFunc[sSugg.slice(1)](sText, m);
lSugg = (sSugg) ? sSugg.split("|") : [];
} else if (sSugg == "_") {
lSugg = [];
} else {
lSugg = sSugg.gl_expand(m).split("|");
}
if (bCaseSvty && lSugg.length > 0 && m[iGroup].slice(0,1).gl_isUpperCase()) {
lSugg = (m[iGroup].gl_isUpperCase()) ? lSugg.map((s) => s.toUpperCase()) : capitalizeArray(lSugg);
}
// Message
let sMessage = (sMsg.startsWith("=")) ? oEvalFunc[sMsg.slice(1)](sText, m) : sMsg.gl_expand(m);
if (bShowRuleId) {
sMessage += " #" + sLineId + " / " + sRuleId;
}
//
|
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
|
lSugg = (sSugg) ? sSugg.split("|") : [];
} else if (sSugg == "_") {
lSugg = [];
} else {
lSugg = this._expand(sSugg, nTokenOffset, nLastToken).split("|");
}
if (bCaseSvty && lSugg.length > 0 && this.lToken[iFirstToken]["sValue"].slice(0,1).gl_isUpperCase()) {
lSugg = capitalizeArray(lSugg);
}
// Message
let sMessage = (sMsg.startsWith("=")) ? oEvalFunc[sMsg.slice(1)](this.lToken, nTokenOffset, nLastToken) : this._expand(sMsg, nTokenOffset, nLastToken);
if (bShowRuleId) {
sMessage += " #" + sLineId + " / " + sRuleId;
}
//
|
|
|
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
|
lSugg = (sSugg) ? sSugg.split("|") : [];
} else if (sSugg == "_") {
lSugg = [];
} else {
lSugg = this._expand(sSugg, nTokenOffset, nLastToken).split("|");
}
if (bCaseSvty && lSugg.length > 0 && this.lToken[iFirstToken]["sValue"].slice(0,1).gl_isUpperCase()) {
lSugg = (this.lToken[iFirstToken]["sValue"].gl_isUpperCase()) ? lSugg.map((s) => s.toUpperCase()) : capitalizeArray(lSugg);
}
// Message
let sMessage = (sMsg.startsWith("=")) ? oEvalFunc[sMsg.slice(1)](this.lToken, nTokenOffset, nLastToken) : this._expand(sMsg, nTokenOffset, nLastToken);
if (bShowRuleId) {
sMessage += " #" + sLineId + " / " + sRuleId;
}
//
|