Skip to content

Commit f1f0820

Browse files
committed
update yaml
Signed-off-by: George Lemon <georgelemon@protonmail.com>
1 parent 033908b commit f1f0820

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/openparser/yaml.nim

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,20 @@ type
7171
OpenParserYamlError* = object of CatchableError
7272
## Exception type for errors encountered during YAML parsing or dumping
7373

74-
proc newYamlLexer*(input: string): YamlLexer =
75-
## Create a new YamlLexer for the given input string
76-
YamlLexer(input: input, len: input.len, line: 1, col: 1)
77-
78-
proc charAt(l: YamlLexer, idx: int): char {.inline.} =
79-
if idx < 0 or idx >= l.len: return '\0'
80-
else: return l.input[idx]
81-
8274
const
8375
invalidToken = "Invalid token `$1`"
8476
errorEndOfFile = "Unexpected EOF while parsing `$1`"
8577
unexpectedToken = "Unexpected token `$1`"
8678
unexpectedTokenExpected = "Got `$1`, expected $2"
8779
unexpectedChar = "Unexpected character `$1`"
8880

81+
proc newYamlLexer*(input: string): YamlLexer =
82+
## Create a new YamlLexer for the given input string
83+
YamlLexer(input: input, len: input.len, line: 1, col: 1)
84+
85+
proc charAt(l: YamlLexer, idx: int): char {.inline.} =
86+
if idx < 0 or idx >= l.len: return '\0'
87+
else: return l.input[idx]
8988

9089
proc getContext(l: YamlLexer, posOverride: int = -1): string =
9190
# Show the full current line and place caret at exact token position.

0 commit comments

Comments
 (0)