| ESCAPE_SEQ |
= |
{ "\x00" => '\\0', "\x07" => '\\a', "\x08" => '\\b', "\x0b" => '\\v', "\x0c" => '\\f', "\x1b" => '\\e', "\"" => '\\"', "\\" => '\\\\', } |
|
non-break characters
|
| ESCAPE_SEQ_WS |
= |
{ "\x09" => '\\t', " " => '\\x20', } |
|
white spaces
|
| ESCAPE_SEQ_LB |
= |
{ "\x0a" => '\\n', "\x0d" => '\\r', UCS_0X85 => '\\N', UCS_0X2028 => '\\L', UCS_0X2029 => '\\P', } |
|
line breaks
|
| REX_CRLF |
= |
Regexp.escape("\x0d\x0a") |
| REX_LS |
= |
Regexp.escape(UCS_0X2028) |
| REX_PS |
= |
Regexp.escape(UCS_0X2029) |
| REX_ANY_LB |
= |
/(#{REX_LF}|#{REX_CR}|#{REX_NEL}|#{REX_LS}|#{REX_PS})/ |
| REX_NORMAL_LB |
= |
/(#{REX_LF}|#{REX_LS}|#{REX_PS})/ |
| REX_BOOL |
= |
/ y|Y|yes|Yes|YES|n|N|no|No|NO |true|True|TRUE|false|False|FALSE |on|On|ON|off|Off|OFF /x |
|
regexps for language-Independent types for YAML1.1
|
| REX_FLOAT |
= |
/ [-+]?([0-9][0-9_]*)?\.[0-9.]*([eE][-+][0-9]+)? # (base 10) |[-+]?[0-9][0-9_]*(:[0-5]?[0-9])+\.[0-9_]* # (base 60) |[-+]?\.(inf|Inf|INF) # (infinity) |\.(nan|NaN|NAN) # (not a number) /x |
| REX_INT |
= |
/ [-+]?0b[0-1_]+ # (base 2) |[-+]?0[0-7_]+ # (base 8) |[-+]?(0|[1-9][0-9_]*) # (base 10) |[-+]?0x[0-9a-fA-F_]+ # (base 16) |[-+]?[1-9][0-9_]*(:[0-5]?[0-9])+ # (base 60) /x |
| REX_NULL |
= |
/ ~ # (canonical) |null|Null|NULL # (English) | # (Empty) /x |
| REX_TIMESTAMP |
= |
/ [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] # (ymd) |[0-9][0-9][0-9][0-9] # (year) -[0-9][0-9]? # (month) -[0-9][0-9]? # (day) ([Tt]|[ \t]+)[0-9][0-9]? # (hour) :[0-9][0-9] # (minute) :[0-9][0-9] # (second) (\.[0-9]*)? # (fraction) (([ \t]*)Z|[-+][0-9][0-9]?(:[0-9][0-9])?)? # (time zone) /x |