| 10304 | } |
| 10305 | |
| 10306 | function encodeHex(character) { |
| 10307 | var string, handle, length; |
| 10308 | |
| 10309 | string = character.toString(16).toUpperCase(); |
| 10310 | |
| 10311 | if (character <= 0xFF) { |
| 10312 | handle = 'x'; |
| 10313 | length = 2; |
| 10314 | } else if (character <= 0xFFFF) { |
| 10315 | handle = 'u'; |
| 10316 | length = 4; |
| 10317 | } else if (character <= 0xFFFFFFFF) { |
| 10318 | handle = 'U'; |
| 10319 | length = 8; |
| 10320 | } else { |
| 10321 | throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); |
| 10322 | } |
| 10323 | |
| 10324 | return '\\' + handle + common.repeat('0', length - string.length) + string; |
| 10325 | } |
| 10326 | |
| 10327 | function State(options) { |
| 10328 | this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; |