-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the TreeConstructor module
WIP: The implementation of this module is in progress.
- Loading branch information
Showing
4 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
enum InsertionMode { | ||
case initial | ||
case beforeHTML | ||
case beforeHead | ||
case inHead | ||
case inHeadNoscript | ||
case afterHead | ||
case inBody | ||
case text | ||
case inTable | ||
case inTableText | ||
case inCaption | ||
case inColumnGroup | ||
case inTableBody | ||
case inRow | ||
case inCell | ||
case inSelect | ||
case inSelectInTable | ||
case inTemplate | ||
case afterBody | ||
case inFrameset | ||
case afterFrameset | ||
case afterAfterBody | ||
case afterAfterFrameset | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Tokenizer | ||
|
||
public struct TreeConstructor { | ||
private var mode: InsertionMode | ||
|
||
public init() { | ||
self.mode = .initial | ||
} | ||
} | ||
|
||
extension TreeConstructor: TokenSink { | ||
mutating func process(_ token: consuming Token) { | ||
// TODO: Implement here | ||
} | ||
} |