Add comments to dfa's
This commit is contained in:
@@ -16,6 +16,11 @@
|
|||||||
|
|
||||||
namespace parser3 {
|
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 {
|
struct NumDfa {
|
||||||
constexpr static uint64_t num_dfa_table[256] = {
|
constexpr static uint64_t num_dfa_table[256] = {
|
||||||
0x0ull,
|
0x0ull,
|
||||||
@@ -326,6 +331,8 @@ private:
|
|||||||
uint64_t state = 6;
|
uint64_t state = 6;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Recognizes sequences of valid utf8 characters except 0-0x20, double quote,
|
||||||
|
// and backslash
|
||||||
struct Utf8Dfa {
|
struct Utf8Dfa {
|
||||||
constexpr static uint64_t num_dfa_table[256] = {
|
constexpr static uint64_t num_dfa_table[256] = {
|
||||||
0x0ull,
|
0x0ull,
|
||||||
|
|||||||
Reference in New Issue
Block a user