Create types.nim

This commit is contained in:
witer33 2020-11-02 19:02:50 +01:00 committed by GitHub
parent 5bc23a4776
commit 4e3e4a5324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

22
src/types.nim Normal file
View File

@ -0,0 +1,22 @@
import strtabs
type TokenType* {.pure.} = enum TagOpener, TagCloser, Text
type Token* = ref object
name*: string
case kind*: TokenType
of TagOpener:
args*: StringTableRef
self_closing*: bool
of Text:
content*: string
else:
discard
type Tag* = ref object of RootObj
name*: string
args*: StringTableRef
level*: int
texts*: seq[string]
no_closer*: bool
index*: int