-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ref: https://yaml.org/spec/1.2/spec.html#schema/core/ - `null_scalar` - `boolean_scalar` - `integer_scalar` - `float_scalar` - `string_scalar`
- Loading branch information
Showing
14 changed files
with
27,614 additions
and
23,355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,354 @@ | ||
================================================================================ | ||
Example 10.4. !!null Examples | ||
================================================================================ | ||
!!null null: value for null key | ||
key with null value: !!null null | ||
|
||
-------------------------------------------------------------------------------- | ||
|
||
(stream | ||
(document | ||
(block_node | ||
(block_mapping | ||
(block_mapping_pair | ||
key: (flow_node | ||
(tag) | ||
(plain_scalar | ||
(null_scalar))) | ||
value: (flow_node | ||
(plain_scalar | ||
(string_scalar)))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(tag) | ||
(plain_scalar | ||
(null_scalar)))))))) | ||
|
||
================================================================================ | ||
Example 10.5. !!bool Examples | ||
================================================================================ | ||
YAML is a superset of JSON: !!bool true | ||
Pluto is a planet: !!bool false | ||
|
||
-------------------------------------------------------------------------------- | ||
|
||
(stream | ||
(document | ||
(block_node | ||
(block_mapping | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(tag) | ||
(plain_scalar | ||
(boolean_scalar)))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(tag) | ||
(plain_scalar | ||
(boolean_scalar)))))))) | ||
|
||
================================================================================ | ||
Example 10.6. !!int Examples | ||
================================================================================ | ||
negative: !!int -12 | ||
zero: !!int 0 | ||
positive: !!int 34 | ||
|
||
-------------------------------------------------------------------------------- | ||
|
||
(stream | ||
(document | ||
(block_node | ||
(block_mapping | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(tag) | ||
(plain_scalar | ||
(integer_scalar)))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(tag) | ||
(plain_scalar | ||
(integer_scalar)))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(tag) | ||
(plain_scalar | ||
(integer_scalar)))))))) | ||
|
||
================================================================================ | ||
Example 10.7. !!float Examples | ||
================================================================================ | ||
negative: !!float -1 | ||
zero: !!float 0 | ||
positive: !!float 2.3e4 | ||
infinity: !!float .inf | ||
not a number: !!float .nan | ||
|
||
-------------------------------------------------------------------------------- | ||
|
||
(stream | ||
(document | ||
(block_node | ||
(block_mapping | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(tag) | ||
(plain_scalar | ||
(integer_scalar)))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(tag) | ||
(plain_scalar | ||
(integer_scalar)))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(tag) | ||
(plain_scalar | ||
(float_scalar)))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(tag) | ||
(plain_scalar | ||
(float_scalar)))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(tag) | ||
(plain_scalar | ||
(float_scalar)))))))) | ||
|
||
================================================================================ | ||
Example 10.8. JSON Tag Resolution | ||
================================================================================ | ||
A null: null | ||
Booleans: [ true, false ] | ||
Integers: [ 0, -0, 3, -19 ] | ||
Floats: [ 0., -0.0, 12e03, -2E+05 ] | ||
Invalid: [ True, Null, 0o7, 0x3A, +12.3 ] | ||
|
||
-------------------------------------------------------------------------------- | ||
|
||
(stream | ||
(document | ||
(block_node | ||
(block_mapping | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(plain_scalar | ||
(null_scalar)))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(flow_sequence | ||
(flow_node | ||
(plain_scalar | ||
(boolean_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(boolean_scalar)))))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(flow_sequence | ||
(flow_node | ||
(plain_scalar | ||
(integer_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(integer_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(integer_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(integer_scalar)))))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(flow_sequence | ||
(flow_node | ||
(plain_scalar | ||
(float_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(float_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(float_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(float_scalar)))))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(flow_sequence | ||
(flow_node | ||
(plain_scalar | ||
(boolean_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(null_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(integer_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(integer_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(float_scalar)))))))))) | ||
|
||
================================================================================ | ||
Example 10.9. Core Tag Resolution | ||
================================================================================ | ||
A null: null | ||
Also a null: # Empty | ||
Not a null: "" | ||
Booleans: [ true, True, false, FALSE ] | ||
Integers: [ 0, 0o7, 0x3A, -19 ] | ||
Floats: [ 0., -0.0, .5, +12e03, -2E+05 ] | ||
Also floats: [ .inf, -.Inf, +.INF, .NAN ] | ||
|
||
-------------------------------------------------------------------------------- | ||
|
||
(stream | ||
(document | ||
(block_node | ||
(block_mapping | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(plain_scalar | ||
(null_scalar)))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar)))) | ||
(comment) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(double_quote_scalar))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(flow_sequence | ||
(flow_node | ||
(plain_scalar | ||
(boolean_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(boolean_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(boolean_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(boolean_scalar)))))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(flow_sequence | ||
(flow_node | ||
(plain_scalar | ||
(integer_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(integer_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(integer_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(integer_scalar)))))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(flow_sequence | ||
(flow_node | ||
(plain_scalar | ||
(float_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(float_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(float_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(float_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(float_scalar)))))) | ||
(block_mapping_pair | ||
key: (flow_node | ||
(plain_scalar | ||
(string_scalar))) | ||
value: (flow_node | ||
(flow_sequence | ||
(flow_node | ||
(plain_scalar | ||
(float_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(float_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(float_scalar))) | ||
(flow_node | ||
(plain_scalar | ||
(float_scalar)))))))))) |
Oops, something went wrong.