mirror of https://github.com/status-im/NimYAML.git
fastparse refactoring, part II
* Transformed quite some templates to procs * Moved quite some local vars from parse() to YamlParser
This commit is contained in:
parent
10fec5fb1f
commit
78fac63af5
File diff suppressed because it is too large
Load Diff
19
yaml.nim
19
yaml.nim
|
@ -144,6 +144,14 @@ type
|
|||
## ``1.2``.
|
||||
## - If there is an unknown directive encountered.
|
||||
|
||||
FastParseLevelKind = enum
|
||||
fplUnknown, fplSequence, fplMapKey, fplMapValue, fplSinglePairKey,
|
||||
fplSinglePairValue, fplScalar, fplDocument
|
||||
|
||||
FastParseLevel = object
|
||||
kind: FastParseLevelKind
|
||||
indentation: int
|
||||
|
||||
YamlParser* = ref object
|
||||
## A parser object. Retains its ``TagLibrary`` across calls to
|
||||
## `parse <#parse,YamlParser,Stream>`_. Can be used
|
||||
|
@ -151,10 +159,19 @@ type
|
|||
## only until the document goes out of scope (i.e. until
|
||||
## ``yamlEndDocument`` is yielded).
|
||||
tagLib: TagLibrary
|
||||
anchors: OrderedTable[string, AnchorId]
|
||||
callback: WarningCallback
|
||||
lexer: BaseLexer
|
||||
tokenstart: int
|
||||
content, after: string
|
||||
ancestry: seq[FastParseLevel]
|
||||
level: FastParseLevel
|
||||
tagUri: string
|
||||
tag: TagId
|
||||
anchor: AnchorId
|
||||
shorthands: Table[string, string]
|
||||
anchors: Table[string, AnchorId]
|
||||
nextAnchorId: AnchorId
|
||||
newlines: int
|
||||
|
||||
PresentationStyle* = enum
|
||||
## Different styles for YAML character stream output.
|
||||
|
|
Loading…
Reference in New Issue