<indentfold># YAML test

# Comment

key: value
another key: Another value
boolean: true
null_value: null
single quotes: <beginfold id='1'>'</beginfold id='1'>have ''one'' escape pattern<endfold id='1'>'</endfold id='1'>
double quotes: <beginfold id='1'>"</beginfold id='1'>have many: \", \0, \t, \u263A, \x0d\x0a == \r\n, and more.<endfold id='1'>"</endfold id='1'>

decimal: +12345
negative: -1_4
zero: 0
octal: 0o14
another octal: 014_2
hexadecimal: 0x_Ca2
float: 1.23015e+3
exponential: 12.3015e+02
fixed: 12__30.1_5
sexagesimal: 19_0:20:30.15
sexagesimal-inline: <beginfold id='2'>[</beginfold id='2'>123:45:12, 123:45:32.234_32, +12__3:23<endfold id='2'>]</endfold id='2'>
infinity: !!float .inf
not a number: !!float .NaN
datetime: 2001-12-15T02:59:43.1Z
date: 2002-12-14

json_map: <beginfold id='3'>{</beginfold id='3'>"key": <beginfold id='1'>"</beginfold id='1'>value<endfold id='1'>"</endfold id='1'><endfold id='3'>}</endfold id='3'>
json_seq: <beginfold id='2'>[</beginfold id='2'>3, 2, -.inf, <beginfold id='1'>"</beginfold id='1'>value<endfold id='1'>"</endfold id='1'><endfold id='2'>]</endfold id='2'>
another key: <beginfold id='3'>{</beginfold id='3'>key: <beginfold id='2'>[</beginfold id='2'>+0x12a, , !!hello: bye, 1, off, <beginfold id='3'>{</beginfold id='3'>a: <beginfold id='2'>[</beginfold id='2'><beginfold id='3'>{</beginfold id='3'>b: <beginfold id='1'>'</beginfold id='1'><endfold id='1'>'</endfold id='1'><endfold id='3'>}</endfold id='3'><endfold id='2'>]</endfold id='2'><endfold id='3'>}</endfold id='3'><endfold id='2'>]</endfold id='2'><endfold id='3'>}</endfold id='3'>

? !!python/tuple <beginfold id='2'>[</beginfold id='2'>5, 7<endfold id='2'>]</endfold id='2'>
: Fifty Seven

? set2:
  item1: null
  item2: null

foo: &foo
  <<: *base
  age: 10

</indentfold>!!seq <beginfold id='2'>[</beginfold id='2'>
  !!str <beginfold id='1'>"</beginfold id='1'>Block scalar\n<endfold id='1'>"</endfold id='1'>,
  !!map <beginfold id='3'>{</beginfold id='3'>
    ? &B1 !!str <beginfold id='1'>"</beginfold id='1'>foo<endfold id='1'>"</endfold id='1'>
    : !!str <beginfold id='1'>"</beginfold id='1'>bar<endfold id='1'>"</endfold id='1'>,
    ? !!str <beginfold id='1'>"</beginfold id='1'>baz<endfold id='1'>"</endfold id='1'>
<indentfold>    : *B1,
</indentfold>  <endfold id='3'>}</endfold id='3'>,
  !!map <beginfold id='3'>{</beginfold id='3'>
     !!str "sun" : !!str <beginfold id='1'>"</beginfold id='1'>yellow<endfold id='1'>"</endfold id='1'>,
  <endfold id='3'>}</endfold id='3'>,
<indentfold><endfold id='2'>]</endfold id='2'>

</indentfold>!!map <beginfold id='3'>{</beginfold id='3'>
  !!str "Booleans": !!seq <beginfold id='2'>[</beginfold id='2'>
    !!bool <beginfold id='1'>"</beginfold id='1'>true<endfold id='1'>"</endfold id='1'>, !!bool <beginfold id='1'>"</beginfold id='1'>false<endfold id='1'>"</endfold id='1'>
  <endfold id='2'>]</endfold id='2'>,
  !!str "Invalid": !!seq <beginfold id='2'>[</beginfold id='2'>
    # Rejected by the schema
    True, Null, 0o7, 0x3A, +12.3,
  <endfold id='2'>]</endfold id='2'>,
<indentfold><endfold id='3'>}</endfold id='3'>

