mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
LibWeb: Fully implement all comment tokenizer states
This commit is contained in:
parent
3cc0c477db
commit
ab1df177d8
Notes:
sideshowbarker
2024-07-19 05:39:28 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/ab1df177d8f Pull-request: https://github.com/SerenityOS/serenity/pull/2556
1 changed files with 31 additions and 12 deletions
|
@ -172,7 +172,7 @@
|
|||
do { \
|
||||
will_switch_to(State::new_state); \
|
||||
m_state = State::new_state; \
|
||||
EMIT_CHARACTER(codepoint); \
|
||||
EMIT_CHARACTER(codepoint); \
|
||||
} while (0)
|
||||
|
||||
#define SWITCH_TO_AND_EMIT_CURRENT_CHARACTER(new_state) \
|
||||
|
@ -1089,7 +1089,8 @@ _StartOfFunction:
|
|||
}
|
||||
ON('>')
|
||||
{
|
||||
TODO();
|
||||
PARSE_ERROR();
|
||||
SWITCH_TO_AND_EMIT_CURRENT_TOKEN(Data);
|
||||
}
|
||||
ANYTHING_ELSE
|
||||
{
|
||||
|
@ -1106,11 +1107,14 @@ _StartOfFunction:
|
|||
}
|
||||
ON('>')
|
||||
{
|
||||
TODO();
|
||||
PARSE_ERROR();
|
||||
SWITCH_TO_AND_EMIT_CURRENT_TOKEN(Data);
|
||||
}
|
||||
ON_EOF
|
||||
{
|
||||
TODO();
|
||||
PARSE_ERROR();
|
||||
m_queued_tokens.enqueue(m_current_token);
|
||||
EMIT_EOF;
|
||||
}
|
||||
ANYTHING_ELSE
|
||||
{
|
||||
|
@ -1133,11 +1137,15 @@ _StartOfFunction:
|
|||
}
|
||||
ON(0)
|
||||
{
|
||||
TODO();
|
||||
PARSE_ERROR();
|
||||
m_current_token.m_comment_or_character.data.append_codepoint(0xFFFD);
|
||||
continue;
|
||||
}
|
||||
ON_EOF
|
||||
{
|
||||
TODO();
|
||||
PARSE_ERROR();
|
||||
m_queued_tokens.enqueue(m_current_token);
|
||||
EMIT_EOF;
|
||||
}
|
||||
ANYTHING_ELSE
|
||||
{
|
||||
|
@ -1164,7 +1172,9 @@ _StartOfFunction:
|
|||
}
|
||||
ON_EOF
|
||||
{
|
||||
TODO();
|
||||
PARSE_ERROR();
|
||||
m_queued_tokens.enqueue(m_current_token);
|
||||
EMIT_EOF;
|
||||
}
|
||||
ANYTHING_ELSE
|
||||
{
|
||||
|
@ -1183,11 +1193,14 @@ _StartOfFunction:
|
|||
}
|
||||
ON('>')
|
||||
{
|
||||
TODO();
|
||||
PARSE_ERROR();
|
||||
SWITCH_TO_AND_EMIT_CURRENT_TOKEN(Data);
|
||||
}
|
||||
ON_EOF
|
||||
{
|
||||
TODO();
|
||||
PARSE_ERROR();
|
||||
m_queued_tokens.enqueue(m_current_token);
|
||||
EMIT_EOF;
|
||||
}
|
||||
ANYTHING_ELSE
|
||||
{
|
||||
|
@ -1205,7 +1218,9 @@ _StartOfFunction:
|
|||
}
|
||||
ON_EOF
|
||||
{
|
||||
TODO();
|
||||
PARSE_ERROR();
|
||||
m_queued_tokens.enqueue(m_current_token);
|
||||
EMIT_EOF;
|
||||
}
|
||||
ANYTHING_ELSE
|
||||
{
|
||||
|
@ -1255,7 +1270,7 @@ _StartOfFunction:
|
|||
}
|
||||
ANYTHING_ELSE
|
||||
{
|
||||
RECONSUME_IN(Comment);
|
||||
RECONSUME_IN(CommentEndDash);
|
||||
}
|
||||
}
|
||||
END_STATE
|
||||
|
@ -1264,7 +1279,11 @@ _StartOfFunction:
|
|||
{
|
||||
ON('>')
|
||||
{
|
||||
SWITCH_TO(CommentEnd);
|
||||
RECONSUME_IN(CommentEnd);
|
||||
}
|
||||
ON_EOF
|
||||
{
|
||||
RECONSUME_IN(CommentEnd);
|
||||
}
|
||||
ANYTHING_ELSE
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue