diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-09-10 19:38:25 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-09-10 19:38:25 +0200 |
commit | 3521bff39c39ffc35c6b0cb65cac51591d51c8b9 (patch) | |
tree | 8d37fe112505ce13bdc74bf6e923d498969b8575 /parser/parser.go | |
parent | 5cf8e6e4ea355dbbdfaca5998088704a43e0ceab (diff) |
Rework some of the formatting- and parsing code
Diffstat (limited to 'parser/parser.go')
-rw-r--r-- | parser/parser.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/parser/parser.go b/parser/parser.go index 1101e65..946cc97 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -16,9 +16,10 @@ const ( Normal Tagless Text - XmlDocType ) +var Xml = false + type Attr struct { Key string Value string @@ -62,10 +63,11 @@ func (reader *reader) parseDocType() (AstNode, error, bool) { } switch r { + case '?': + Xml = true + fallthrough case '!': doctype.Type = DocType - case '?': - doctype.Type = XmlDocType default: return AstNode{}, reader.unreadRune(), false } @@ -262,9 +264,7 @@ loop: switch r { case '{': break loop - case '.': - fallthrough - case '#': + case '.', '#': sym := r // Skip ‘sym’ |