diff --git a/src/lib/spar_bytecode_heatmap.js b/src/lib/spar_bytecode_heatmap.js index 996b206..8afdc7c 100644 --- a/src/lib/spar_bytecode_heatmap.js +++ b/src/lib/spar_bytecode_heatmap.js @@ -25,7 +25,7 @@ var opcodesWeight = Object.freeze({ "MOV": 0.3, // MOV is most common opcode, it should give much weight but sometimes you need to organize it properly "NOT": 1, // Unary opcodes "UNM": 1, - "LEN": 2, // Lenght might get expensive on tables + "LEN": 2, // Length might get expensive on tables "ADDVN": 1, // Arithmetics with literal + var is fine "SUBVN": 1, "MULVN": 1, @@ -49,7 +49,7 @@ var opcodesWeight = Object.freeze({ "KNUM": 1, "KPRI": 1, "KNIL": 1, - "UGET": 3, // Getting upvalue. The complexity is unkown because we don't know how far is the original local is, so we count as getting 3 locals. + "UGET": 3, // Getting upvalue. The complexity is unknown because we don't know how far is the original local is, so we count as getting 3 locals. "USETV": 3.5, // Little expensive for the cost of getting value from the stack "USETS": 3, // These are fine "USETN": 3, diff --git a/src/signatureProvider.js b/src/signatureProvider.js index 93af2ca..145743e 100644 --- a/src/signatureProvider.js +++ b/src/signatureProvider.js @@ -94,19 +94,19 @@ class SignatureProvider { let cursor = line.text.substr(0, pos.character); let tokenized = new Tokenizer(cursor); - if (tokenized.invalidLua || tokenized.openParanthesis.length === 0) return; + if (tokenized.invalidLua || tokenized.openParenthesis.length === 0) return; - let func = tokenized.openParanthesis[tokenized.openParanthesis.length-1]; + let func = tokenized.openParenthesis[tokenized.openParenthesis.length-1]; if (func == false) return; let activeCallbackParameter; let callback = false; - if (tokenized.openParanthesis.length > 1) { + if (tokenized.openParenthesis.length > 1) { // Detect a callback function if (func[0] === "function") { callback = true; activeCallbackParameter = func.length - 1; - func = tokenized.openParanthesis[tokenized.openParanthesis.length-2]; + func = tokenized.openParenthesis[tokenized.openParenthesis.length-2]; } } diff --git a/src/tokenizer.js b/src/tokenizer.js index b171569..62fcf0a 100644 --- a/src/tokenizer.js +++ b/src/tokenizer.js @@ -29,7 +29,7 @@ class Tokenizer { this.openMultilineString = false; this.openEscape = false; - this.openParanthesis = []; + this.openParenthesis = []; this.openShortFuncCall = false; // e.g. AddCSLuaFile "whatever.lua" this.history = { @@ -48,12 +48,12 @@ class Tokenizer { functionCallOpen(i) { let func = [this.token]; this.history.functionCallsOpen[func] = i - this.token.length - 1; - this.openParanthesis.push(func); + this.openParenthesis.push(func); this.token = ""; } functionCallClose(i) { - let func = this.openParanthesis.pop(); + let func = this.openParenthesis.pop(); this.history.functionCallsClosed.push([func, this.history.functionCallsOpen[func], i + 1]); delete this.history.functionCallsOpen[func]; this.token = ""; @@ -83,7 +83,7 @@ class Tokenizer { this.openString = false; this.token += "\""; if (this.openShortFuncCall) { - this.openParanthesis.pop(); + this.openParenthesis.pop(); this.token = ""; } this.openShortFuncCall = false; @@ -189,12 +189,12 @@ class Tokenizer { break; } } else { - this.openParanthesis.push(false); + this.openParenthesis.push(false); } break; case ")": - if (this.openParanthesis !== false) { + if (this.openParenthesis !== false) { this.functionCallClose(i); break; } else { @@ -207,8 +207,8 @@ class Tokenizer { this.invalidLua = true; break tokenize; } - if (this.openParanthesis.length > 0) { - let func = this.openParanthesis[this.openParanthesis.length-1]; + if (this.openParenthesis.length > 0) { + let func = this.openParenthesis[this.openParenthesis.length-1]; if (func === false) { this.invalidLua = true; break tokenize; diff --git a/src/wikiProvider.js b/src/wikiProvider.js index 4449be2..eeed670 100644 --- a/src/wikiProvider.js +++ b/src/wikiProvider.js @@ -85,7 +85,7 @@ class WikiProvider { } stripCodeFormatting(str) { - return str.replace(/```[\s\S]+?```/g, "_< ommitted code block >_").replace(/^[\t\r ]*/gm, ""); + return str.replace(/```[\s\S]+?```/g, "_< omitted code block >_").replace(/^[\t\r ]*/gm, ""); } markdownURL(url) {