This project is a simple JSON parser written in Go.
- Tokenizes basic JSON structures including objects, arrays, strings, and numbers.
- Handles whitespace and special characters.
- Provides a simple API for tokenizing strings.
To use the lexer, create a new instance with the input string and call the NextToken
method to retrieve the next token.
lexer := NewLexer(input)
token := lexer.NextToken()
- Parse Numbers in Keys, e.x.
{"key1": 1, "key2": 2, "3", 3, "a123": true}
- REPL
- Basic Read-Eval-Print-Loop
- Support move cursor: right, left, up, down
- Support delete character, backspace
- support clear command, Ctrl+L or
clear
- Support delete line, Ctrl+U
- support history, up, down
- Escape characters in strings
-
\"
quotation mark -
\\
backslash -
\/
solidus -
\b
backspace -
\f
form feed -
\n
line feed -
\r
carriage return -
\t
horizontal tab -
\uXXXX
Unicode character
-
- Support full-fledged number notation
-
[+-][0-9]+[.][0-9]+[eE][+-][0-9]+ (e.g. -123.456e+789)
-
- Support comments
- Parser
- Support Unicode characters