spyc.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. #
  2. # S P Y C
  3. # a simple php yaml class
  4. #
  5. # authors: [vlad andersen (vlad.andersen@gmail.com), chris wanstrath (chris@ozmm.org)]
  6. # websites: [http://www.yaml.org, http://spyc.sourceforge.net/]
  7. # license: [MIT License, http://www.opensource.org/licenses/mit-license.php]
  8. # copyright: (c) 2005-2006 Chris Wanstrath, 2006-2014 Vlad Andersen
  9. #
  10. # spyc.yaml - A file containing the YAML that Spyc understands.
  11. ---
  12. # Mappings - with proper types
  13. String: Anyone's name, really.
  14. Int: 13
  15. BadHex: f0xf3
  16. Hex: 0xf3
  17. True: true
  18. False: false
  19. Zero: 0
  20. Null: NULL
  21. NotNull: 'null'
  22. NotTrue: 'y'
  23. NotBoolTrue: 'true'
  24. NotInt: '5'
  25. Float: 5.34
  26. Negative: -90
  27. SmallFloat: 0.7
  28. NewLine: \n
  29. QuotedNewLine: "\n"
  30. # A sequence
  31. - PHP Class
  32. - Basic YAML Loader
  33. - Very Basic YAML Dumper
  34. # A sequence of a sequence
  35. -
  36. - YAML is so easy to learn.
  37. - Your config files will never be the same.
  38. # Sequence of mappings
  39. -
  40. cpu: 1.5ghz
  41. ram: 1 gig
  42. os : os x 10.4.1
  43. # Mapped sequence
  44. domains:
  45. - yaml.org
  46. - php.net
  47. # A sequence like this.
  48. - program: Adium
  49. platform: OS X
  50. type: Chat Client
  51. # A folded block as a mapped value
  52. no time: >
  53. There isn't any time
  54. for your tricks!
  55. Do you understand?
  56. # A literal block as a mapped value
  57. some time: |
  58. There is nothing but time
  59. for your tricks.
  60. # Crazy combinations
  61. databases:
  62. - name: spartan
  63. notes:
  64. - Needs to be backed up
  65. - Needs to be normalized
  66. type: mysql
  67. # You can be a bit tricky
  68. "if: you'd": like
  69. # Inline sequences
  70. - [One, Two, Three, Four]
  71. # Nested Inline Sequences
  72. - [One, [Two, And, Three], Four, Five]
  73. # Nested Nested Inline Sequences
  74. - [This, [Is, Getting, [Ridiculous, Guys]], Seriously, [Show, Mercy]]
  75. # Inline mappings
  76. - {name: chris, age: young, brand: lucky strike}
  77. # Nested inline mappings
  78. - {name: mark, age: older than chris, brand: [marlboro, lucky strike]}
  79. # References -- they're shaky, but functional
  80. dynamic languages: &DLANGS
  81. - Perl
  82. - Python
  83. - PHP
  84. - Ruby
  85. compiled languages: &CLANGS
  86. - C/C++
  87. - Java
  88. all languages:
  89. - *DLANGS
  90. - *CLANGS
  91. # Added in .2.2: Escaped quotes
  92. - you know, this shouldn't work. but it does.
  93. - 'that''s my value.'
  94. - 'again, that\'s my value.'
  95. - "here's to \"quotes\", boss."
  96. # added in .2.3
  97. - {name: "Foo, Bar's", age: 20}
  98. # Added in .2.4: bug [ 1418193 ] Quote Values in Nested Arrays
  99. - [a, ['1', "2"], b]
  100. # Add in .5.2: Quoted new line values.
  101. - "First line\nSecond line\nThird line"
  102. # Added in .2.4: malformed YAML
  103. all
  104. javascripts: [dom1.js, dom.js]
  105. # Added in .2
  106. 1040: Ooo, a numeric key! # And working comments? Wow! Colons in comments: a menace (0.3).
  107. hash_1: Hash #and a comment
  108. hash_2: "Hash #and a comment"
  109. "hash#3": "Hash (#) can appear in key too"
  110. float_test: 1.0
  111. float_test_with_quotes: '1.0'
  112. float_inverse_test: 001
  113. a_really_large_number: 115792089237316195423570985008687907853269984665640564039457584007913129639936 # 2^256
  114. int array: [ 1, 2, 3 ]
  115. array on several lines:
  116. [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
  117. 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ]
  118. morelesskey: "<value>"
  119. array_of_zero: [0]
  120. sophisticated_array_of_zero: {rx: {tx: [0]} }
  121. switches:
  122. - { row: 0, col: 0, func: {tx: [0, 1]} }
  123. empty_sequence: [ ]
  124. empty_hash: { }
  125. special_characters: "[{]]{{]]"
  126. asterisks: "*"
  127. empty_key:
  128. :
  129. key: value
  130. trailing_colon: "foo:"
  131. multiline_items:
  132. - type: SomeItem
  133. values: [blah, blah, blah,
  134. blah]
  135. ints: [2, 54, 12,
  136. 2143]
  137. many_lines: |
  138. A quick
  139. fox
  140. jumped
  141. over
  142. a lazy
  143. dog
  144. werte:
  145. 1: nummer 1
  146. 0: Stunde 0
  147. noindent_records:
  148. - record1: value1
  149. - record2: value2
  150. "a:1": [1000]
  151. "a:2":
  152. - 2000
  153. a:3: [3000]
  154. complex_unquoted_key:
  155. a:b:''test': value
  156. array with commas:
  157. ["0","1"]
  158. invoice: ["Something", "", '', "Something else"]
  159. quotes: ['Something', "Nothing", 'Anything', "Thing"]
  160. # [Endloop]
  161. endloop: |
  162. Does this line in the end indeed make Spyc go to an infinite loop?