Files
turso/core/json/json_path.pest
Kacper Madej 74e19e2148 Optimization
2025-01-09 17:16:58 +07:00

11 lines
465 B
Plaintext

negative_index_indicator = ${ "#-" }
array_offset = ${ ASCII_DIGIT+ }
array_locator = ${ "[" ~ negative_index_indicator? ~ array_offset ~ "]" }
relaxed_array_locator = ${ negative_index_indicator? ~ array_offset }
root = ${ "$" }
json_path_key = ${ identifier | string }
path = ${ SOI ~ root ~ (array_locator | "." ~ json_path_key)* ~ EOI }
relaxed_path = ${ SOI ~ ((root ~ (array_locator | "." ~ json_path_key)*) | json_path_key | relaxed_array_locator) ~ EOI }