Skip to content

Commit

Permalink
chore: fix alerts from lgtm.com
Browse files Browse the repository at this point in the history
  • Loading branch information
mnater committed Apr 21, 2019
1 parent e347488 commit 293ac04
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
9 changes: 4 additions & 5 deletions Hyphenopoly.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@
const zeroWidthSpace = String.fromCharCode(8203);
let parts = null;
let wordHyphenator = null;
let hw = word;
if (classSettings.compound === "auto" ||
classSettings.compound === "all") {
wordHyphenator = createWordHyphenator(lo, lang, sel);
Expand All @@ -398,14 +397,14 @@
return p;
});
if (classSettings.compound === "auto") {
hw = parts.join("-");
word = parts.join("-");
} else {
hw = parts.join("-" + zeroWidthSpace);
word = parts.join("-" + zeroWidthSpace);
}
} else {
hw = word.replace("-", "-" + zeroWidthSpace);
word = word.replace("-", "-" + zeroWidthSpace);
}
return hw;
return word;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions hyphenEngine.asm.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ function asmHyphenEngine(std, x, heap) {
(((charOffset | 0) >= (lm | 0)) | 0) &
(((charOffset | 0) <= ((wordLength - rm - 2) | 0)) | 0)
) {
if (ui8[(hp + charOffset + 1) | 0] & 1 == 1) {
if (ui8[(hp + charOffset + 1) | 0] & 1) {
ui16[(hw + (charOffset << 1) + hyphenPointsCount + 2) >> 1] = 173;
hyphenPointsCount = (hyphenPointsCount + 2) | 0
hyphenPointsCount = (hyphenPointsCount + 2) | 0;
}
}
charOffset = (charOffset + 1) | 0;
Expand Down
9 changes: 4 additions & 5 deletions hyphenopoly.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@ function createWordHyphenator(lo, lang) {
const zeroWidthSpace = String.fromCharCode(8203);
let parts = null;
let wordHyphenator = null;
let hw = word;
if (H.c.compound === "auto" ||
H.c.compound === "all") {
wordHyphenator = createWordHyphenator(lo, lang);
Expand All @@ -585,14 +584,14 @@ function createWordHyphenator(lo, lang) {
return p;
});
if (H.c.compound === "auto") {
hw = parts.join("-");
word = parts.join("-");
} else {
hw = parts.join("-" + zeroWidthSpace);
word = parts.join("-" + zeroWidthSpace);
}
} else {
hw = word.replace("-", "-" + zeroWidthSpace);
word = word.replace("-", "-" + zeroWidthSpace);
}
return hw;
return word;
}

/**
Expand Down
5 changes: 3 additions & 2 deletions tools/tex2hpb.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ function getPatternsFile() {
logger.log(`read patterns file: ${patternsFileName} (${fs.statSync(patternsFileName).size} Bytes)`);
let patternsfile = fs.readFileSync("./" + patternsFileName, "utf8");
patternsfile = patternsfile.trim();
// eslint-disable-next-line prefer-named-capture-group
patternsfile = patternsfile.replace(/(\d{2})\n/, function repl(ignore, p1) {
const digits = p1.split("");
leftmin = parseInt(digits[0], 10);
Expand Down Expand Up @@ -639,7 +640,7 @@ function TrieCreator(patterns, trieRowLength) {
}
}

terminateTrie(patterns[i]);
terminateTrie();
// Reset indizes
count = 0;
rowStart = 0;
Expand Down Expand Up @@ -669,7 +670,7 @@ function main() {
const patternsfile = getPatternsFile();
const exceptionsfile = getExceptionsFile();

const translate = createTranslate(charactersfile, patternsfile);
const translate = createTranslate(charactersfile);
const patterns = createPatterns(translate, patternsfile, exceptionsfile);
const dummyTrie = new TrieCreator(patterns, translate[0] * 2);
const header = createHeader(
Expand Down

0 comments on commit 293ac04

Please sign in to comment.