Skip to content

Commit

Permalink
fix: address some todos
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Oct 12, 2021
1 parent 0625668 commit 4f42a07
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 16 deletions.
6 changes: 1 addition & 5 deletions src/states/ATTRIBUTE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ export const ATTRIBUTE = Parser.createState({
case STATE.EXPRESSION: {
switch (childPart.part) {
case "NAME": {
// TODO: why is this needed?
attr.name = attr.name
? attr.name + childPart.value
: childPart.value;
attr.name = childPart.value;
attr.pos = childPart.pos;
attr.endPos = childPart.endPos;
break;
Expand Down Expand Up @@ -146,7 +143,6 @@ export const ATTRIBUTE = Parser.createState({
this.skip(1);
}

// TODO: make expressions consume beginning whitespace?
this.consumeWhitespace();
this.enterState(STATE.EXPRESSION, {
part: "VALUE",
Expand Down
1 change: 1 addition & 0 deletions src/states/JS_COMMENT_LINE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const JS_COMMENT_LINE = Parser.createState({
char(ch, code, comment) {
// TODO: this really shouldn't be done.
// nothing should end a JS_COMMENT_LINE except a newline
// eg: <script>//foo</script>
if (comment.parentState === STATE.PARSED_TEXT_CONTENT) {
if (!this.isConcise && code === CODE.OPEN_ANGLE_BRACKET) {
// First, see if we need to see if we reached the closing tag
Expand Down
1 change: 0 additions & 1 deletion src/states/OPEN_TAG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ export const OPEN_TAG = Parser.createState({
this.currentOpenTag.shorthandId = childPart.shorthandId;
this.currentOpenTag.shorthandClassNames = childPart.shorthandClassNames;
this.currentOpenTag.tagNameStart = childPart.pos;
// TODO: why both?
this.currentOpenTag.tagNameEnd = this.currentOpenTag.tagNameEndPos = childPart.endPos;


Expand Down
8 changes: 1 addition & 7 deletions src/states/TAG_NAME.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,7 @@ export const TAG_NAME = Parser.createState({

char(ch, code, tagName) {
var nextCh;
if (code === CODE.SINGLE_QUOTE || code === CODE.DOUBLE_QUOTE) {
// TODO: why are we supporting this?
return this.enterState(STATE.STRING, {
quoteChar: ch,
quoteCharCode: code,
});
} else if (
if (
code === CODE.DOLLAR &&
this.lookAtCharCodeAhead(1) === CODE.OPEN_CURLY_BRACE
) {
Expand Down
2 changes: 0 additions & 2 deletions test/autotest/concise-complex-tag-name/expected.html

This file was deleted.

1 change: 0 additions & 1 deletion test/autotest/concise-complex-tag-name/input.htmljs

This file was deleted.

0 comments on commit 4f42a07

Please sign in to comment.