| Copyright | (C) 2016-2026 David M. Johnson |
|---|---|
| License | BSD3-style (see the file LICENSE) |
| Maintainer | David M. Johnson <code@dmj.io> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Miso.JSON.Lexer
Description
Overview
Miso.JSON.Lexer is the first stage of miso's pure Haskell JSON pipeline,
which is used for server-side rendering (SSR). It tokenises a
MisoString into a stream of Token values consumed by
Miso.JSON.Parser.
This module is internal. Application code should use Miso.JSON or
Miso.JSON.Parser (decodePure) instead.
This module was ported from https://github.com/dmjio/json-test by @ners.
Token types
dataToken=TokenPunctuatorChar -- one of[ ] { } , :|TokenNumberDouble -- JSON number (integer or floating-point) |TokenBoolBool --trueorfalse|TokenStringMisoString-- quoted string with escape sequences |TokenNull--null
String tokens handle all
RFC 8259 escape sequences
including \uXXXX and UTF-16 surrogate pairs (\uD800\uDC00).
See also
- Miso.JSON.Parser — consumes
Tokenstreams produced here - Miso.JSON.Types —
Valueproduced by the parser - Miso.Util.Lexer — the underlying
Lexercombinator library
Documentation
Constructors
| TokenPunctuator Char | |
| TokenNumber Double | |
| TokenBool Bool | |
| TokenString MisoString | |
| TokenNull |