Skip to content

Comments parse errors #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tokenizer/domjs.test
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@
"description":"--!NUL in comment ",
"doubleEscaped":true,
"input":"<!----!\\u0000-->",
"output":["ParseError", "ParseError", ["Comment", "--!\\uFFFD"]]
"output":["ParseError", "ParseError", ["Comment", "--!\\uFFFD"]],
"errors":[
{ "code": "unexpected-null-character", "line": 1, "col": 8 }
]
},
{
"description":"space EOF after doctype ",
Expand Down
5 changes: 4 additions & 1 deletion tokenizer/escapeFlag.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"initialStates":["RCDATA state", "RAWTEXT state"],
"lastStartTag":"xmp",
"input":"foo<!--></xmp><!-->baz</xmp>",
"output":[["Character", "foo<!-->"], ["EndTag", "xmp"], "ParseError", ["Comment", ""], ["Character", "baz"], ["EndTag", "xmp"]]},
"output":[["Character", "foo<!-->"], ["EndTag", "xmp"], "ParseError", ["Comment", ""], ["Character", "baz"], ["EndTag", "xmp"]],
"errors":[
{ "code": "abrupt-comment", "line": 1, "col": 19 }
]},

{"description":"Commented entities in RCDATA",
"initialStates":["RCDATA state"],
Expand Down
6 changes: 4 additions & 2 deletions tokenizer/pendingSpecChanges.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

{"description":"<!---- >",
"input":"<!---- >",
"output":["ParseError", "ParseError", ["Comment","-- >"]]}

"output":["ParseError", "ParseError", ["Comment","-- >"]],
"errors":[
{ "code": "eof-in-comment", "line": 1, "col": 9 }
]}
]}
26 changes: 21 additions & 5 deletions tokenizer/test1.test
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@

{"description":"Unfinished comment",
"input":"<!--comment",
"output":["ParseError", ["Comment", "comment"]]},
"output":["ParseError", ["Comment", "comment"]],
"errors":[
{ "code": "eof-in-comment", "line": 1, "col": 12 }
]},

{"description":"Start of a comment",
"input":"<!-",
Expand All @@ -104,17 +107,30 @@
]},

{"description":"Short comment",
"input":"<!-->",
"output":["ParseError", ["Comment", ""]]},
"input":"<!-->",
"output":["ParseError", ["Comment", ""]],
"errors":[
{ "code": "abrupt-comment", "line": 1, "col": 5 }
]},


{"description":"Short comment two",
"input":"<!--->",
"output":["ParseError", ["Comment", ""]]},
"input":"<!--->",
"output":["ParseError", ["Comment", ""]],
"errors":[
{ "code": "abrupt-comment", "line": 1, "col": 6 }
]},

{"description":"Short comment three",
"input":"<!---->",
"output":[["Comment", ""]]},

{"description":"Nested comment",
"input":"<!-- <!--test-->",
"output":[["Comment", " <!--test"]],
"errors":[
{ "code": "nested-comment", "line": 1, "col": 10 }
]},

{"description":"Ampersand EOF",
"input":"&",
Expand Down
5 changes: 4 additions & 1 deletion tokenizer/test2.test
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@

{"description":"Comment with dash",
"input":"<!---x",
"output":["ParseError", ["Comment", "-x"]]},
"output":["ParseError", ["Comment", "-x"]],
"errors":[
{ "code": "eof-in-comment", "line": 1, "col": 7 }
]},

{"description":"Entity + newline",
"input":"\nx\n&gt;\n",
Expand Down
Loading