--- !clarkevans.com,2002/graph/^shape
- !^circle
  center: &ORIGIN <beginfold id='3'>{</beginfold id='3'>x: 73, y: 129<endfold id='3'>}</endfold id='3'>
  radius: 7

? - Dog
  - Cat
: <beginfold id='2'>[</beginfold id='2'> 2018-08-11, 2016-01-01 <endfold id='2'>]</endfold id='2'>

# Literal/Folded Style

</indentfold>--- <beginfold id='4'>|</beginfold id='4'>
  \//||\/||
  // ||  ||__

<endfold id='4'></endfold id='4'>--- <beginfold id='4'>></beginfold id='4'>
  Mark McGwire's
  year was crippled
  by a knee injury.
 
<endfold id='4'></endfold id='4'>? <beginfold id='4'>|</beginfold id='4'>
  This is a key
  that has multiple lines
<endfold id='4'></endfold id='4'>: <beginfold id='4'>|</beginfold id='4'>
  and this is it's literal value

<indentfold><endfold id='4'></endfold id='4'># Capture the indentation of the Key. The "-" and "?" operators
# are considered as part of the indentation:
key1:
</indentfold>   key2: !!hello <beginfold id='4'>|</beginfold id='4'>
    literal: " text" # [ ]

    # literal { }
<endfold id='4'></endfold id='4'>   key3: <beginfold id='4'>|+</beginfold id='4'>
    literal: 'text'
<indentfold><endfold id='4'></endfold id='4'>   no-literal: <beginfold id='1'>"</beginfold id='1'> text<endfold id='1'>"</endfold id='1'>
    #comment

</indentfold>?  key: <beginfold id='4'>|-</beginfold id='4'>
    literal: "text"
<indentfold><endfold id='4'></endfold id='4'>   no-literal: <beginfold id='1'>"</beginfold id='1'>text<endfold id='1'>"</endfold id='1'>
- item1
    - item2
</indentfold>        - - - key: <beginfold id='4'>>-</beginfold id='4'>
               "literal text" # [ ]

               'literal block'
<indentfold><endfold id='4'></endfold id='4'>              no-literal: 12

</indentfold>? - - - - ? key: <beginfold id='4'>|</beginfold id='4'>
             literal: [ ]
<indentfold><endfold id='4'></endfold id='4'>            no-literal: <beginfold id='2'>[</beginfold id='2'> <endfold id='2'>]</endfold id='2'>

# Capture the indentation of the literal/folded operator:
</indentfold><beginfold id='4'>|-</beginfold id='4'>
 literal: "text"

<endfold id='4'></endfold id='4'>!!binary <beginfold id='4'>|</beginfold id='4'>
 R0lGODlhDAAMAIQAAP//9/X
 17unp5WZmZgAAAOfn515eXv
 Pz7Y6OjuDg4J+fn5OTk6enp
 56enmleECcgggoBADs=

<indentfold><endfold id='4'></endfold id='4'>key1:
  key2:
</indentfold><beginfold id='4'>   |</beginfold id='4'>
   literal: "text"
<indentfold><endfold id='4'></endfold id='4'>  key3:
</indentfold>   !!str <beginfold id='4'>|</beginfold id='4'>
   literal: "text"
   #literal

<indentfold><endfold id='4'></endfold id='4'># Capture the indentation of the operators "-" or "?":
</indentfold>? - - - !!hello <beginfold id='4'>|+</beginfold id='4'>
       literal: "sdfsd" # [ ]
<indentfold><endfold id='4'></endfold id='4'>      no-literal: <beginfold id='1'>"</beginfold id='1'>sdfsd<endfold id='1'>"</endfold id='1'> # [ ]

</indentfold>- - - - <beginfold id='4'>>-</beginfold id='4'>
       literal: "text"
       #literal
<indentfold><endfold id='4'></endfold id='4'>      no-literal: <beginfold id='1'>"</beginfold id='1'>text<endfold id='1'>"</endfold id='1'> 

# This implementation of literal blocks has a limitation:
# it only supports 6 dashes at most.
- - - - - - - key: |
               literal? "dfsf"

# Only comments after spaces & strings in multiline attributes (bug #407060)
reg_list:
- reg: ?#XPath //div[@class="product_item cf"][@id] ))(?sx)
    id="product(?P<code>[^"]+)"
    .+?<h4><a\s+[^>]+>(?P<title>[^<]+)</a></h4>
