Class | PhusionPassenger::Utils::JSON |
In: |
lib/phusion_passenger/utils/json.rb
|
Parent: | Object |
Usage:
JSON.parse(json_string) => Array/Hash JSON.generate(object) => json string
Run tests by executing this file directly. Pipe standard input to the script to have it parsed as JSON and to display the result in Ruby.
WSP | = | /\s+/ |
OBJ | = | /[{\[]/; |
HEN | = | /\}/; |
AEN | = | /\]/ |
COL | = | /\s*:\s*/; |
KEY | = | /\s*,\s*/ |
NUM | = | /-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/ |
BOL | = | /true|false/; |
NUL | = | /null/ |
SPEC | = | {'b' => "\b", 'f' => "\f", 'n' => "\n", 'r' => "\r", 't' => "\t"} |
UNI | = | 'u'; |
CODE | = | /[a-fA-F0-9]{4}/ |
STR | = | /"/; |
STE | = | '"' |
ESC | = | '\\' |
scanner | -> | s |
scanner | [R] |