| Class | UnionStationHooks::SimpleJSON::JSON |
| In: |
src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/simple_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|\/\/.*?\n|\/\*.*?\*\/)+/m |
| 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] |