nwex.de/html/tokenizer/state.ts
networkException 586546ee57 Everywhere: Rework website concept completely
This patch removes the Next.js React project that was contained
by this repository previously. The replacement is a vanilla HTML
page with TypeScript that parses it's own HTML source and highlights
it using on load.

The concept will be iterated on in following commits, planned are
on hover tooltips showing metadata about HTML tokens as well as
tokenizing (perhaps parsing) of JavaScript and CSS to be able to
highlight those sections as well. To properly determent the range
of script and style sections it might be required to also implement
HTML tree building, however on read execution of JavaScript or
on the fly parsing as well as fragment parsing is not required for
the site.

This commit merely represents a start and is made to better track
the progress of changes.
2021-10-24 22:36:38 +02:00

82 lines
No EOL
4.3 KiB
TypeScript

export const enum State {
Data = 'Data',
RCDATA = 'RCDATA',
RAWTEXT = 'RAWTEXT',
ScriptData = 'Script data',
PLAINTEXT = 'PLAINTEXT',
TagOpen = 'Tag open',
EndTagOpen = 'End tag open',
TagName = 'Tag name',
RCDATALessThanSign = 'RCDATA less-than sign',
RCDATAEndTagOpen = 'RCDATA end tag open',
RCDATAEndTagName = 'RCDATA end tag name',
RAWTEXTLessThan = 'RAWTEXT less-than',
RAWTEXTEndTagOpen = 'RAWTEXT end tag open',
RAWTEXTEndTagName = 'RAWTEXT end tag name',
ScriptDataLessThanSign = 'Script data less-than sign',
ScriptDataEndTagOpen = 'Script data end tag open',
ScriptDataEndTagName = 'Script data end tag name',
ScriptDataEscapeStart = 'Script data escape start',
ScriptDataEscapeStartDash = 'Script data escape start dash',
ScriptDataEscaped = 'Script data escaped',
ScriptDataEscapedDash = 'Script data escaped dash',
ScriptDataEscapedDashDash = 'Script data escaped dash dash',
ScriptDataEscapedLessThanSign = 'Script data escaped less-than sign',
ScriptDataEscapedEndTagOpen = 'Script data escaped end tag open',
ScriptDataEscapedEndTagName = 'Script data escaped end tag name',
ScriptDataDoubleEscapeStart = 'Script data double escape start',
ScriptDataDoubleEscaped = 'Script data double escaped',
ScriptDataDoubleEscapedDash = 'Script data double escaped dash',
ScriptDataDoubleEscapedDashDash = 'Script data double escaped dash dash',
ScriptDataDoubleEscapedLessThanSign = 'Script data double escaped less-than sign',
ScriptDataDoubleEscapedEnd = 'Script data double escape end',
BeforeAttributeName = 'Before attribute name',
AttributeName = 'Attribute name',
AfterAttributeName = 'After attribute name',
BeforeAttributeValue = 'Before attribute value',
AttributeValueDouble = 'Attribute value (double-quoted)',
AttributeValueSingle = 'Attribute value (single-quoted)',
AttributeValueUnquoted = 'Attribute value (unquoted)',
AfterAttributeValue = 'After attribute value (quoted)',
SelfClosingStartTag = 'Self-closing start tag',
BogusComment = 'Bogus comment',
MarkupDeclarationOpen = 'Markup declaration open',
CommentStart = 'Comment start',
CommentStartDash = 'Comment start dash',
Comment = 'Comment',
CommentLessThanSign = 'Comment less-than sign',
CommentLessThanSignBang = 'Comment less-than sign bang',
CommentLessThanSignBangDash= 'Comment less-than sign bang dash',
CommentLessThanSignBangDashDash = 'Comment less-than sign bang dash dash',
CommentEndDash = 'Comment end dash',
CommentEnd = 'Comment end',
CommentEndBang = 'Comment end bang',
DOCTYPE = 'DOCTYPE',
BeforeDOCTYPEName = 'Before DOCTYPE name',
DOCTYPEName = 'DOCTYPE name',
AfterDOCTYPEName= 'After DOCTYPE name',
AfterDOCTYPEPublicKeyword = 'After DOCTYPE public keyword',
BeforeDOCTYPEPublicIdentifier = 'Before DOCTYPE public identifier',
DOCTYPEPublicIdentifierDouble = 'DOCTYPE public identifier (double-quoted)',
DOCTYPEPublicIdentifierSingle = 'DOCTYPE public identifier (single-quoted)',
AfterDOCTYPEPublicIdentifier = 'After DOCTYPE public identifier',
BetweenDOCTYPEPublicAndSystemIdentifiers = 'Between DOCTYPE public and system identifiers',
AfterDOCTYPESystemKeyword = 'After DOCTYPE system keyword',
BeforeDOCTYPESystemIdentifier = 'Before DOCTYPE system identifier',
DOCTYPESystemIdentifierDouble = 'DOCTYPE system identifier (double-quoted)',
DOCTYPESystemIdentifierSingle = 'DOCTYPE system identifier (single-quoted)',
AfterDOCTYPESystemIdentifier = 'After DOCTYPE system identifier',
BogusDOCTYPE = 'Bogus DOCTYPE',
CDATASection = 'CDATA section',
CDATASectionBracket = 'CDATA section bracket',
CDATASectionEnd = 'CDATA section end',
CharacterReference = 'Character reference',
NamedCharacterReference = 'Named character reference',
AmbiguousAmpersand = 'Ambiguous ampersand',
NumericCharacterReference = 'Numeric character reference',
HexadecimalCharacterReferenceStart = 'Hexadecimal character reference start',
DecimalCharacterReferenceStart = 'Decimal character reference start',
HexadecimalCharacterReference = 'Hexadecimal character reference',
DecimalCharacterReference = 'Decimal character reference',
NumericCharacterReferenceEnd = 'Numeric character reference end'
}