diff --git a/src/parser3.h b/src/parser3.h index ee202c9..c8699ce 100644 --- a/src/parser3.h +++ b/src/parser3.h @@ -16,6 +16,11 @@ namespace parser3 { +// See https://gist.github.com/pervognsen/218ea17743e1442e59bb60d29b1aa725 for +// an explanation of this cycle/byte dfa implementation. +// +// Recognizes json number syntax. As a regex: +// -?([0-9]|[1-9][0-9]*)(\.[0-9]+)?((e|E)(-|\+)?[0-9]+)? struct NumDfa { constexpr static uint64_t num_dfa_table[256] = { 0x0ull, @@ -326,6 +331,8 @@ private: uint64_t state = 6; }; +// Recognizes sequences of valid utf8 characters except 0-0x20, double quote, +// and backslash struct Utf8Dfa { constexpr static uint64_t num_dfa_table[256] = { 0x0ull,