Last active
August 14, 2025 07:54
-
-
Save sirreal/806e5afdac1094164cff0037a6e175ab to your computer and use it in GitHub Desktop.
HTML Script data tokenization diagrams
This file contains hidden or 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
| // Credit: Dennis Snell (@dmsnell) | |
| digraph G { | |
| rankdir=TB; | |
| nodesep=0.5; | |
| ranksep=0.8; | |
| fontname="sans-serif"; | |
| // Entry point | |
| entry [shape=plaintext label="Open script"]; | |
| entry -> script_data; | |
| // Double-circle states arranged more compactly | |
| data [shape=doublecircle label="Close script" fontname="sans-serif"]; | |
| script_data [shape=doublecircle color=blue label="script\ndata" fontname="sans-serif"]; | |
| script_data_escaped [shape=circle color=orange label="escaped" fontname="sans-serif"]; | |
| script_data_double_escaped [shape=circle color=red label="double\nescaped" fontname="sans-serif"]; | |
| // Group related nodes on same ranks where possible | |
| {rank=same; script_data script_data_escaped script_data_double_escaped} | |
| script_data -> script_data [label="<!--…>\n(all dashes)" labelloc=b tailport=nw headport=sw fontname="monospace"]; | |
| script_data -> script_data_escaped [label="<!--" fontname="monospace"]; | |
| script_data -> data [label=<</script<FONT COLOR="blue">✦</FONT>> fontname="monospace"]; | |
| script_data_escaped -> script_data [label="-->" fontname="monospace"]; | |
| script_data_escaped -> script_data_double_escaped [label=<<script<FONT COLOR="BLUE">✦</FONT> > fontname="monospace"]; | |
| script_data_escaped -> data [label=<</script<FONT COLOR="blue">✦</FONT>> fontname="monospace"]; | |
| script_data_double_escaped -> script_data [xlabel="-->" fontname="monospace"]; | |
| script_data_double_escaped -> script_data_escaped [label=<</script<FONT COLOR="blue">✦</FONT>> fontname="monospace"]; | |
| label=<<FONT COLOR="BLUE">✦</FONT> = SP, HT, FF, CR, NL, /, >>; | |
| labelloc=b; | |
| labeljust=r; | |
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment