sfComments.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. --- %YAML:1.0
  2. test: Comments at the end of a line
  3. brief: >
  4. Comments at the end of a line
  5. yaml: |
  6. ex1: "foo # bar"
  7. ex2: "foo # bar" # comment
  8. ex3: 'foo # bar' # comment
  9. ex4: foo # comment
  10. ex5: foo # comment with tab before
  11. ex6: foo#foo # comment here
  12. ex7: foo # ignore me # and me
  13. php: |
  14. ['ex1' => 'foo # bar', 'ex2' => 'foo # bar', 'ex3' => 'foo # bar', 'ex4' => 'foo', 'ex5' => 'foo', 'ex6' => 'foo#foo', 'ex7' => 'foo']
  15. ---
  16. test: Comments in the middle
  17. brief: >
  18. Comments in the middle
  19. yaml: |
  20. foo:
  21. # some comment
  22. # some comment
  23. bar: foo
  24. # some comment
  25. # some comment
  26. php: |
  27. ['foo' => ['bar' => 'foo']]
  28. ---
  29. test: Comments on a hash line
  30. brief: >
  31. Comments on a hash line
  32. yaml: |
  33. foo: # a comment
  34. foo: bar # a comment
  35. php: |
  36. ['foo' => ['foo' => 'bar']]
  37. ---
  38. test: 'Value starting with a #'
  39. brief: >
  40. 'Value starting with a #'
  41. yaml: |
  42. foo: '#bar'
  43. php: |
  44. ['foo' => '#bar']
  45. ---
  46. test: Document starting with a comment and a separator
  47. brief: >
  48. Commenting before document start is allowed
  49. yaml: |
  50. # document comment
  51. ---
  52. foo: bar # a comment
  53. php: |
  54. ['foo' => 'bar']
  55. ---
  56. test: Comment containing a colon on a hash line
  57. brief: >
  58. Comment containing a colon on a scalar line
  59. yaml: 'foo # comment: this is also part of the comment'
  60. php: |
  61. 'foo'
  62. ---
  63. test: 'Hash key containing a #'
  64. brief: >
  65. 'Hash key containing a #'
  66. yaml: 'foo#bar: baz'
  67. php: |
  68. ['foo#bar' => 'baz']
  69. ---
  70. test: 'Hash key ending with a space and a #'
  71. brief: >
  72. 'Hash key ending with a space and a #'
  73. yaml: |
  74. 'foo #': baz
  75. php: |
  76. ['foo #' => 'baz']