Skip to content

0xsirsaif/TinyJson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tiny JSON Parser

This project is a simple JSON parser written in Go.

Features

  • Tokenizes basic JSON structures including objects, arrays, strings, and numbers.
  • Handles whitespace and special characters.
  • Provides a simple API for tokenizing strings.

Usage

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()

TODO

  • 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

About

Coding Challenge - Tiny JSON Parser in GO

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages