Skip to content

Commit

Permalink
more consistent variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Apr 4, 2019
1 parent 6bddb8e commit b15297b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions packages/moon/dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@
if (charNext === "/") {
// Append a closing tag token if a sequence of characters begins
// with "</".
var indexClose = input.indexOf(">", i + 2);
var closeIndex = input.indexOf(">", i + 2);

var _type = input.slice(i + 2, indexClose);
var _type = input.slice(i + 2, closeIndex);

tokens.push({
type: "tagClose",
value: _type
});
i = indexClose + 1;
i = closeIndex + 1;
continue;
} else if (charNext === "!" && input[i + 2] === "-" && input[i + 3] === "-") {
// Ignore input if a sequence of characters begins with "<!--".
Expand All @@ -158,7 +158,7 @@
var typeMatch = typeExec[0];
var type = typeExec[1];
var attributesText = typeExec[2];
var closingSlash = typeExec[3];
var closeSlash = typeExec[3];
var attributes = {};
var attributeExec = void 0; // Keep matching for new attribute key/value pairs until there are no
// more in the attribute text.
Expand Down Expand Up @@ -189,7 +189,7 @@
type: "tagOpen",
value: type,
attributes: attributes,
closed: closingSlash === "/"
closed: closeSlash === "/"
});
i += typeMatch.length;
} else if (_char === "{") {
Expand Down
10 changes: 5 additions & 5 deletions packages/moon/src/compiler/lexer/lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ export function lex(input) {
// Append a closing tag token if a sequence of characters begins
// with "</".

const indexClose = input.indexOf(">", i + 2);
const type = input.slice(i + 2, indexClose);
const closeIndex = input.indexOf(">", i + 2);
const type = input.slice(i + 2, closeIndex);

tokens.push({
type: "tagClose",
value: type
});

i = indexClose + 1;
i = closeIndex + 1;
continue;
} else if (
charNext === "!" &&
Expand All @@ -116,7 +116,7 @@ export function lex(input) {
const typeMatch = typeExec[0];
const type = typeExec[1];
const attributesText = typeExec[2];
const closingSlash = typeExec[3];
const closeSlash = typeExec[3];
const attributes = {};
let attributeExec;

Expand Down Expand Up @@ -154,7 +154,7 @@ export function lex(input) {
type: "tagOpen",
value: type,
attributes,
closed: closingSlash === "/"
closed: closeSlash === "/"
});

i += typeMatch.length;
Expand Down

0 comments on commit b15297b

Please sign in to comment.