diff --git a/README.md b/README.md
index 91db3d0d5..57993b83a 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,7 @@
· GraphQL
· JSON
· Markdown
+ · YAML
·
Your favorite language?
diff --git a/docs/index.md b/docs/index.md
index 29e313bab..d4da467ca 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -13,6 +13,7 @@ Prettier is an opinionated code formatter with support for:
- [JSON](http://json.org/)
- [GraphQL](http://graphql.org/)
- [Markdown](http://commonmark.org/), including [GFM](https://github.github.com/gfm/)
+- [YAML](http://yaml.org/)
It removes all original styling[\*](#footnotes) and ensures that all outputted code conforms to a consistent style. (See this [blog post](http://jlongster.com/A-Prettier-Formatter))
diff --git a/docs/language-support.md b/docs/language-support.md
index 2f6704cde..33f6d1495 100644
--- a/docs/language-support.md
+++ b/docs/language-support.md
@@ -7,6 +7,6 @@ Prettier attempts to support all JavaScript language features, including non-sta
All of JSX and Flow syntax is supported. In fact, the test suite in `tests/flow` _is_ the entire Flow test suite and they all pass.
-Prettier also supports [TypeScript](https://www.typescriptlang.org/), CSS, [Less](http://lesscss.org/), [SCSS](http://sass-lang.com), [Vue](https://vuejs.org/), [JSON](http://json.org/), [GraphQL](http://graphql.org/), and [Markdown](http://commonmark.org).
+Prettier also supports [TypeScript](https://www.typescriptlang.org/), CSS, [Less](http://lesscss.org/), [SCSS](http://sass-lang.com), [Vue](https://vuejs.org/), [JSON](http://json.org/), [GraphQL](http://graphql.org/), [Markdown](http://commonmark.org), and [YAML](http://yaml.org/).
The minimum version of TypeScript supported is 2.1.3 as it introduces the ability to have leading `|` for type definitions which prettier outputs.
diff --git a/package.json b/package.json
index 47d40a21f..425d555a7 100644
--- a/package.json
+++ b/package.json
@@ -57,7 +57,9 @@
"typescript": "3.0.0-dev.20180602",
"typescript-eslint-parser": "16.0.0",
"unicode-regex": "1.0.1",
- "unified": "6.1.6"
+ "unified": "6.1.6",
+ "yaml": "1.0.0-beta.7",
+ "yaml-unist-parser": "1.0.0-beta.4"
},
"devDependencies": {
"@babel/cli": "7.0.0-beta.49",
@@ -80,6 +82,7 @@
"prettylint": "1.0.0",
"rimraf": "2.6.2",
"rollup": "0.47.6",
+ "rollup-plugin-alias": "1.4.0",
"rollup-plugin-babel": "4.0.0-beta.4",
"rollup-plugin-commonjs": "8.2.6",
"rollup-plugin-json": "2.1.1",
diff --git a/scripts/build/babel-plugins/replace-array-includes-with-indexof.js b/scripts/build/babel-plugins/replace-array-includes-with-indexof.js
new file mode 100644
index 000000000..fb8c14330
--- /dev/null
+++ b/scripts/build/babel-plugins/replace-array-includes-with-indexof.js
@@ -0,0 +1,26 @@
+"use strict";
+
+//
+// BEFORE:
+// [__something__].includes(__something__)
+//
+// AFTER:
+// [__something__].indexOf(__something__) !== -1
+//
+
+module.exports = ({ types: t }) => ({
+ visitor: {
+ CallExpression(path) {
+ const node = path.node;
+ const callee = node.callee;
+ if (
+ t.isMemberExpression(callee, { computed: false }) &&
+ t.isArrayExpression(callee.object) &&
+ t.isIdentifier(callee.property, { name: "includes" })
+ ) {
+ callee.property.name = "indexOf";
+ path.replaceWith(t.binaryExpression("!==", node, t.numericLiteral(-1)));
+ }
+ }
+ }
+});
diff --git a/scripts/build/bundler.js b/scripts/build/bundler.js
index ea76580fe..21ac2e71f 100644
--- a/scripts/build/bundler.js
+++ b/scripts/build/bundler.js
@@ -5,6 +5,7 @@ const path = require("path");
const { rollup } = require("rollup");
const webpack = require("webpack");
const resolve = require("rollup-plugin-node-resolve");
+const alias = require("rollup-plugin-alias");
const commonjs = require("rollup-plugin-commonjs");
const nodeGlobals = require("rollup-plugin-node-globals");
const json = require("rollup-plugin-json");
@@ -36,7 +37,7 @@ const EXTERNALS = [
function getBabelConfig(bundle) {
const config = {
babelrc: false,
- plugins: [],
+ plugins: bundle.babelPlugins || [],
compact: bundle.type === "plugin" ? false : "auto"
};
if (bundle.type === "core") {
@@ -108,6 +109,7 @@ function getRollupConfig(bundle) {
replace(replaceStrings),
executable(),
json(),
+ bundle.alias && alias(bundle.alias),
bundle.target === "universal" &&
nativeShims(path.resolve(__dirname, "shims")),
resolve({
diff --git a/scripts/build/config.js b/scripts/build/config.js
index d730e53c0..86db60185 100644
--- a/scripts/build/config.js
+++ b/scripts/build/config.js
@@ -13,6 +13,7 @@ const path = require("path");
* @property {CommonJSConfig} [commonjs={}] - options for `rollup-plugin-commonjs`
* @property {string[]} external - array of paths that should not be included in the final bundle
* @property {Object.} replace - map of strings to replace when processing the bundle
+ * @property {string[]} babelPlugins - babel plugins
* @typedef {Object} CommonJSConfig
* @property {Object} namedExports - for cases where rollup can't infer what's exported
@@ -66,6 +67,18 @@ const parsers = [
{
input: "src/language-html/parser-parse5.js",
target: "node"
+ },
+ {
+ input: "src/language-yaml/parser-yaml.js",
+ target: "universal",
+ alias: {
+ // Force using the CJS file, instead of ESM; i.e. get the file
+ // from `"main"` instead of `"module"` (rollup default) of package.json
+ "lines-and-columns": require.resolve("lines-and-columns")
+ },
+ babelPlugins: [
+ require.resolve("./babel-plugins/replace-array-includes-with-indexof")
+ ]
}
].map(parser => {
const name = getFileOutput(parser)
diff --git a/scripts/build/shims/assert.js b/scripts/build/shims/assert.js
index f035fe341..a6eb7fec3 100644
--- a/scripts/build/shims/assert.js
+++ b/scripts/build/shims/assert.js
@@ -1,4 +1,4 @@
-export default {
- ok() {},
- strictEqual() {}
-};
+function assert() {}
+assert.ok = function() {};
+assert.strictEqual = function() {};
+export default assert;
diff --git a/src/common/internal-plugins.js b/src/common/internal-plugins.js
index 0065583b7..2cd1f9e27 100644
--- a/src/common/internal-plugins.js
+++ b/src/common/internal-plugins.js
@@ -109,5 +109,15 @@ module.exports = [
return $$$r("../language-vue/parser-vue").parsers.vue;
}
}
+ },
+
+ // YAML
+ require("../language-yaml"),
+ {
+ parsers: {
+ get yaml() {
+ return $$$r("../language-yaml/parser-yaml").parsers.yaml;
+ }
+ }
}
];
diff --git a/src/doc/doc-builders.js b/src/doc/doc-builders.js
index 23a90a0c3..08acf1436 100644
--- a/src/doc/doc-builders.js
+++ b/src/doc/doc-builders.js
@@ -50,6 +50,7 @@ function group(contents, opts) {
return {
type: "group",
+ id: opts.id,
contents: contents,
break: !!opts.shouldBreak,
expandedStates: opts.expandedStates
@@ -83,7 +84,9 @@ function fill(parts) {
return { type: "fill", parts };
}
-function ifBreak(breakContents, flatContents) {
+function ifBreak(breakContents, flatContents, opts) {
+ opts = opts || {};
+
if (process.env.NODE_ENV !== "production") {
if (breakContents) {
assertDoc(breakContents);
@@ -93,7 +96,12 @@ function ifBreak(breakContents, flatContents) {
}
}
- return { type: "if-break", breakContents, flatContents };
+ return {
+ type: "if-break",
+ breakContents,
+ flatContents,
+ groupId: opts.groupId
+ };
}
function lineSuffix(contents) {
diff --git a/src/doc/doc-printer.js b/src/doc/doc-printer.js
index 56c3b7f65..cc3ecfe01 100644
--- a/src/doc/doc-printer.js
+++ b/src/doc/doc-printer.js
@@ -3,6 +3,9 @@
const util = require("../common/util");
const { concat, fill, cursor } = require("./doc-builders");
+/** @type {{[groupId: PropertyKey]: MODE}} */
+let groupModeMap;
+
const MODE_BREAK = 1;
const MODE_FLAT = 2;
@@ -150,6 +153,9 @@ function fits(next, restCommands, width, options, mustBeFlat) {
}
cmds.push([ind, doc.break ? MODE_BREAK : mode, doc.contents]);
+ if (doc.id) {
+ groupModeMap[doc.id] = cmds[cmds.length - 1][1];
+ }
break;
case "fill":
for (let i = doc.parts.length - 1; i >= 0; i--) {
@@ -157,19 +163,21 @@ function fits(next, restCommands, width, options, mustBeFlat) {
}
break;
- case "if-break":
- if (mode === MODE_BREAK) {
+ case "if-break": {
+ const groupMode = doc.groupId ? groupModeMap[doc.groupId] : mode;
+ if (groupMode === MODE_BREAK) {
if (doc.breakContents) {
cmds.push([ind, mode, doc.breakContents]);
}
}
- if (mode === MODE_FLAT) {
+ if (groupMode === MODE_FLAT) {
if (doc.flatContents) {
cmds.push([ind, mode, doc.flatContents]);
}
}
break;
+ }
case "line":
switch (mode) {
// fallthrough
@@ -194,6 +202,8 @@ function fits(next, restCommands, width, options, mustBeFlat) {
}
function printDocToString(doc, options) {
+ groupModeMap = {};
+
const width = options.printWidth;
const newLine = options.newLine || "\n";
let pos = 0;
@@ -299,6 +309,10 @@ function printDocToString(doc, options) {
break;
}
}
+
+ if (doc.id) {
+ groupModeMap[doc.id] = cmds[cmds.length - 1][1];
+ }
break;
// Fills each line with as much code as possible before moving to a new
// line with the same indentation.
@@ -395,19 +409,21 @@ function printDocToString(doc, options) {
}
break;
}
- case "if-break":
- if (mode === MODE_BREAK) {
+ case "if-break": {
+ const groupMode = doc.groupId ? groupModeMap[doc.groupId] : mode;
+ if (groupMode === MODE_BREAK) {
if (doc.breakContents) {
cmds.push([ind, mode, doc.breakContents]);
}
}
- if (mode === MODE_FLAT) {
+ if (groupMode === MODE_FLAT) {
if (doc.flatContents) {
cmds.push([ind, mode, doc.flatContents]);
}
}
break;
+ }
case "line-suffix":
lineSuffix.push([ind, mode, doc.contents]);
break;
diff --git a/src/language-yaml/index.js b/src/language-yaml/index.js
new file mode 100644
index 000000000..94e1c0f90
--- /dev/null
+++ b/src/language-yaml/index.js
@@ -0,0 +1,34 @@
+"use strict";
+
+const printer = require("./printer-yaml");
+const options = require("./options");
+
+const language = {
+ name: "YAML",
+ parsers: ["yaml"],
+ vscodeLanguageIds: ["yaml"],
+ // https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
+ aceMode: "yaml",
+ aliases: ["yml"],
+ codemirrorMimeType: "text/x-yaml",
+ codemirrorMode: "yaml",
+ extensions: [
+ ".yml",
+ ".reek",
+ ".rviz",
+ ".sublime-syntax",
+ ".syntax",
+ ".yaml",
+ ".yaml-tmlanguage",
+ ".yml.mysql"
+ ],
+ filenames: [".clang-format", ".clang-tidy", ".gemrc"],
+ linguistLanguageId: 407,
+ tmScope: "source.yaml"
+};
+
+module.exports = {
+ languages: [language],
+ printers: { yaml: printer },
+ options
+};
diff --git a/src/language-yaml/options.js b/src/language-yaml/options.js
new file mode 100644
index 000000000..c50eb3743
--- /dev/null
+++ b/src/language-yaml/options.js
@@ -0,0 +1,8 @@
+"use strict";
+
+const commonOptions = require("../common/common-options");
+
+// format based on https://github.com/prettier/prettier/blob/master/src/main/core-options.js
+module.exports = {
+ bracketSpacing: commonOptions.bracketSpacing
+};
diff --git a/src/language-yaml/parser-yaml.js b/src/language-yaml/parser-yaml.js
new file mode 100644
index 000000000..b679d60de
--- /dev/null
+++ b/src/language-yaml/parser-yaml.js
@@ -0,0 +1,73 @@
+"use strict";
+
+const createError = require("../common/parser-create-error");
+const { hasPragma } = require("./pragma");
+const { createNull, defineShortcut, mapNode } = require("./utils");
+
+function defineShortcuts(node) {
+ switch (node.type) {
+ case "document":
+ defineShortcut(node, "head", () => node.children[0]);
+ defineShortcut(node, "body", () => node.children[1]);
+ break;
+ case "sequenceItem":
+ case "flowSequenceItem":
+ case "mappingKey":
+ case "mappingValue":
+ defineShortcut(node, "node", () => node.children[0]);
+ break;
+ case "mappingItem":
+ case "flowMappingItem":
+ defineShortcut(node, "key", () => node.children[0]);
+ defineShortcut(node, "value", () => node.children[1]);
+ break;
+ }
+}
+
+function parse(text) {
+ try {
+ const root = mapNode(require("yaml-unist-parser").parse(text), node => {
+ // replace explicit empty MappingKey/MappingValue with implicit one
+ if (
+ (node.type === "mappingKey" || node.type === "mappingValue") &&
+ node.children[0].type === "null" &&
+ node.leadingComments.length === 0 &&
+ node.trailingComments.length === 0
+ ) {
+ return createNull();
+ }
+
+ defineShortcuts(node);
+ return node;
+ });
+
+ /**
+ * suppress `comment not printed` error
+ *
+ * comments are handled in printer-yaml.js without using `printComment`
+ * so that it'll always throw errors even if we printed it correctly
+ */
+ delete root.comments;
+
+ return root;
+ } catch (error) {
+ // istanbul ignore next
+ throw error && error.name === "YAMLSyntaxError"
+ ? createError(error.message, error.position)
+ : error;
+ }
+}
+
+const parser = {
+ astFormat: "yaml",
+ parse,
+ hasPragma,
+ locStart: node => node.position.start.offset,
+ locEnd: node => node.position.end.offset
+};
+
+module.exports = {
+ parsers: {
+ yaml: parser
+ }
+};
diff --git a/src/language-yaml/pragma.js b/src/language-yaml/pragma.js
new file mode 100644
index 000000000..c2853c4ad
--- /dev/null
+++ b/src/language-yaml/pragma.js
@@ -0,0 +1,19 @@
+"use strict";
+
+function isPragma(text) {
+ return /^\s*@(prettier|format)\s*$/.test(text);
+}
+
+function hasPragma(text) {
+ return /^\s*#[^\n\S]*@(prettier|format)\s*?(\n|$)/.test(text);
+}
+
+function insertPragma(text) {
+ return `# @format\n\n${text}`;
+}
+
+module.exports = {
+ isPragma,
+ hasPragma,
+ insertPragma
+};
diff --git a/src/language-yaml/printer-yaml.js b/src/language-yaml/printer-yaml.js
new file mode 100644
index 000000000..8b79d428f
--- /dev/null
+++ b/src/language-yaml/printer-yaml.js
@@ -0,0 +1,506 @@
+"use strict";
+
+const { insertPragma, isPragma } = require("./pragma");
+const {
+ getAncestorCount,
+ getLast,
+ getLastDescendantNode,
+ hasExplicitDocumentEndMarker,
+ hasLeadingComments,
+ hasMiddleComments,
+ hasTrailingComments,
+ hasPrettierIgnore,
+ isLastDescendantNode,
+ isNextLineEmpty,
+ isNode,
+ isBlockValue,
+ restoreBlockFoldedValue
+} = require("./utils");
+const docBuilders = require("../doc").builders;
+const {
+ conditionalGroup,
+ breakParent,
+ concat,
+ dedent,
+ dedentToRoot,
+ fill,
+ group,
+ hardline,
+ ifBreak,
+ join,
+ line,
+ lineSuffix,
+ literalline,
+ markAsRoot,
+ softline
+} = docBuilders;
+
+function genericPrint(path, options, print) {
+ const node = path.getValue();
+ const parentNode = path.getParentNode();
+
+ const tag =
+ "tag" in node && node.tag.type !== "null" ? path.call(print, "tag") : "";
+
+ const anchor =
+ "anchor" in node && node.anchor.type !== "null"
+ ? path.call(print, "anchor")
+ : "";
+
+ const nextEmptyLine =
+ (node.type === "mapping" ||
+ node.type === "sequence" ||
+ node.type === "comment" ||
+ node.type === "directive" ||
+ node.type === "mappingItem" ||
+ node.type === "sequenceItem") &&
+ !isLastDescendantNode(path)
+ ? printNextEmptyLine(path, options.originalText)
+ : "";
+
+ return concat([
+ node.type !== "mappingValue" && hasLeadingComments(node)
+ ? concat([join(hardline, path.map(print, "leadingComments")), hardline])
+ : "",
+ tag,
+ tag && anchor ? " " : "",
+ anchor,
+ (node.type === "sequence" || node.type === "mapping") &&
+ node.middleComments.length === 0
+ ? tag || anchor
+ ? hardline
+ : ""
+ : tag || anchor
+ ? " "
+ : "",
+ hasMiddleComments(node)
+ ? concat([
+ node.middleComments.length === 1 ? "" : hardline,
+ join(hardline, path.map(print, "middleComments")),
+ hardline
+ ])
+ : "",
+ hasPrettierIgnore(path)
+ ? options.originalText.slice(
+ node.position.start.offset,
+ node.position.end.offset
+ )
+ : group(_print(node, parentNode, path, options, print)),
+ !isBlockValue(node) && hasTrailingComments(node) // trailing comments for block value are handled themselves
+ ? lineSuffix(
+ concat([
+ " ",
+ parentNode.type === "mappingKey" &&
+ path.getParentNode(2).type === "mapping" &&
+ isInlineNode(node)
+ ? ""
+ : breakParent,
+ join(hardline, path.map(print, "trailingComments"))
+ ])
+ )
+ : "",
+ nextEmptyLine
+ ]);
+}
+
+function _print(node, parentNode, path, options, print) {
+ switch (node.type) {
+ case "root":
+ return concat([
+ concat(
+ path.map(
+ (childPath, index) =>
+ index === node.children.length - 1
+ ? print(childPath)
+ : concat([
+ print(childPath),
+ hasTrailingComments(node.children[index]) ||
+ (childPath.call(hasPrettierIgnore, "body") &&
+ hasExplicitDocumentEndMarker(
+ node.children[index],
+ options.originalText
+ ))
+ ? ""
+ : concat([hardline, "..."]),
+ hardline
+ ]),
+ "children"
+ )
+ ),
+ node.children.length === 0 ||
+ (lastDescendantNode =>
+ isBlockValue(lastDescendantNode) &&
+ (/[^\S\n]\n?$/.test(lastDescendantNode.value) ||
+ (lastDescendantNode.chomping === "keep" &&
+ lastDescendantNode.value === "\n")))(getLastDescendantNode(node))
+ ? ""
+ : hardline
+ ]);
+ case "document":
+ return concat([
+ node.head.children.length === 0
+ ? path.call(print, "body")
+ : join(
+ hardline,
+ [path.call(print, "head"), "---"].concat(
+ node.body.children.length === 0 ? [] : path.call(print, "body")
+ )
+ ),
+ hasTrailingComments(node) ? concat([hardline, "..."]) : ""
+ ]);
+ case "documentHead":
+ case "documentBody":
+ return join(hardline, path.map(print, "children"));
+ case "directive":
+ return concat(["%", join(" ", [node.name].concat(node.parameters))]);
+ case "comment":
+ return concat(["#", node.value]);
+ case "alias":
+ return concat(["*", node.value]);
+ case "null":
+ return "";
+ case "verbatimTag":
+ return concat(["!<", node.value, ">"]);
+ case "shorthandTag":
+ return concat([node.handle, node.suffix]);
+ case "nonSpecificTag":
+ return "!";
+ case "anchor":
+ return concat(["&", node.value]);
+ case "plain":
+ return join(hardline, node.value.replace(/\n/g, "\n\n").split("\n"));
+ case "quoteDouble":
+ case "quoteSingle": {
+ const singleQuote = "'";
+ const doubleQuote = '"';
+
+ const raw = options.originalText.slice(
+ node.position.start.offset + 1,
+ node.position.end.offset - 1
+ );
+
+ if (
+ (node.type === "quoteSingle" && raw.includes("\\")) ||
+ (node.type === "quoteDouble" && /\\[^"]/.test(raw))
+ ) {
+ // only quoteDouble can use escape chars
+ // and quoteSingle do not need to escape backslashes
+ const originalQuote =
+ node.type === "quoteDouble" ? doubleQuote : singleQuote;
+ return originalQuote + raw + originalQuote;
+ } else if (raw.includes(doubleQuote)) {
+ return (
+ singleQuote +
+ (node.type === "quoteDouble"
+ ? // double quote needs to be escaped by backslash in quoteDouble
+ raw.replace(/\\"/g, doubleQuote)
+ : raw) +
+ singleQuote
+ );
+ }
+
+ if (raw.includes(singleQuote)) {
+ return (
+ doubleQuote +
+ (node.type === "quoteSingle"
+ ? // single quote needs to be escaped by 2 single quotes in quoteSingle
+ raw.replace(/''/g, singleQuote)
+ : raw) +
+ doubleQuote
+ );
+ }
+
+ const quote = options.singleQuote ? singleQuote : doubleQuote;
+ return quote + raw + quote;
+ }
+ case "blockFolded": // TODO: --prose-wrap
+ case "blockLiteral": {
+ const value =
+ node.chomping === "strip" ||
+ (node.chomping === "clip" &&
+ options.originalText.slice(
+ node.position.end.offset - 2,
+ node.position.end.offset
+ ) === "\n\n") ||
+ (node.chomping === "keep" && node.value === "\n")
+ ? node.value
+ : node.value.replace(/\n$/, "");
+ return concat([
+ node.type === "blockFolded" ? ">" : "|",
+ node.indent === null ? "" : node.indent.toString(),
+ node.chomping === "clip" ? "" : node.chomping === "keep" ? "+" : "-",
+ hasTrailingComments(node)
+ ? concat([" ", join(hardline, path.map(print, "trailingComments"))])
+ : "",
+ value === ""
+ ? ""
+ : (node.indent === null ? dedent : dedentToRoot)(
+ align(
+ node.indent === null
+ ? options.tabWidth
+ : node.indent -
+ 1 +
+ getAncestorCount(
+ path,
+ ancestorNode =>
+ ancestorNode.type === "sequence" ||
+ ancestorNode.type === "mapping"
+ ),
+ (node.chomping === "keep" && node.value === "\n"
+ ? dedentToRoot
+ : markAsRoot)(
+ concat(
+ (node.type === "blockLiteral"
+ ? value
+ : restoreBlockFoldedValue(value)
+ )
+ .split("\n")
+ .reduce(
+ (reduced, lineContent, index, lines) =>
+ reduced.concat(
+ node.type === "blockLiteral"
+ ? lineContent
+ : fill(
+ join(
+ line,
+ lineContent
+ // split by single space
+ .replace(/(^|[^ ]) ([^ ]|$)/g, "$1\n$2")
+ .split("\n")
+ ).parts
+ ),
+ index === lines.length - 1 &&
+ !/\s$/.test(lineContent)
+ ? []
+ : /\s$/.test(lineContent)
+ ? index === lines.length - 1
+ ? dedentToRoot(literalline)
+ : literalline
+ : hardline
+ ),
+ [hardline]
+ )
+ )
+ )
+ )
+ )
+ ]);
+ }
+ case "sequence":
+ return join(hardline, path.map(print, "children"));
+ case "sequenceItem":
+ return concat(["- ", align(2, path.call(print, "node"))]);
+ case "mappingKey":
+ return path.call(print, "node");
+ case "mappingValue":
+ return path.call(print, "node");
+ case "mapping":
+ return join(hardline, path.map(print, "children"));
+ case "mappingItem":
+ case "flowMappingItem": {
+ if (node.key.type === "null" && node.value.type === "null") {
+ return concat([":", line]);
+ }
+
+ const key = path.call(print, "key");
+ const value = path.call(print, "value");
+
+ if (node.value.type === "null") {
+ return node.type === "flowMappingItem" &&
+ path.getParentNode().type !== "flowSequence"
+ ? key
+ : concat(["? ", align(2, key)]);
+ }
+
+ if (node.key.type === "null") {
+ return concat([
+ ":",
+ node.value.node.type === "null" ? "" : " ",
+ align(2, value)
+ ]);
+ }
+
+ const groupId = Symbol("mappingKey");
+
+ const forceExplicitKey =
+ hasLeadingComments(node.value) ||
+ (node.key.type !== "null" && !isInlineNode(node.key.node));
+ return forceExplicitKey
+ ? concat([
+ "? ",
+ align(2, key),
+ hardline,
+ join(
+ "",
+ path
+ .map(print, "value", "leadingComments")
+ .map(comment => concat([comment, hardline]))
+ ),
+ ": ",
+ align(2, value)
+ ])
+ : conditionalGroup([
+ concat([
+ group(
+ concat([ifBreak("? "), group(align(2, key), { id: groupId })])
+ ),
+ ifBreak(
+ concat([hardline, ": ", align(2, value)]),
+ indent(
+ concat([
+ needsSpaceInFrontOfMappingValue(node) ? " " : "",
+ ":",
+ hasLeadingComments(node.value.node) ||
+ (parentNode.type === "mapping" &&
+ hasTrailingComments(node.key.node) &&
+ isInlineNode(node.value.node)) ||
+ ((node.value.node.type === "mapping" ||
+ node.value.node.type === "sequence") &&
+ node.value.node.tag.type === "null" &&
+ node.value.node.anchor.type === "null")
+ ? hardline
+ : node.value.node.type === "null"
+ ? ""
+ : line,
+ value
+ ])
+ ),
+ { groupId }
+ )
+ ])
+ ]);
+ }
+ case "flowMapping":
+ case "flowSequence": {
+ const openMarker = node.type === "flowMapping" ? "{" : "[";
+ const closeMarker = node.type === "flowMapping" ? "}" : "]";
+ const bracketSpacing =
+ node.type === "flowMapping" &&
+ node.children.length !== 0 &&
+ options.bracketSpacing
+ ? line
+ : softline;
+ const isLastItemEmptyMappingItem =
+ node.children.length !== 0 &&
+ (lastItem =>
+ lastItem.type === "flowMappingItem" &&
+ lastItem.key.type === "null" &&
+ lastItem.value.type === "null")(getLast(node.children));
+ return concat([
+ openMarker,
+ indent(
+ concat([
+ bracketSpacing,
+ concat(
+ path.map(
+ (childPath, index) =>
+ concat([
+ print(childPath),
+ index === node.children.length - 1
+ ? ""
+ : concat([
+ ",",
+ line,
+ node.children[index].position.start.line !==
+ node.children[index + 1].position.start.line
+ ? printNextEmptyLine(
+ childPath,
+ options.originalText
+ )
+ : ""
+ ])
+ ]),
+ "children"
+ )
+ ),
+ ifBreak(",", "")
+ ])
+ ),
+ isLastItemEmptyMappingItem ? "" : bracketSpacing,
+ closeMarker
+ ]);
+ }
+ case "flowSequenceItem":
+ return path.call(print, "node");
+ // istanbul ignore next
+ default:
+ throw new Error(`Unexpected node type ${node.type}`);
+ }
+
+ function indent(doc) {
+ return docBuilders.align(" ".repeat(options.tabWidth), doc);
+ }
+
+ function align(n, doc) {
+ return typeof n === "number" && n > 0
+ ? docBuilders.align(" ".repeat(n), doc)
+ : docBuilders.align(n, doc);
+ }
+}
+
+function isInlineNode(node) {
+ switch (node.type) {
+ case "plain":
+ case "quoteDouble":
+ case "quoteSingle":
+ case "alias":
+ case "flowMapping":
+ case "flowSequence":
+ case "null":
+ return true;
+ default:
+ return false;
+ }
+}
+
+function needsSpaceInFrontOfMappingValue(node) {
+ // istanbul ignore else
+ if (node.key.type !== "null") {
+ switch (node.key.node.type) {
+ case "alias":
+ return true;
+ }
+ }
+ return false;
+}
+
+function printNextEmptyLine(path, originalText) {
+ const node = path.getValue();
+ const root = path.stack[0];
+
+ root.isNextEmptyLinePrintedChecklist =
+ root.isNextEmptyLinePrintedChecklist || [];
+
+ if (!root.isNextEmptyLinePrintedChecklist[node.position.end.line]) {
+ if (isNextLineEmpty(node, originalText)) {
+ root.isNextEmptyLinePrintedChecklist[node.position.end.line] = true;
+ return softline;
+ }
+ }
+
+ return "";
+}
+
+function clean(node, newNode /*, parent */) {
+ if (isNode(newNode)) {
+ delete newNode.position;
+ switch (newNode.type) {
+ case "comment":
+ // insert pragma
+ if (isPragma(newNode.value)) {
+ return null;
+ }
+ break;
+ case "quoteDouble":
+ case "quoteSingle":
+ newNode.type = "quote";
+ break;
+ }
+ }
+}
+
+module.exports = {
+ print: genericPrint,
+ massageAstNode: clean,
+ insertPragma
+};
diff --git a/src/language-yaml/utils.js b/src/language-yaml/utils.js
new file mode 100644
index 000000000..bf6d4c82d
--- /dev/null
+++ b/src/language-yaml/utils.js
@@ -0,0 +1,206 @@
+"use strict";
+
+function getLast(array) {
+ return array[array.length - 1];
+}
+
+function getAncestorCount(path, filter) {
+ let counter = 0;
+ for (let i = 0; i < path.stack.length - 1; i++) {
+ const value = path.stack[i];
+ if (isNode(value) && filter(value)) {
+ counter++;
+ }
+ }
+ return counter;
+}
+
+function isNode(value) {
+ return value && typeof value.type === "string";
+}
+
+function mapNode(node, callback, parent) {
+ return callback(
+ "children" in node
+ ? Object.assign({}, node, {
+ children: node.children.map(childNode =>
+ mapNode(childNode, callback, node)
+ )
+ })
+ : node,
+ parent
+ );
+}
+
+function defineShortcut(x, key, getter) {
+ Object.defineProperty(x, key, {
+ get: getter,
+ enumerable: false
+ });
+}
+
+function createNull() {
+ return {
+ type: "null",
+ position: {
+ start: { line: -1, column: -1, offset: -1 },
+ end: { line: -1, column: -1, offset: -1 }
+ }
+ };
+}
+
+function isNextLineEmpty(node, text) {
+ let newlineCount = 0;
+
+ for (let i = node.position.end.offset - 1; i < text.length; i++) {
+ const char = text[i];
+
+ if (char === "\n") {
+ newlineCount++;
+ }
+
+ if (newlineCount === 1 && /\S/.test(char)) {
+ return false;
+ }
+
+ if (newlineCount === 2) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function isLastDescendantNode(path) {
+ const node = path.getValue();
+
+ switch (node.type) {
+ case "comment":
+ case "verbatimTag":
+ case "shorthandTag":
+ case "nonSpecificTag":
+ return false;
+ }
+
+ for (let i = 1; i < path.stack.length; i++) {
+ const item = path.stack[i];
+ const parentItem = path.stack[i - 1];
+
+ if (
+ Array.isArray(parentItem) &&
+ typeof item === "number" &&
+ item !== parentItem.length - 1
+ ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+function getLastDescendantNode(node) {
+ return "children" in node && node.children.length !== 0
+ ? getLastDescendantNode(getLast(node.children))
+ : node;
+}
+
+function isPrettierIgnore(comment) {
+ return comment.value.trim() === "prettier-ignore";
+}
+
+function hasPrettierIgnore(path) {
+ const node = path.getValue();
+
+ if (node.type === "documentBody") {
+ const document = path.getParentNode();
+ return (
+ document.head.children.length !== 0 &&
+ (lastItem => lastItem.type === "comment" && isPrettierIgnore(lastItem))(
+ getLast(document.head.children)
+ )
+ );
+ }
+
+ return (
+ "leadingComments" in node &&
+ node.leadingComments.length !== 0 &&
+ isPrettierIgnore(getLast(node.leadingComments))
+ );
+}
+
+function hasExplicitDocumentEndMarker(document, text) {
+ return (
+ text.slice(
+ document.position.end.offset - 4,
+ document.position.end.offset
+ ) === "\n..."
+ );
+}
+
+function restoreBlockFoldedValue(value) {
+ const lines = value.split("\n");
+
+ let hasChecked = false;
+ let isIndented = false;
+ for (let i = 0; i < lines.length; i++) {
+ const lineContent = lines[i];
+
+ if (!lineContent) {
+ continue;
+ }
+
+ if (/^\s/.test(lineContent[0])) {
+ isIndented = true;
+ } else {
+ if (!isIndented && i !== 0 && hasChecked) {
+ lines[i] = "\n" + lineContent;
+ }
+ isIndented = false;
+ }
+
+ hasChecked = true;
+ }
+
+ return lines.join("\n");
+}
+
+function isBlockValue(node) {
+ switch (node.type) {
+ case "blockFolded":
+ case "blockLiteral":
+ return true;
+ default:
+ return false;
+ }
+}
+
+function hasLeadingComments(node) {
+ return "leadingComments" in node && node.leadingComments.length !== 0;
+}
+
+function hasMiddleComments(node) {
+ return "middleComments" in node && node.middleComments.length !== 0;
+}
+
+function hasTrailingComments(node) {
+ return "trailingComments" in node && node.trailingComments.length !== 0;
+}
+
+module.exports = {
+ getLast,
+ getAncestorCount,
+ isNode,
+ isBlockValue,
+ mapNode,
+ defineShortcut,
+ createNull,
+ isNextLineEmpty,
+ isLastDescendantNode,
+ getLastDescendantNode,
+ hasPrettierIgnore,
+ hasLeadingComments,
+ hasMiddleComments,
+ hasTrailingComments,
+ hasExplicitDocumentEndMarker,
+ restoreBlockFoldedValue
+};
diff --git a/src/main/core-options.js b/src/main/core-options.js
index 37bd07108..10d2d476e 100644
--- a/src/main/core-options.js
+++ b/src/main/core-options.js
@@ -115,7 +115,8 @@ const options = {
},
{ value: "graphql", since: "1.5.0", description: "GraphQL" },
{ value: "markdown", since: "1.8.0", description: "Markdown" },
- { value: "vue", since: "1.10.0", description: "Vue" }
+ { value: "vue", since: "1.10.0", description: "Vue" },
+ { value: "yaml", since: "1.14.0", description: "YAML" }
]
},
plugins: {
diff --git a/standalone.js b/standalone.js
index f5db43496..31acc6d33 100644
--- a/standalone.js
+++ b/standalone.js
@@ -13,7 +13,8 @@ const internalPlugins = [
require("./src/language-css"),
require("./src/language-graphql"),
require("./src/language-markdown"),
- require("./src/language-vue")
+ require("./src/language-vue"),
+ require("./src/language-yaml")
];
const isArray =
diff --git a/tests/markdown/__snapshots__/jsfmt.spec.js.snap b/tests/markdown/__snapshots__/jsfmt.spec.js.snap
index b5ca19faf..0ec951260 100644
--- a/tests/markdown/__snapshots__/jsfmt.spec.js.snap
+++ b/tests/markdown/__snapshots__/jsfmt.spec.js.snap
@@ -1392,10 +1392,10 @@ how you can configure lint-staged.
Copy the following config into your \`.pre-commit-config.yaml\` file:
\`\`\`yaml
- - repo: https://github.com/prettier/prettier
- sha: '' # Use the sha or tag you want to point at
- hooks:
- - id: prettier
+- repo: https://github.com/prettier/prettier
+ sha: "" # Use the sha or tag you want to point at
+ hooks:
+ - id: prettier
\`\`\`
Find more info from [here](https://pre-commit.com).
@@ -1801,9 +1801,9 @@ YAML:
\`\`\`yaml
semi: false
overrides:
-- files: "*.test.js"
- options:
- semi: true
+ - files: "*.test.js"
+ options:
+ semi: true
\`\`\`
\`files\` is required for each override, and may be a string or array of strings.
@@ -3363,10 +3363,10 @@ how you can configure lint-staged.
Copy the following config into your \`.pre-commit-config.yaml\` file:
\`\`\`yaml
- - repo: https://github.com/prettier/prettier
- sha: '' # Use the sha or tag you want to point at
- hooks:
- - id: prettier
+- repo: https://github.com/prettier/prettier
+ sha: '' # Use the sha or tag you want to point at
+ hooks:
+ - id: prettier
\`\`\`
Find more info from [here](https://pre-commit.com).
@@ -3772,9 +3772,9 @@ YAML:
\`\`\`yaml
semi: false
overrides:
-- files: "*.test.js"
- options:
- semi: true
+ - files: '*.test.js'
+ options:
+ semi: true
\`\`\`
\`files\` is required for each override, and may be a string or array of strings.
diff --git a/tests/yaml_alias/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_alias/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..b14c01d8f
--- /dev/null
+++ b/tests/yaml_alias/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,8 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`common.yml 1`] = `
+*abc
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*abc
+
+`;
diff --git a/tests/yaml_alias/common.yml b/tests/yaml_alias/common.yml
new file mode 100644
index 000000000..cd06d36f1
--- /dev/null
+++ b/tests/yaml_alias/common.yml
@@ -0,0 +1 @@
+*abc
diff --git a/tests/yaml_alias/jsfmt.spec.js b/tests/yaml_alias/jsfmt.spec.js
new file mode 100644
index 000000000..89d18c007
--- /dev/null
+++ b/tests/yaml_alias/jsfmt.spec.js
@@ -0,0 +1 @@
+run_spec(__dirname, ["yaml"]);
diff --git a/tests/yaml_block_folded/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_block_folded/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..af4969711
--- /dev/null
+++ b/tests/yaml_block_folded/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,328 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`clip.yml 1`] = `
+>
+ 123
+ 456
+ 789
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>
+ 123 456 789
+
+`;
+
+exports[`indent.yml 1`] = `
+>2-
+ 123
+ 456
+ 789
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>2-
+ 123
+ 456
+ 789
+
+`;
+
+exports[`keep.yml 1`] = `
+>+
+ 123
+ 456
+ 789
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>+
+ 123 456 789
+
+
+
+`;
+
+exports[`map.yml 1`] = `
+a: >
+ 123
+ 456
+ 789
+b: >1
+ 123
+ 456
+ 789
+d: >
+ 123
+ 456
+ 789
+
+c: 0
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: >
+ 123 456 789
+b: >1
+ 123
+ 456
+ 789
+d: >
+ 123 456 789
+
+c: 0
+
+`;
+
+exports[`middle-comment.yml 1`] = `
+!!str #comment
+>
+ 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!str #comment
+>
+ 123
+
+`;
+
+exports[`middle-comments.yml 1`] = `
+!!str # comment 1
+# comment 2
+>
+ 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!str
+# comment 1
+# comment 2
+>
+ 123
+
+`;
+
+exports[`newline.yml 1`] = `
+- >+
+ 123
+ 456
+ 789
+
+ 123
+ 456
+ 789
+
+
+ 123
+ 456
+ 789
+
+
+- >2+
+ 123
+ 456
+ 789
+
+ 123
+ 456
+ 789
+
+
+ 123
+ 456
+ 789
+
+- 0
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- >+
+ 123 456 789
+
+ 123 456 789
+
+
+ 123 456 789
+
+
+- >2+
+ 123 456 789
+
+ 123 456 789
+
+
+ 123 456 789
+
+- 0
+
+`;
+
+exports[`newline-unaligned.yml 1`] = `
+>
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+ 1
+ 2
+
+ 3
+ 4
+
+ 5
+ 6
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>
+ 1 2
+ 3
+ 4
+ 5 6
+
+ 1 2
+ 3
+ 4
+ 5 6
+
+
+ 1 2
+ 3
+ 4
+ 5 6
+
+ 1 2
+
+ 3
+ 4
+
+ 5 6
+
+`;
+
+exports[`props.yml 1`] = `
+!!str &anchor >
+ 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!str &anchor >
+ 123
+
+`;
+
+exports[`props-in-map.yml 1`] = `
+a: !!str &anchor >
+ 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: !!str &anchor >
+ 123
+
+`;
+
+exports[`prose.yml 1`] = `
+>
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+---
+>
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>
+ 123 456 789 123 456 789 123 456 789 123 456 789 123 456 789 123 456 789 123
+ 456 789 123 456 789 123 456 789 123 456 789 123 456 789 123 456 789 123 456
+ 789 123 456 789 123 456 789 123 456 789 123 456 789 123 456 789 123 456 789
+...
+>
+ 123 456 789 123 456 789 123 456 789 123 456 789
+ 123 456 789 123 456 789 123 456 789 123 456 789
+ 123 456 789 123 456 789 123 456 789 123 456 789
+ 123 456 789 123 456 789 123 456 789 123 456 789
+ 123 456 789 123 456 789 123 456 789
+
+`;
+
+exports[`seq.yml 1`] = `
+- >
+ 123
+ 456
+ 789
+- >1
+ 123
+ 456
+ 789
+- 0
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- >
+ 123 456 789
+- >1
+ 123
+ 456
+ 789
+- 0
+
+`;
+
+exports[`strip.yml 1`] = `
+>-
+ 123
+ 456
+ 789
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>-
+ 123 456 789
+
+`;
+
+exports[`trailing-comment.yml 1`] = `
+a: !!str > # hello
+ hello
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: !!str > # hello
+ hello
+
+`;
diff --git a/tests/yaml_block_folded/clip.yml b/tests/yaml_block_folded/clip.yml
new file mode 100644
index 000000000..b71e0cbab
--- /dev/null
+++ b/tests/yaml_block_folded/clip.yml
@@ -0,0 +1,6 @@
+>
+ 123
+ 456
+ 789
+
+
diff --git a/tests/yaml_block_folded/indent.yml b/tests/yaml_block_folded/indent.yml
new file mode 100644
index 000000000..3716b41f8
--- /dev/null
+++ b/tests/yaml_block_folded/indent.yml
@@ -0,0 +1,6 @@
+>2-
+ 123
+ 456
+ 789
+
+
diff --git a/tests/yaml_block_folded/jsfmt.spec.js b/tests/yaml_block_folded/jsfmt.spec.js
new file mode 100644
index 000000000..89d18c007
--- /dev/null
+++ b/tests/yaml_block_folded/jsfmt.spec.js
@@ -0,0 +1 @@
+run_spec(__dirname, ["yaml"]);
diff --git a/tests/yaml_block_folded/keep.yml b/tests/yaml_block_folded/keep.yml
new file mode 100644
index 000000000..080ccbc8d
--- /dev/null
+++ b/tests/yaml_block_folded/keep.yml
@@ -0,0 +1,6 @@
+>+
+ 123
+ 456
+ 789
+
+
diff --git a/tests/yaml_block_folded/map.yml b/tests/yaml_block_folded/map.yml
new file mode 100644
index 000000000..44b24d27a
--- /dev/null
+++ b/tests/yaml_block_folded/map.yml
@@ -0,0 +1,14 @@
+a: >
+ 123
+ 456
+ 789
+b: >1
+ 123
+ 456
+ 789
+d: >
+ 123
+ 456
+ 789
+
+c: 0
diff --git a/tests/yaml_block_folded/middle-comment.yml b/tests/yaml_block_folded/middle-comment.yml
new file mode 100644
index 000000000..67f44c42e
--- /dev/null
+++ b/tests/yaml_block_folded/middle-comment.yml
@@ -0,0 +1,3 @@
+!!str #comment
+>
+ 123
diff --git a/tests/yaml_block_folded/middle-comments.yml b/tests/yaml_block_folded/middle-comments.yml
new file mode 100644
index 000000000..61315dec1
--- /dev/null
+++ b/tests/yaml_block_folded/middle-comments.yml
@@ -0,0 +1,4 @@
+!!str # comment 1
+# comment 2
+>
+ 123
diff --git a/tests/yaml_block_folded/newline-unaligned.yml b/tests/yaml_block_folded/newline-unaligned.yml
new file mode 100644
index 000000000..4e8080eb3
--- /dev/null
+++ b/tests/yaml_block_folded/newline-unaligned.yml
@@ -0,0 +1,31 @@
+>
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+ 1
+ 2
+
+ 3
+ 4
+
+ 5
+ 6
diff --git a/tests/yaml_block_folded/newline.yml b/tests/yaml_block_folded/newline.yml
new file mode 100644
index 000000000..d2e207bf5
--- /dev/null
+++ b/tests/yaml_block_folded/newline.yml
@@ -0,0 +1,30 @@
+- >+
+ 123
+ 456
+ 789
+
+ 123
+ 456
+ 789
+
+
+ 123
+ 456
+ 789
+
+
+- >2+
+ 123
+ 456
+ 789
+
+ 123
+ 456
+ 789
+
+
+ 123
+ 456
+ 789
+
+- 0
diff --git a/tests/yaml_block_folded/props-in-map.yml b/tests/yaml_block_folded/props-in-map.yml
new file mode 100644
index 000000000..574f3296c
--- /dev/null
+++ b/tests/yaml_block_folded/props-in-map.yml
@@ -0,0 +1,2 @@
+a: !!str &anchor >
+ 123
diff --git a/tests/yaml_block_folded/props.yml b/tests/yaml_block_folded/props.yml
new file mode 100644
index 000000000..78348a247
--- /dev/null
+++ b/tests/yaml_block_folded/props.yml
@@ -0,0 +1,2 @@
+!!str &anchor >
+ 123
diff --git a/tests/yaml_block_folded/prose.yml b/tests/yaml_block_folded/prose.yml
new file mode 100644
index 000000000..f4988adc8
--- /dev/null
+++ b/tests/yaml_block_folded/prose.yml
@@ -0,0 +1,41 @@
+>
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+---
+>
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
+ 123 456 789
diff --git a/tests/yaml_block_folded/seq.yml b/tests/yaml_block_folded/seq.yml
new file mode 100644
index 000000000..a356d9336
--- /dev/null
+++ b/tests/yaml_block_folded/seq.yml
@@ -0,0 +1,9 @@
+- >
+ 123
+ 456
+ 789
+- >1
+ 123
+ 456
+ 789
+- 0
diff --git a/tests/yaml_block_folded/strip.yml b/tests/yaml_block_folded/strip.yml
new file mode 100644
index 000000000..aa90ec566
--- /dev/null
+++ b/tests/yaml_block_folded/strip.yml
@@ -0,0 +1,6 @@
+>-
+ 123
+ 456
+ 789
+
+
diff --git a/tests/yaml_block_folded/trailing-comment.yml b/tests/yaml_block_folded/trailing-comment.yml
new file mode 100644
index 000000000..3fa886658
--- /dev/null
+++ b/tests/yaml_block_folded/trailing-comment.yml
@@ -0,0 +1,2 @@
+a: !!str > # hello
+ hello
diff --git a/tests/yaml_block_literal/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_block_literal/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..52da19fc2
--- /dev/null
+++ b/tests/yaml_block_literal/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,259 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`clip.yml 1`] = `
+|
+ 123
+ 456
+ 789
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+|
+ 123
+ 456
+ 789
+
+`;
+
+exports[`indent.yml 1`] = `
+|2-
+ 123
+ 456
+ 789
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+|2-
+ 123
+ 456
+ 789
+
+`;
+
+exports[`keep.yml 1`] = `
+|+
+ 123
+ 456
+ 789
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+|+
+ 123
+ 456
+ 789
+
+
+
+`;
+
+exports[`map.yml 1`] = `
+a: |
+ 123
+ 456
+ 789
+b: |1
+ 123
+ 456
+ 789
+d: |
+ 123
+ 456
+ 789
+
+c: 0
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: |
+ 123
+ 456
+ 789
+b: |1
+ 123
+ 456
+ 789
+d: |
+ 123
+ 456
+ 789
+
+c: 0
+
+`;
+
+exports[`middle-comment.yml 1`] = `
+!!str #comment
+|
+ 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!str #comment
+|
+ 123
+
+`;
+
+exports[`middle-comments.yml 1`] = `
+!!str # comment 1
+# comment 2
+|
+ 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!str
+# comment 1
+# comment 2
+|
+ 123
+
+`;
+
+exports[`newline.yml 1`] = `
+- |+
+ 123
+ 456
+ 789
+
+
+
+- 0
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- |+
+ 123
+ 456
+ 789
+
+
+
+- 0
+
+`;
+
+exports[`newline-unaligned.yml 1`] = `
+|
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+ 1
+ 2
+
+ 3
+ 4
+
+ 5
+ 6
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+|
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+ 1
+ 2
+
+ 3
+ 4
+
+ 5
+ 6
+
+`;
+
+exports[`props.yml 1`] = `
+!!str &anchor |
+ 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!str &anchor |
+ 123
+
+`;
+
+exports[`props-in-map.yml 1`] = `
+a: !!str &anchor |
+ 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: !!str &anchor |
+ 123
+
+`;
+
+exports[`seq.yml 1`] = `
+- |
+ 123
+ 456
+ 789
+- |1
+ 123
+ 456
+ 789
+- 0
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- |
+ 123
+ 456
+ 789
+- |1
+ 123
+ 456
+ 789
+- 0
+
+`;
+
+exports[`strip.yml 1`] = `
+|-
+ 123
+ 456
+ 789
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+|-
+ 123
+ 456
+ 789
+
+`;
+
+exports[`trailing-comment.yml 1`] = `
+a: !!str | # hello
+ hello
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: !!str | # hello
+ hello
+
+`;
diff --git a/tests/yaml_block_literal/clip.yml b/tests/yaml_block_literal/clip.yml
new file mode 100644
index 000000000..c3e388c27
--- /dev/null
+++ b/tests/yaml_block_literal/clip.yml
@@ -0,0 +1,6 @@
+|
+ 123
+ 456
+ 789
+
+
diff --git a/tests/yaml_block_literal/indent.yml b/tests/yaml_block_literal/indent.yml
new file mode 100644
index 000000000..bf69744b1
--- /dev/null
+++ b/tests/yaml_block_literal/indent.yml
@@ -0,0 +1,6 @@
+|2-
+ 123
+ 456
+ 789
+
+
diff --git a/tests/yaml_block_literal/jsfmt.spec.js b/tests/yaml_block_literal/jsfmt.spec.js
new file mode 100644
index 000000000..89d18c007
--- /dev/null
+++ b/tests/yaml_block_literal/jsfmt.spec.js
@@ -0,0 +1 @@
+run_spec(__dirname, ["yaml"]);
diff --git a/tests/yaml_block_literal/keep.yml b/tests/yaml_block_literal/keep.yml
new file mode 100644
index 000000000..572f76a34
--- /dev/null
+++ b/tests/yaml_block_literal/keep.yml
@@ -0,0 +1,6 @@
+|+
+ 123
+ 456
+ 789
+
+
diff --git a/tests/yaml_block_literal/map.yml b/tests/yaml_block_literal/map.yml
new file mode 100644
index 000000000..c425ec6ea
--- /dev/null
+++ b/tests/yaml_block_literal/map.yml
@@ -0,0 +1,14 @@
+a: |
+ 123
+ 456
+ 789
+b: |1
+ 123
+ 456
+ 789
+d: |
+ 123
+ 456
+ 789
+
+c: 0
diff --git a/tests/yaml_block_literal/middle-comment.yml b/tests/yaml_block_literal/middle-comment.yml
new file mode 100644
index 000000000..5bbe289c6
--- /dev/null
+++ b/tests/yaml_block_literal/middle-comment.yml
@@ -0,0 +1,3 @@
+!!str #comment
+|
+ 123
diff --git a/tests/yaml_block_literal/middle-comments.yml b/tests/yaml_block_literal/middle-comments.yml
new file mode 100644
index 000000000..8b880d76c
--- /dev/null
+++ b/tests/yaml_block_literal/middle-comments.yml
@@ -0,0 +1,4 @@
+!!str # comment 1
+# comment 2
+|
+ 123
diff --git a/tests/yaml_block_literal/newline-unaligned.yml b/tests/yaml_block_literal/newline-unaligned.yml
new file mode 100644
index 000000000..85cdff5ef
--- /dev/null
+++ b/tests/yaml_block_literal/newline-unaligned.yml
@@ -0,0 +1,31 @@
+|
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+ 1
+ 2
+
+ 3
+ 4
+
+ 5
+ 6
diff --git a/tests/yaml_block_literal/newline.yml b/tests/yaml_block_literal/newline.yml
new file mode 100644
index 000000000..a19ba5a12
--- /dev/null
+++ b/tests/yaml_block_literal/newline.yml
@@ -0,0 +1,8 @@
+- |+
+ 123
+ 456
+ 789
+
+
+
+- 0
diff --git a/tests/yaml_block_literal/props-in-map.yml b/tests/yaml_block_literal/props-in-map.yml
new file mode 100644
index 000000000..a0db13508
--- /dev/null
+++ b/tests/yaml_block_literal/props-in-map.yml
@@ -0,0 +1,2 @@
+a: !!str &anchor |
+ 123
diff --git a/tests/yaml_block_literal/props.yml b/tests/yaml_block_literal/props.yml
new file mode 100644
index 000000000..63b029a58
--- /dev/null
+++ b/tests/yaml_block_literal/props.yml
@@ -0,0 +1,2 @@
+!!str &anchor |
+ 123
diff --git a/tests/yaml_block_literal/seq.yml b/tests/yaml_block_literal/seq.yml
new file mode 100644
index 000000000..e06beae56
--- /dev/null
+++ b/tests/yaml_block_literal/seq.yml
@@ -0,0 +1,9 @@
+- |
+ 123
+ 456
+ 789
+- |1
+ 123
+ 456
+ 789
+- 0
diff --git a/tests/yaml_block_literal/strip.yml b/tests/yaml_block_literal/strip.yml
new file mode 100644
index 000000000..3b38cd4cc
--- /dev/null
+++ b/tests/yaml_block_literal/strip.yml
@@ -0,0 +1,6 @@
+|-
+ 123
+ 456
+ 789
+
+
diff --git a/tests/yaml_block_literal/trailing-comment.yml b/tests/yaml_block_literal/trailing-comment.yml
new file mode 100644
index 000000000..7178f1507
--- /dev/null
+++ b/tests/yaml_block_literal/trailing-comment.yml
@@ -0,0 +1,2 @@
+a: !!str | # hello
+ hello
diff --git a/tests/yaml_comment/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_comment/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..61cfdf427
--- /dev/null
+++ b/tests/yaml_comment/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,17 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`root.yml 1`] = `
+#hello world
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#hello world
+
+`;
+
+exports[`set.yml 1`] = `
+- 123
+ # 456
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- 123
+# 456
+
+`;
diff --git a/tests/yaml_comment/jsfmt.spec.js b/tests/yaml_comment/jsfmt.spec.js
new file mode 100644
index 000000000..89d18c007
--- /dev/null
+++ b/tests/yaml_comment/jsfmt.spec.js
@@ -0,0 +1 @@
+run_spec(__dirname, ["yaml"]);
diff --git a/tests/yaml_comment/root.yml b/tests/yaml_comment/root.yml
new file mode 100644
index 000000000..759f3c31e
--- /dev/null
+++ b/tests/yaml_comment/root.yml
@@ -0,0 +1 @@
+#hello world
diff --git a/tests/yaml_comment/set.yml b/tests/yaml_comment/set.yml
new file mode 100644
index 000000000..4338fc489
--- /dev/null
+++ b/tests/yaml_comment/set.yml
@@ -0,0 +1,2 @@
+- 123
+ # 456
diff --git a/tests/yaml_directive/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_directive/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..89e8de075
--- /dev/null
+++ b/tests/yaml_directive/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,19 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`with-parameters.yml 1`] = `
+%YAML 1.2
+---
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%YAML 1.2
+---
+
+`;
+
+exports[`without-parameters.yml 1`] = `
+%SOMETHING
+---
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%SOMETHING
+---
+
+`;
diff --git a/tests/yaml_directive/jsfmt.spec.js b/tests/yaml_directive/jsfmt.spec.js
new file mode 100644
index 000000000..89d18c007
--- /dev/null
+++ b/tests/yaml_directive/jsfmt.spec.js
@@ -0,0 +1 @@
+run_spec(__dirname, ["yaml"]);
diff --git a/tests/yaml_directive/with-parameters.yml b/tests/yaml_directive/with-parameters.yml
new file mode 100644
index 000000000..b97ec8385
--- /dev/null
+++ b/tests/yaml_directive/with-parameters.yml
@@ -0,0 +1,2 @@
+%YAML 1.2
+---
diff --git a/tests/yaml_directive/without-parameters.yml b/tests/yaml_directive/without-parameters.yml
new file mode 100644
index 000000000..631fef23e
--- /dev/null
+++ b/tests/yaml_directive/without-parameters.yml
@@ -0,0 +1,2 @@
+%SOMETHING
+---
diff --git a/tests/yaml_document/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_document/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..86995c12a
--- /dev/null
+++ b/tests/yaml_document/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,20 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`directives-and-comments.yml 1`] = `
+# 123
+%YAML 1.2
+# 456
+---
+# 789
+test
+# 000
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# 123
+%YAML 1.2
+# 456
+---
+# 789
+test
+# 000
+
+`;
diff --git a/tests/yaml_document/directives-and-comments.yml b/tests/yaml_document/directives-and-comments.yml
new file mode 100644
index 000000000..4a095274b
--- /dev/null
+++ b/tests/yaml_document/directives-and-comments.yml
@@ -0,0 +1,7 @@
+# 123
+%YAML 1.2
+# 456
+---
+# 789
+test
+# 000
diff --git a/tests/yaml_document/jsfmt.spec.js b/tests/yaml_document/jsfmt.spec.js
new file mode 100644
index 000000000..89d18c007
--- /dev/null
+++ b/tests/yaml_document/jsfmt.spec.js
@@ -0,0 +1 @@
+run_spec(__dirname, ["yaml"]);
diff --git a/tests/yaml_flow_mapping/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_flow_mapping/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..97def7af4
--- /dev/null
+++ b/tests/yaml_flow_mapping/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,913 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`alias-key.yml 1`] = `
+{*123 : 456}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ *123 : 456 }
+
+`;
+
+exports[`alias-key.yml 2`] = `
+{*123 : 456}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ *123 : 456 }
+
+`;
+
+exports[`alias-key.yml 3`] = `
+{*123 : 456}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{*123 : 456}
+
+`;
+
+exports[`array-key.yml 1`] = `
+{? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+}
+
+`;
+
+exports[`array-key.yml 2`] = `
+{? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+}
+
+`;
+
+exports[`array-key.yml 3`] = `
+{? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+}
+
+`;
+
+exports[`array-key-array-value.yml 1`] = `
+{[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+}
+
+`;
+
+exports[`array-key-array-value.yml 2`] = `
+{[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+}
+
+`;
+
+exports[`array-key-array-value.yml 3`] = `
+{[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+}
+
+`;
+
+exports[`array-plain.yml 1`] = `
+{[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+}
+
+`;
+
+exports[`array-plain.yml 2`] = `
+{[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+}
+
+`;
+
+exports[`array-plain.yml 3`] = `
+{[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+}
+
+`;
+
+exports[`array-value.yml 1`] = `
+{a: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],b: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],c: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ a:
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ b:
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ c:
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+}
+
+`;
+
+exports[`array-value.yml 2`] = `
+{a: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],b: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],c: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ a:
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ b:
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ c:
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+}
+
+`;
+
+exports[`array-value.yml 3`] = `
+{a: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],b: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],c: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ a:
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ b:
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ c:
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+}
+
+`;
+
+exports[`comment-between.yml 1`] = `
+{
+? 123
+# comment
+: 456
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ ? 123
+ # comment
+ : 456,
+}
+
+`;
+
+exports[`comment-between.yml 2`] = `
+{
+? 123
+# comment
+: 456
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ ? 123
+ # comment
+ : 456,
+}
+
+`;
+
+exports[`comment-between.yml 3`] = `
+{
+? 123
+# comment
+: 456
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ ? 123
+ # comment
+ : 456,
+}
+
+`;
+
+exports[`comment-trailing.yml 1`] = `
+{123, # comment
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ 123, # comment
+}
+
+`;
+
+exports[`comment-trailing.yml 2`] = `
+{123, # comment
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ 123, # comment
+}
+
+`;
+
+exports[`comment-trailing.yml 3`] = `
+{123, # comment
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ 123, # comment
+}
+
+`;
+
+exports[`empty.yml 1`] = `
+{}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{}
+
+`;
+
+exports[`empty.yml 2`] = `
+{}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{}
+
+`;
+
+exports[`empty.yml 3`] = `
+{}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{}
+
+`;
+
+exports[`empty-item-colon.yml 1`] = `
+{ : }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ : }
+
+`;
+
+exports[`empty-item-colon.yml 2`] = `
+{ : }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ : }
+
+`;
+
+exports[`empty-item-colon.yml 3`] = `
+{ : }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{: }
+
+`;
+
+exports[`empty-line.yml 1`] = `
+{ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+}
+
+`;
+
+exports[`empty-line.yml 2`] = `
+{ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+}
+
+`;
+
+exports[`empty-line.yml 3`] = `
+{ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+}
+
+`;
+
+exports[`empty-line-collapse.yml 1`] = `
+{ aaa,
+
+bbb }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ aaa, bbb }
+
+`;
+
+exports[`empty-line-collapse.yml 2`] = `
+{ aaa,
+
+bbb }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ aaa, bbb }
+
+`;
+
+exports[`empty-line-collapse.yml 3`] = `
+{ aaa,
+
+bbb }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{aaa, bbb}
+
+`;
+
+exports[`long-key.yml 1`] = `
+{? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3,
+}
+
+`;
+
+exports[`long-key.yml 2`] = `
+{? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3,
+}
+
+`;
+
+exports[`long-key.yml 3`] = `
+{? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3,
+}
+
+`;
+
+exports[`long-key-long-value.yml 1`] = `
+{longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+}
+
+`;
+
+exports[`long-key-long-value.yml 2`] = `
+{longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+}
+
+`;
+
+exports[`long-key-long-value.yml 3`] = `
+{longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+}
+
+`;
+
+exports[`long-plain.yml 1`] = `
+{longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3,
+}
+
+`;
+
+exports[`long-plain.yml 2`] = `
+{longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3,
+}
+
+`;
+
+exports[`long-plain.yml 3`] = `
+{longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3,
+}
+
+`;
+
+exports[`long-value.yml 1`] = `
+{1: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,2: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,3: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ 1: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ 2: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ 3: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+}
+
+`;
+
+exports[`long-value.yml 2`] = `
+{1: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,2: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,3: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ 1: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ 2: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ 3: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+}
+
+`;
+
+exports[`long-value.yml 3`] = `
+{1: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,2: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,3: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ 1: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ 2: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ 3: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+}
+
+`;
+
+exports[`middle-comment.yml 1`] = `
+!!map #comment
+{}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map #comment
+{}
+
+`;
+
+exports[`middle-comment.yml 2`] = `
+!!map #comment
+{}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map #comment
+{}
+
+`;
+
+exports[`middle-comment.yml 3`] = `
+!!map #comment
+{}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map #comment
+{}
+
+`;
+
+exports[`middle-comments.yml 1`] = `
+!!map # comment 1
+# comment 2
+{}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map
+# comment 1
+# comment 2
+{}
+
+`;
+
+exports[`middle-comments.yml 2`] = `
+!!map # comment 1
+# comment 2
+{}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map
+# comment 1
+# comment 2
+{}
+
+`;
+
+exports[`middle-comments.yml 3`] = `
+!!map # comment 1
+# comment 2
+{}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map
+# comment 1
+# comment 2
+{}
+
+`;
+
+exports[`next-empty-line.yml 1`] = `
+{
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 123, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 123,
+
+c: 123
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 123,
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 123,
+
+ c: 123,
+}
+
+`;
+
+exports[`next-empty-line.yml 2`] = `
+{
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 123, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 123,
+
+c: 123
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 123,
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 123,
+
+ c: 123,
+}
+
+`;
+
+exports[`next-empty-line.yml 3`] = `
+{
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 123, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 123,
+
+c: 123
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 123,
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 123,
+
+ c: 123,
+}
+
+`;
+
+exports[`props.yml 1`] = `
+!!map &anchor {a: 1}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map &anchor { a: 1 }
+
+`;
+
+exports[`props.yml 2`] = `
+!!map &anchor {a: 1}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map &anchor { a: 1 }
+
+`;
+
+exports[`props.yml 3`] = `
+!!map &anchor {a: 1}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map &anchor {a: 1}
+
+`;
+
+exports[`props-in-map.yml 1`] = `
+a: !!map &anchor {a: 1}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: !!map &anchor { a: 1 }
+
+`;
+
+exports[`props-in-map.yml 2`] = `
+a: !!map &anchor {a: 1}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: !!map &anchor { a: 1 }
+
+`;
+
+exports[`props-in-map.yml 3`] = `
+a: !!map &anchor {a: 1}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: !!map &anchor {a: 1}
+
+`;
+
+exports[`short-key.yml 1`] = `
+{? 1,? 2,? 3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ 1, 2, 3 }
+
+`;
+
+exports[`short-key.yml 2`] = `
+{? 1,? 2,? 3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ 1, 2, 3 }
+
+`;
+
+exports[`short-key.yml 3`] = `
+{? 1,? 2,? 3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{1, 2, 3}
+
+`;
+
+exports[`short-key-short-value.yml 1`] = `
+{1: a,2: b,3: c}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ 1: a, 2: b, 3: c }
+
+`;
+
+exports[`short-key-short-value.yml 2`] = `
+{1: a,2: b,3: c}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ 1: a, 2: b, 3: c }
+
+`;
+
+exports[`short-key-short-value.yml 3`] = `
+{1: a,2: b,3: c}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{1: a, 2: b, 3: c}
+
+`;
+
+exports[`short-plain.yml 1`] = `
+{1,2,3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ 1, 2, 3 }
+
+`;
+
+exports[`short-plain.yml 2`] = `
+{1,2,3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ 1, 2, 3 }
+
+`;
+
+exports[`short-plain.yml 3`] = `
+{1,2,3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{1, 2, 3}
+
+`;
+
+exports[`short-value.yml 1`] = `
+{1: 1,2: 2,3: 3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ 1: 1, 2: 2, 3: 3 }
+
+`;
+
+exports[`short-value.yml 2`] = `
+{1: 1,2: 2,3: 3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ 1: 1, 2: 2, 3: 3 }
+
+`;
+
+exports[`short-value.yml 3`] = `
+{1: 1,2: 2,3: 3}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{1: 1, 2: 2, 3: 3}
+
+`;
diff --git a/tests/yaml_flow_mapping/alias-key.yml b/tests/yaml_flow_mapping/alias-key.yml
new file mode 100644
index 000000000..ab4a8d770
--- /dev/null
+++ b/tests/yaml_flow_mapping/alias-key.yml
@@ -0,0 +1 @@
+{*123 : 456}
diff --git a/tests/yaml_flow_mapping/array-key-array-value.yml b/tests/yaml_flow_mapping/array-key-array-value.yml
new file mode 100644
index 000000000..22d0b7b81
--- /dev/null
+++ b/tests/yaml_flow_mapping/array-key-array-value.yml
@@ -0,0 +1 @@
+{[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
diff --git a/tests/yaml_flow_mapping/array-key.yml b/tests/yaml_flow_mapping/array-key.yml
new file mode 100644
index 000000000..7bb482cdf
--- /dev/null
+++ b/tests/yaml_flow_mapping/array-key.yml
@@ -0,0 +1 @@
+{? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
diff --git a/tests/yaml_flow_mapping/array-plain.yml b/tests/yaml_flow_mapping/array-plain.yml
new file mode 100644
index 000000000..6907bf1ea
--- /dev/null
+++ b/tests/yaml_flow_mapping/array-plain.yml
@@ -0,0 +1 @@
+{[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
diff --git a/tests/yaml_flow_mapping/array-value.yml b/tests/yaml_flow_mapping/array-value.yml
new file mode 100644
index 000000000..bce7cf5d5
--- /dev/null
+++ b/tests/yaml_flow_mapping/array-value.yml
@@ -0,0 +1 @@
+{a: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],b: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],c: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]}
diff --git a/tests/yaml_flow_mapping/comment-between.yml b/tests/yaml_flow_mapping/comment-between.yml
new file mode 100644
index 000000000..8cec095d2
--- /dev/null
+++ b/tests/yaml_flow_mapping/comment-between.yml
@@ -0,0 +1,5 @@
+{
+? 123
+# comment
+: 456
+}
diff --git a/tests/yaml_flow_mapping/comment-trailing.yml b/tests/yaml_flow_mapping/comment-trailing.yml
new file mode 100644
index 000000000..56878725d
--- /dev/null
+++ b/tests/yaml_flow_mapping/comment-trailing.yml
@@ -0,0 +1,2 @@
+{123, # comment
+}
diff --git a/tests/yaml_flow_mapping/empty-item-colon.yml b/tests/yaml_flow_mapping/empty-item-colon.yml
new file mode 100644
index 000000000..d9443b760
--- /dev/null
+++ b/tests/yaml_flow_mapping/empty-item-colon.yml
@@ -0,0 +1 @@
+{ : }
diff --git a/tests/yaml_flow_mapping/empty-line-collapse.yml b/tests/yaml_flow_mapping/empty-line-collapse.yml
new file mode 100644
index 000000000..9398cbdc9
--- /dev/null
+++ b/tests/yaml_flow_mapping/empty-line-collapse.yml
@@ -0,0 +1,3 @@
+{ aaa,
+
+bbb }
diff --git a/tests/yaml_flow_mapping/empty-line.yml b/tests/yaml_flow_mapping/empty-line.yml
new file mode 100644
index 000000000..2789d358a
--- /dev/null
+++ b/tests/yaml_flow_mapping/empty-line.yml
@@ -0,0 +1,3 @@
+{ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb }
diff --git a/tests/yaml_flow_mapping/empty.yml b/tests/yaml_flow_mapping/empty.yml
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/tests/yaml_flow_mapping/empty.yml
@@ -0,0 +1 @@
+{}
diff --git a/tests/yaml_flow_mapping/jsfmt.spec.js b/tests/yaml_flow_mapping/jsfmt.spec.js
new file mode 100644
index 000000000..755b6ecb2
--- /dev/null
+++ b/tests/yaml_flow_mapping/jsfmt.spec.js
@@ -0,0 +1,3 @@
+run_spec(__dirname, ["yaml"]);
+run_spec(__dirname, ["yaml"], { tabWidth: 4 });
+run_spec(__dirname, ["yaml"], { bracketSpacing: false });
diff --git a/tests/yaml_flow_mapping/long-key-long-value.yml b/tests/yaml_flow_mapping/long-key-long-value.yml
new file mode 100644
index 000000000..f5921c46e
--- /dev/null
+++ b/tests/yaml_flow_mapping/long-key-long-value.yml
@@ -0,0 +1 @@
+{longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong}
diff --git a/tests/yaml_flow_mapping/long-key.yml b/tests/yaml_flow_mapping/long-key.yml
new file mode 100644
index 000000000..19135a815
--- /dev/null
+++ b/tests/yaml_flow_mapping/long-key.yml
@@ -0,0 +1 @@
+{? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3}
diff --git a/tests/yaml_flow_mapping/long-plain.yml b/tests/yaml_flow_mapping/long-plain.yml
new file mode 100644
index 000000000..7440de92d
--- /dev/null
+++ b/tests/yaml_flow_mapping/long-plain.yml
@@ -0,0 +1 @@
+{longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong1,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong2,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong3}
diff --git a/tests/yaml_flow_mapping/long-value.yml b/tests/yaml_flow_mapping/long-value.yml
new file mode 100644
index 000000000..eeea6f2d7
--- /dev/null
+++ b/tests/yaml_flow_mapping/long-value.yml
@@ -0,0 +1 @@
+{1: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,2: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,3: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong}
diff --git a/tests/yaml_flow_mapping/middle-comment.yml b/tests/yaml_flow_mapping/middle-comment.yml
new file mode 100644
index 000000000..2074e9048
--- /dev/null
+++ b/tests/yaml_flow_mapping/middle-comment.yml
@@ -0,0 +1,2 @@
+!!map #comment
+{}
diff --git a/tests/yaml_flow_mapping/middle-comments.yml b/tests/yaml_flow_mapping/middle-comments.yml
new file mode 100644
index 000000000..039a8b561
--- /dev/null
+++ b/tests/yaml_flow_mapping/middle-comments.yml
@@ -0,0 +1,3 @@
+!!map # comment 1
+# comment 2
+{}
diff --git a/tests/yaml_flow_mapping/next-empty-line.yml b/tests/yaml_flow_mapping/next-empty-line.yml
new file mode 100644
index 000000000..8c2062e19
--- /dev/null
+++ b/tests/yaml_flow_mapping/next-empty-line.yml
@@ -0,0 +1,5 @@
+{
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 123, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 123,
+
+c: 123
+}
diff --git a/tests/yaml_flow_mapping/props-in-map.yml b/tests/yaml_flow_mapping/props-in-map.yml
new file mode 100644
index 000000000..c3f92c48d
--- /dev/null
+++ b/tests/yaml_flow_mapping/props-in-map.yml
@@ -0,0 +1 @@
+a: !!map &anchor {a: 1}
diff --git a/tests/yaml_flow_mapping/props.yml b/tests/yaml_flow_mapping/props.yml
new file mode 100644
index 000000000..941a67430
--- /dev/null
+++ b/tests/yaml_flow_mapping/props.yml
@@ -0,0 +1 @@
+!!map &anchor {a: 1}
diff --git a/tests/yaml_flow_mapping/short-key-short-value.yml b/tests/yaml_flow_mapping/short-key-short-value.yml
new file mode 100644
index 000000000..97d7cd8d4
--- /dev/null
+++ b/tests/yaml_flow_mapping/short-key-short-value.yml
@@ -0,0 +1 @@
+{1: a,2: b,3: c}
diff --git a/tests/yaml_flow_mapping/short-key.yml b/tests/yaml_flow_mapping/short-key.yml
new file mode 100644
index 000000000..0b8c097c4
--- /dev/null
+++ b/tests/yaml_flow_mapping/short-key.yml
@@ -0,0 +1 @@
+{? 1,? 2,? 3}
diff --git a/tests/yaml_flow_mapping/short-plain.yml b/tests/yaml_flow_mapping/short-plain.yml
new file mode 100644
index 000000000..aeb3842cb
--- /dev/null
+++ b/tests/yaml_flow_mapping/short-plain.yml
@@ -0,0 +1 @@
+{1,2,3}
diff --git a/tests/yaml_flow_mapping/short-value.yml b/tests/yaml_flow_mapping/short-value.yml
new file mode 100644
index 000000000..cab19226b
--- /dev/null
+++ b/tests/yaml_flow_mapping/short-value.yml
@@ -0,0 +1 @@
+{1: 1,2: 2,3: 3}
diff --git a/tests/yaml_flow_sequence/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_flow_sequence/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..fee4bef58
--- /dev/null
+++ b/tests/yaml_flow_sequence/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,904 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`alias-key.yml 1`] = `
+[*123 : 456]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[*123 : 456]
+
+`;
+
+exports[`alias-key.yml 2`] = `
+[*123 : 456]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[*123 : 456]
+
+`;
+
+exports[`alias-key.yml 3`] = `
+[*123 : 456]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[*123 : 456]
+
+`;
+
+exports[`array-key.yml 1`] = `
+[? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+]
+
+`;
+
+exports[`array-key.yml 2`] = `
+[? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+]
+
+`;
+
+exports[`array-key.yml 3`] = `
+[? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+]
+
+`;
+
+exports[`array-key-array-value.yml 1`] = `
+[[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+]
+
+`;
+
+exports[`array-key-array-value.yml 2`] = `
+[[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+]
+
+`;
+
+exports[`array-key-array-value.yml 3`] = `
+[[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ ? [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ]
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+]
+
+`;
+
+exports[`array-plain.yml 1`] = `
+[[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+]
+
+`;
+
+exports[`array-plain.yml 2`] = `
+[[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+]
+
+`;
+
+exports[`array-plain.yml 3`] = `
+[[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+]
+
+`;
+
+exports[`array-value.yml 1`] = `
+[: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+]
+
+`;
+
+exports[`array-value.yml 2`] = `
+[: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+]
+
+`;
+
+exports[`array-value.yml 3`] = `
+[: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+ : [
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglong,
+ ],
+]
+
+`;
+
+exports[`comment-between.yml 1`] = `
+[
+? 123
+# comment
+: 456
+]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ ? 123
+ # comment
+ : 456,
+]
+
+`;
+
+exports[`comment-between.yml 2`] = `
+[
+? 123
+# comment
+: 456
+]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ ? 123
+ # comment
+ : 456,
+]
+
+`;
+
+exports[`comment-between.yml 3`] = `
+[
+? 123
+# comment
+: 456
+]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ ? 123
+ # comment
+ : 456,
+]
+
+`;
+
+exports[`comment-trailing.yml 1`] = `
+[123, # comment
+]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ 123, # comment
+]
+
+`;
+
+exports[`comment-trailing.yml 2`] = `
+[123, # comment
+]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ 123, # comment
+]
+
+`;
+
+exports[`comment-trailing.yml 3`] = `
+[123, # comment
+]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ 123, # comment
+]
+
+`;
+
+exports[`empty.yml 1`] = `
+[]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[]
+
+`;
+
+exports[`empty.yml 2`] = `
+[]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[]
+
+`;
+
+exports[`empty.yml 3`] = `
+[]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[]
+
+`;
+
+exports[`empty-item-colon.yml 1`] = `
+[ : ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[: ]
+
+`;
+
+exports[`empty-item-colon.yml 2`] = `
+[ : ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[: ]
+
+`;
+
+exports[`empty-item-colon.yml 3`] = `
+[ : ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[: ]
+
+`;
+
+exports[`empty-line.yml 1`] = `
+[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+]
+
+`;
+
+exports[`empty-line.yml 2`] = `
+[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+]
+
+`;
+
+exports[`empty-line.yml 3`] = `
+[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,
+]
+
+`;
+
+exports[`empty-line-collapse.yml 1`] = `
+[ aaa,
+
+bbb ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[aaa, bbb]
+
+`;
+
+exports[`empty-line-collapse.yml 2`] = `
+[ aaa,
+
+bbb ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[aaa, bbb]
+
+`;
+
+exports[`empty-line-collapse.yml 3`] = `
+[ aaa,
+
+bbb ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[aaa, bbb]
+
+`;
+
+exports[`long-key.yml 1`] = `
+[? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ ? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ ? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ ? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+]
+
+`;
+
+exports[`long-key.yml 2`] = `
+[? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ ? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ ? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ ? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+]
+
+`;
+
+exports[`long-key.yml 3`] = `
+[? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ ? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ ? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ ? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+]
+
+`;
+
+exports[`long-key-long-value.yml 1`] = `
+[longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+]
+
+`;
+
+exports[`long-key-long-value.yml 2`] = `
+[longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+]
+
+`;
+
+exports[`long-key-long-value.yml 3`] = `
+[longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+]
+
+`;
+
+exports[`long-plain.yml 1`] = `
+[longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+]
+
+`;
+
+exports[`long-plain.yml 2`] = `
+[longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+]
+
+`;
+
+exports[`long-plain.yml 3`] = `
+[longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+]
+
+`;
+
+exports[`long-value.yml 1`] = `
+[: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ : longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ : longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ : longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+]
+
+`;
+
+exports[`long-value.yml 2`] = `
+[: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ : longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ : longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ : longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+]
+
+`;
+
+exports[`long-value.yml 3`] = `
+[: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ : longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ : longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+ : longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,
+]
+
+`;
+
+exports[`middle-comment.yml 1`] = `
+!!set # comment
+[]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set # comment
+[]
+
+`;
+
+exports[`middle-comment.yml 2`] = `
+!!set # comment
+[]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set # comment
+[]
+
+`;
+
+exports[`middle-comment.yml 3`] = `
+!!set # comment
+[]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set # comment
+[]
+
+`;
+
+exports[`middle-comments.yml 1`] = `
+!!set # comment 1
+# comment 2
+[]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set
+# comment 1
+# comment 2
+[]
+
+`;
+
+exports[`middle-comments.yml 2`] = `
+!!set # comment 1
+# comment 2
+[]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set
+# comment 1
+# comment 2
+[]
+
+`;
+
+exports[`middle-comments.yml 3`] = `
+!!set # comment 1
+# comment 2
+[]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set
+# comment 1
+# comment 2
+[]
+
+`;
+
+exports[`next-empty-line.yml 1`] = `
+[
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 123, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 123,
+
+c: 123
+]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 123,
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 123,
+
+ c: 123,
+]
+
+`;
+
+exports[`next-empty-line.yml 2`] = `
+[
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 123, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 123,
+
+c: 123
+]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 123,
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 123,
+
+ c: 123,
+]
+
+`;
+
+exports[`next-empty-line.yml 3`] = `
+[
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 123, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 123,
+
+c: 123
+]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 123,
+ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 123,
+
+ c: 123,
+]
+
+`;
+
+exports[`props.yml 1`] = `
+!!set &anchor [1]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set &anchor [1]
+
+`;
+
+exports[`props.yml 2`] = `
+!!set &anchor [1]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set &anchor [1]
+
+`;
+
+exports[`props.yml 3`] = `
+!!set &anchor [1]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set &anchor [1]
+
+`;
+
+exports[`props-in-map.yml 1`] = `
+a: !!set &anchor [1]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: !!set &anchor [1]
+
+`;
+
+exports[`props-in-map.yml 2`] = `
+a: !!set &anchor [1]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: !!set &anchor [1]
+
+`;
+
+exports[`props-in-map.yml 3`] = `
+a: !!set &anchor [1]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: !!set &anchor [1]
+
+`;
+
+exports[`short-key.yml 1`] = `
+[? 1,? 2,? 3]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[? 1, ? 2, ? 3]
+
+`;
+
+exports[`short-key.yml 2`] = `
+[? 1,? 2,? 3]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[? 1, ? 2, ? 3]
+
+`;
+
+exports[`short-key.yml 3`] = `
+[? 1,? 2,? 3]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[? 1, ? 2, ? 3]
+
+`;
+
+exports[`short-key-short-value.yml 1`] = `
+[1: a,2: b,3: c]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[1: a, 2: b, 3: c]
+
+`;
+
+exports[`short-key-short-value.yml 2`] = `
+[1: a,2: b,3: c]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[1: a, 2: b, 3: c]
+
+`;
+
+exports[`short-key-short-value.yml 3`] = `
+[1: a,2: b,3: c]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[1: a, 2: b, 3: c]
+
+`;
+
+exports[`short-plain.yml 1`] = `
+[1,2,3]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[1, 2, 3]
+
+`;
+
+exports[`short-plain.yml 2`] = `
+[1,2,3]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[1, 2, 3]
+
+`;
+
+exports[`short-plain.yml 3`] = `
+[1,2,3]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[1, 2, 3]
+
+`;
+
+exports[`short-value.yml 1`] = `
+[: 1,: 2,: 3]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[: 1, : 2, : 3]
+
+`;
+
+exports[`short-value.yml 2`] = `
+[: 1,: 2,: 3]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[: 1, : 2, : 3]
+
+`;
+
+exports[`short-value.yml 3`] = `
+[: 1,: 2,: 3]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[: 1, : 2, : 3]
+
+`;
diff --git a/tests/yaml_flow_sequence/alias-key.yml b/tests/yaml_flow_sequence/alias-key.yml
new file mode 100644
index 000000000..9241a61bf
--- /dev/null
+++ b/tests/yaml_flow_sequence/alias-key.yml
@@ -0,0 +1 @@
+[*123 : 456]
diff --git a/tests/yaml_flow_sequence/array-key-array-value.yml b/tests/yaml_flow_sequence/array-key-array-value.yml
new file mode 100644
index 000000000..975846f26
--- /dev/null
+++ b/tests/yaml_flow_sequence/array-key-array-value.yml
@@ -0,0 +1 @@
+[[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
diff --git a/tests/yaml_flow_sequence/array-key.yml b/tests/yaml_flow_sequence/array-key.yml
new file mode 100644
index 000000000..acdd04899
--- /dev/null
+++ b/tests/yaml_flow_sequence/array-key.yml
@@ -0,0 +1 @@
+[? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],? [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
diff --git a/tests/yaml_flow_sequence/array-plain.yml b/tests/yaml_flow_sequence/array-plain.yml
new file mode 100644
index 000000000..9e83cd6be
--- /dev/null
+++ b/tests/yaml_flow_sequence/array-plain.yml
@@ -0,0 +1 @@
+[[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],[longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
diff --git a/tests/yaml_flow_sequence/array-value.yml b/tests/yaml_flow_sequence/array-value.yml
new file mode 100644
index 000000000..dd4a34a5c
--- /dev/null
+++ b/tests/yaml_flow_sequence/array-value.yml
@@ -0,0 +1 @@
+[: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong],: [longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong, longlonglonglonglonglonglonglonglonglonglong]]
diff --git a/tests/yaml_flow_sequence/comment-between.yml b/tests/yaml_flow_sequence/comment-between.yml
new file mode 100644
index 000000000..a82146edc
--- /dev/null
+++ b/tests/yaml_flow_sequence/comment-between.yml
@@ -0,0 +1,5 @@
+[
+? 123
+# comment
+: 456
+]
diff --git a/tests/yaml_flow_sequence/comment-trailing.yml b/tests/yaml_flow_sequence/comment-trailing.yml
new file mode 100644
index 000000000..37cb4e3ea
--- /dev/null
+++ b/tests/yaml_flow_sequence/comment-trailing.yml
@@ -0,0 +1,2 @@
+[123, # comment
+]
diff --git a/tests/yaml_flow_sequence/empty-item-colon.yml b/tests/yaml_flow_sequence/empty-item-colon.yml
new file mode 100644
index 000000000..b0d191d9f
--- /dev/null
+++ b/tests/yaml_flow_sequence/empty-item-colon.yml
@@ -0,0 +1 @@
+[ : ]
diff --git a/tests/yaml_flow_sequence/empty-line-collapse.yml b/tests/yaml_flow_sequence/empty-line-collapse.yml
new file mode 100644
index 000000000..82d4640de
--- /dev/null
+++ b/tests/yaml_flow_sequence/empty-line-collapse.yml
@@ -0,0 +1,3 @@
+[ aaa,
+
+bbb ]
diff --git a/tests/yaml_flow_sequence/empty-line.yml b/tests/yaml_flow_sequence/empty-line.yml
new file mode 100644
index 000000000..197b572a8
--- /dev/null
+++ b/tests/yaml_flow_sequence/empty-line.yml
@@ -0,0 +1,3 @@
+[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ]
diff --git a/tests/yaml_flow_sequence/empty.yml b/tests/yaml_flow_sequence/empty.yml
new file mode 100644
index 000000000..fe51488c7
--- /dev/null
+++ b/tests/yaml_flow_sequence/empty.yml
@@ -0,0 +1 @@
+[]
diff --git a/tests/yaml_flow_sequence/jsfmt.spec.js b/tests/yaml_flow_sequence/jsfmt.spec.js
new file mode 100644
index 000000000..755b6ecb2
--- /dev/null
+++ b/tests/yaml_flow_sequence/jsfmt.spec.js
@@ -0,0 +1,3 @@
+run_spec(__dirname, ["yaml"]);
+run_spec(__dirname, ["yaml"], { tabWidth: 4 });
+run_spec(__dirname, ["yaml"], { bracketSpacing: false });
diff --git a/tests/yaml_flow_sequence/long-key-long-value.yml b/tests/yaml_flow_sequence/long-key-long-value.yml
new file mode 100644
index 000000000..f0dd645df
--- /dev/null
+++ b/tests/yaml_flow_sequence/long-key-long-value.yml
@@ -0,0 +1 @@
+[longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
diff --git a/tests/yaml_flow_sequence/long-key.yml b/tests/yaml_flow_sequence/long-key.yml
new file mode 100644
index 000000000..38f6cb9c8
--- /dev/null
+++ b/tests/yaml_flow_sequence/long-key.yml
@@ -0,0 +1 @@
+[? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
diff --git a/tests/yaml_flow_sequence/long-plain.yml b/tests/yaml_flow_sequence/long-plain.yml
new file mode 100644
index 000000000..cfc490322
--- /dev/null
+++ b/tests/yaml_flow_sequence/long-plain.yml
@@ -0,0 +1 @@
+[longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
diff --git a/tests/yaml_flow_sequence/long-value.yml b/tests/yaml_flow_sequence/long-value.yml
new file mode 100644
index 000000000..0182a7629
--- /dev/null
+++ b/tests/yaml_flow_sequence/long-value.yml
@@ -0,0 +1 @@
+[: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong,: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglong]
diff --git a/tests/yaml_flow_sequence/middle-comment.yml b/tests/yaml_flow_sequence/middle-comment.yml
new file mode 100644
index 000000000..750026a36
--- /dev/null
+++ b/tests/yaml_flow_sequence/middle-comment.yml
@@ -0,0 +1,2 @@
+!!set # comment
+[]
diff --git a/tests/yaml_flow_sequence/middle-comments.yml b/tests/yaml_flow_sequence/middle-comments.yml
new file mode 100644
index 000000000..49fd042fe
--- /dev/null
+++ b/tests/yaml_flow_sequence/middle-comments.yml
@@ -0,0 +1,3 @@
+!!set # comment 1
+# comment 2
+[]
diff --git a/tests/yaml_flow_sequence/next-empty-line.yml b/tests/yaml_flow_sequence/next-empty-line.yml
new file mode 100644
index 000000000..7b9b99574
--- /dev/null
+++ b/tests/yaml_flow_sequence/next-empty-line.yml
@@ -0,0 +1,5 @@
+[
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 123, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 123,
+
+c: 123
+]
diff --git a/tests/yaml_flow_sequence/props-in-map.yml b/tests/yaml_flow_sequence/props-in-map.yml
new file mode 100644
index 000000000..d9a26a25f
--- /dev/null
+++ b/tests/yaml_flow_sequence/props-in-map.yml
@@ -0,0 +1 @@
+a: !!set &anchor [1]
diff --git a/tests/yaml_flow_sequence/props.yml b/tests/yaml_flow_sequence/props.yml
new file mode 100644
index 000000000..a00c99682
--- /dev/null
+++ b/tests/yaml_flow_sequence/props.yml
@@ -0,0 +1 @@
+!!set &anchor [1]
diff --git a/tests/yaml_flow_sequence/short-key-short-value.yml b/tests/yaml_flow_sequence/short-key-short-value.yml
new file mode 100644
index 000000000..070fcfdf9
--- /dev/null
+++ b/tests/yaml_flow_sequence/short-key-short-value.yml
@@ -0,0 +1 @@
+[1: a,2: b,3: c]
diff --git a/tests/yaml_flow_sequence/short-key.yml b/tests/yaml_flow_sequence/short-key.yml
new file mode 100644
index 000000000..9f48acb76
--- /dev/null
+++ b/tests/yaml_flow_sequence/short-key.yml
@@ -0,0 +1 @@
+[? 1,? 2,? 3]
diff --git a/tests/yaml_flow_sequence/short-plain.yml b/tests/yaml_flow_sequence/short-plain.yml
new file mode 100644
index 000000000..3cc0ecbed
--- /dev/null
+++ b/tests/yaml_flow_sequence/short-plain.yml
@@ -0,0 +1 @@
+[1,2,3]
diff --git a/tests/yaml_flow_sequence/short-value.yml b/tests/yaml_flow_sequence/short-value.yml
new file mode 100644
index 000000000..2c6573a9e
--- /dev/null
+++ b/tests/yaml_flow_sequence/short-value.yml
@@ -0,0 +1 @@
+[: 1,: 2,: 3]
diff --git a/tests/yaml_insert_pragma/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_insert_pragma/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..cd7cc9d48
--- /dev/null
+++ b/tests/yaml_insert_pragma/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,23 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`with-pragma.yml 1`] = `
+# @prettier
+
+ 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# @prettier
+
+123
+
+`;
+
+exports[`without-pragma.yml 1`] = `
+
+
+ 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# @format
+
+123
+
+`;
diff --git a/tests/yaml_insert_pragma/jsfmt.spec.js b/tests/yaml_insert_pragma/jsfmt.spec.js
new file mode 100644
index 000000000..06adadff2
--- /dev/null
+++ b/tests/yaml_insert_pragma/jsfmt.spec.js
@@ -0,0 +1 @@
+run_spec(__dirname, ["yaml"], { insertPragma: true });
diff --git a/tests/yaml_insert_pragma/with-pragma.yml b/tests/yaml_insert_pragma/with-pragma.yml
new file mode 100644
index 000000000..d47b12639
--- /dev/null
+++ b/tests/yaml_insert_pragma/with-pragma.yml
@@ -0,0 +1,3 @@
+# @prettier
+
+ 123
diff --git a/tests/yaml_insert_pragma/without-pragma.yml b/tests/yaml_insert_pragma/without-pragma.yml
new file mode 100644
index 000000000..c4a580e43
--- /dev/null
+++ b/tests/yaml_insert_pragma/without-pragma.yml
@@ -0,0 +1,3 @@
+
+
+ 123
diff --git a/tests/yaml_mapping/3-style.yml b/tests/yaml_mapping/3-style.yml
new file mode 100644
index 000000000..84d94f387
--- /dev/null
+++ b/tests/yaml_mapping/3-style.yml
@@ -0,0 +1,5 @@
+[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
diff --git a/tests/yaml_mapping/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_mapping/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..1c4343ec6
--- /dev/null
+++ b/tests/yaml_mapping/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,343 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`3-style.yml 1`] = `
+[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]:
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+? [
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+ ]
+: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+`;
+
+exports[`3-style.yml 2`] = `
+[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]:
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+? [
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
+ ]
+: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+`;
+
+exports[`array-key.yml 1`] = `
+[1, 2, 3]: 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[1, 2, 3]: 123
+
+`;
+
+exports[`array-key.yml 2`] = `
+[1, 2, 3]: 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[1, 2, 3]: 123
+
+`;
+
+exports[`array-value.yml 1`] = `
+123: [1, 2, 3]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+123: [1, 2, 3]
+
+`;
+
+exports[`array-value.yml 2`] = `
+123: [1, 2, 3]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+123: [1, 2, 3]
+
+`;
+
+exports[`comment.yml 1`] = `
+? key
+# comment
+: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+? key
+# comment
+: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+
+`;
+
+exports[`comment.yml 2`] = `
+? key
+# comment
+: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+? key
+# comment
+: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+
+`;
+
+exports[`comment-value.yml 1`] = `
+123: # hello
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+123: # hello
+
+`;
+
+exports[`comment-value.yml 2`] = `
+123: # hello
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+123: # hello
+
+`;
+
+exports[`common.yml 1`] = `
+key1: value
+key2: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+key1: value
+key2:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+
+`;
+
+exports[`common.yml 2`] = `
+key1: value
+key2: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+key1: value
+key2:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+
+`;
+
+exports[`explicit-key.yml 1`] = `
+? key1
+: value
+? key2
+: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+: value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+key1: value
+key2:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+: value
+
+`;
+
+exports[`explicit-key.yml 2`] = `
+? key1
+: value
+? key2
+: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+: value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+key1: value
+key2:
+ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+: value
+
+`;
+
+exports[`in-sequence.yml 1`] = `
+- a: b
+ c: d
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- a: b
+ c: d
+
+`;
+
+exports[`in-sequence.yml 2`] = `
+- a: b
+ c: d
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- a: b
+ c: d
+
+`;
+
+exports[`key-with-leading-comment.yml 1`] = `
+? # comment
+ key
+: value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+? # comment
+ key
+: value
+
+`;
+
+exports[`key-with-leading-comment.yml 2`] = `
+? # comment
+ key
+: value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+? # comment
+ key
+: value
+
+`;
+
+exports[`mapping.yml 1`] = `
+key:
+ key: value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+key:
+ key: value
+
+`;
+
+exports[`mapping.yml 2`] = `
+key:
+ key: value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+key:
+ key: value
+
+`;
+
+exports[`middle-comment.yml 1`] = `
+!!map # comment
+a: 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map # comment
+a: 123
+
+`;
+
+exports[`middle-comment.yml 2`] = `
+!!map # comment
+a: 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map # comment
+a: 123
+
+`;
+
+exports[`middle-comments.yml 1`] = `
+!!map # comment 1
+# comment 2
+a: 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map
+# comment 1
+# comment 2
+a: 123
+
+`;
+
+exports[`middle-comments.yml 2`] = `
+!!map # comment 1
+# comment 2
+a: 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map
+# comment 1
+# comment 2
+a: 123
+
+`;
+
+exports[`props.yml 1`] = `
+--- !!map &anchor
+a: 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map &anchor
+a: 123
+
+`;
+
+exports[`props.yml 2`] = `
+--- !!map &anchor
+a: 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map &anchor
+a: 123
+
+`;
+
+exports[`props-in-map.yml 1`] = `
+a: !!map &anchor
+ a: 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: !!map &anchor
+ a: 123
+
+`;
+
+exports[`props-in-map.yml 2`] = `
+a: !!map &anchor
+ a: 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: !!map &anchor
+ a: 123
+
+`;
+
+exports[`quote-key.yml 1`] = `
+"a": 123
+'b': 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"a": 123
+"b": 123
+
+`;
+
+exports[`quote-key.yml 2`] = `
+"a": 123
+'b': 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"a": 123
+"b": 123
+
+`;
+
+exports[`sequence.yml 1`] = `
+key:
+- value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+key:
+ - value
+
+`;
+
+exports[`sequence.yml 2`] = `
+key:
+- value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+key:
+ - value
+
+`;
+
+exports[`tag-key.yml 1`] = `
+? !!tag key
+: value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!tag key: value
+
+`;
+
+exports[`tag-key.yml 2`] = `
+? !!tag key
+: value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!tag key: value
+
+`;
diff --git a/tests/yaml_mapping/array-key.yml b/tests/yaml_mapping/array-key.yml
new file mode 100644
index 000000000..36f8b236f
--- /dev/null
+++ b/tests/yaml_mapping/array-key.yml
@@ -0,0 +1 @@
+[1, 2, 3]: 123
diff --git a/tests/yaml_mapping/array-value.yml b/tests/yaml_mapping/array-value.yml
new file mode 100644
index 000000000..eba0b28b2
--- /dev/null
+++ b/tests/yaml_mapping/array-value.yml
@@ -0,0 +1 @@
+123: [1, 2, 3]
diff --git a/tests/yaml_mapping/comment-value.yml b/tests/yaml_mapping/comment-value.yml
new file mode 100644
index 000000000..947fb1848
--- /dev/null
+++ b/tests/yaml_mapping/comment-value.yml
@@ -0,0 +1 @@
+123: # hello
diff --git a/tests/yaml_mapping/comment.yml b/tests/yaml_mapping/comment.yml
new file mode 100644
index 000000000..a0315b226
--- /dev/null
+++ b/tests/yaml_mapping/comment.yml
@@ -0,0 +1,3 @@
+? key
+# comment
+: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
diff --git a/tests/yaml_mapping/common.yml b/tests/yaml_mapping/common.yml
new file mode 100644
index 000000000..0850fdc12
--- /dev/null
+++ b/tests/yaml_mapping/common.yml
@@ -0,0 +1,2 @@
+key1: value
+key2: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
diff --git a/tests/yaml_mapping/explicit-key.yml b/tests/yaml_mapping/explicit-key.yml
new file mode 100644
index 000000000..3223ef8eb
--- /dev/null
+++ b/tests/yaml_mapping/explicit-key.yml
@@ -0,0 +1,6 @@
+? key1
+: value
+? key2
+: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+? longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong
+: value
diff --git a/tests/yaml_mapping/in-sequence.yml b/tests/yaml_mapping/in-sequence.yml
new file mode 100644
index 000000000..281baf376
--- /dev/null
+++ b/tests/yaml_mapping/in-sequence.yml
@@ -0,0 +1,2 @@
+- a: b
+ c: d
diff --git a/tests/yaml_mapping/jsfmt.spec.js b/tests/yaml_mapping/jsfmt.spec.js
new file mode 100644
index 000000000..6fbe16994
--- /dev/null
+++ b/tests/yaml_mapping/jsfmt.spec.js
@@ -0,0 +1,2 @@
+run_spec(__dirname, ["yaml"]);
+run_spec(__dirname, ["yaml"], { tabWidth: 4 });
diff --git a/tests/yaml_mapping/key-with-leading-comment.yml b/tests/yaml_mapping/key-with-leading-comment.yml
new file mode 100644
index 000000000..10181ee5b
--- /dev/null
+++ b/tests/yaml_mapping/key-with-leading-comment.yml
@@ -0,0 +1,3 @@
+? # comment
+ key
+: value
diff --git a/tests/yaml_mapping/mapping.yml b/tests/yaml_mapping/mapping.yml
new file mode 100644
index 000000000..8ffdfbfbf
--- /dev/null
+++ b/tests/yaml_mapping/mapping.yml
@@ -0,0 +1,2 @@
+key:
+ key: value
diff --git a/tests/yaml_mapping/middle-comment.yml b/tests/yaml_mapping/middle-comment.yml
new file mode 100644
index 000000000..43939e00c
--- /dev/null
+++ b/tests/yaml_mapping/middle-comment.yml
@@ -0,0 +1,2 @@
+!!map # comment
+a: 123
diff --git a/tests/yaml_mapping/middle-comments.yml b/tests/yaml_mapping/middle-comments.yml
new file mode 100644
index 000000000..6fe49e2bb
--- /dev/null
+++ b/tests/yaml_mapping/middle-comments.yml
@@ -0,0 +1,3 @@
+!!map # comment 1
+# comment 2
+a: 123
diff --git a/tests/yaml_mapping/props-in-map.yml b/tests/yaml_mapping/props-in-map.yml
new file mode 100644
index 000000000..8e3256656
--- /dev/null
+++ b/tests/yaml_mapping/props-in-map.yml
@@ -0,0 +1,2 @@
+a: !!map &anchor
+ a: 123
diff --git a/tests/yaml_mapping/props.yml b/tests/yaml_mapping/props.yml
new file mode 100644
index 000000000..14ffdfd3a
--- /dev/null
+++ b/tests/yaml_mapping/props.yml
@@ -0,0 +1,2 @@
+--- !!map &anchor
+a: 123
diff --git a/tests/yaml_mapping/quote-key.yml b/tests/yaml_mapping/quote-key.yml
new file mode 100644
index 000000000..d3c5d78b7
--- /dev/null
+++ b/tests/yaml_mapping/quote-key.yml
@@ -0,0 +1,2 @@
+"a": 123
+'b': 123
diff --git a/tests/yaml_mapping/sequence.yml b/tests/yaml_mapping/sequence.yml
new file mode 100644
index 000000000..f759dad34
--- /dev/null
+++ b/tests/yaml_mapping/sequence.yml
@@ -0,0 +1,2 @@
+key:
+- value
diff --git a/tests/yaml_mapping/tag-key.yml b/tests/yaml_mapping/tag-key.yml
new file mode 100644
index 000000000..7a035a82a
--- /dev/null
+++ b/tests/yaml_mapping/tag-key.yml
@@ -0,0 +1,2 @@
+? !!tag key
+: value
diff --git a/tests/yaml_plain/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_plain/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..4053273da
--- /dev/null
+++ b/tests/yaml_plain/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,36 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`middle-comment.yml 1`] = `
+!!str # comment
+hello
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!str # comment
+hello
+
+`;
+
+exports[`middle-comments.yml 1`] = `
+!!str # comment 1
+# comment 2
+hello
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!str
+# comment 1
+# comment 2
+hello
+
+`;
+
+exports[`true.yml 1`] = `
+hello
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+hello
+
+`;
+
+exports[`verbatim.yml 1`] = `
+! hello
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+! hello
+
+`;
diff --git a/tests/yaml_plain/jsfmt.spec.js b/tests/yaml_plain/jsfmt.spec.js
new file mode 100644
index 000000000..89d18c007
--- /dev/null
+++ b/tests/yaml_plain/jsfmt.spec.js
@@ -0,0 +1 @@
+run_spec(__dirname, ["yaml"]);
diff --git a/tests/yaml_plain/middle-comment.yml b/tests/yaml_plain/middle-comment.yml
new file mode 100644
index 000000000..2cdd038af
--- /dev/null
+++ b/tests/yaml_plain/middle-comment.yml
@@ -0,0 +1,2 @@
+!!str # comment
+hello
diff --git a/tests/yaml_plain/middle-comments.yml b/tests/yaml_plain/middle-comments.yml
new file mode 100644
index 000000000..10b3684ee
--- /dev/null
+++ b/tests/yaml_plain/middle-comments.yml
@@ -0,0 +1,3 @@
+!!str # comment 1
+# comment 2
+hello
diff --git a/tests/yaml_plain/true.yml b/tests/yaml_plain/true.yml
new file mode 100644
index 000000000..ce0136250
--- /dev/null
+++ b/tests/yaml_plain/true.yml
@@ -0,0 +1 @@
+hello
diff --git a/tests/yaml_plain/verbatim.yml b/tests/yaml_plain/verbatim.yml
new file mode 100644
index 000000000..ad31ffe42
--- /dev/null
+++ b/tests/yaml_plain/verbatim.yml
@@ -0,0 +1 @@
+! hello
diff --git a/tests/yaml_prettier_ignore/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_prettier_ignore/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..b3c6f61b0
--- /dev/null
+++ b/tests/yaml_prettier_ignore/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,79 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`document.yml 1`] = `
+# prettier-ignore
+---
+aaaaa:
+ bbbbb
+...
+aaaaa:
+ bbbbb
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# prettier-ignore
+---
+aaaaa:
+ bbbbb
+...
+aaaaa: bbbbb
+
+`;
+
+exports[`leading-comment.yml 1`] = `
+abc: 123
+# prettier-ignore
+def: 456
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+abc: 123
+# prettier-ignore
+def: 456
+
+`;
+
+exports[`middle-comment.yml 1`] = `
+abc: !!str # hello
+ 123
+# prettier-ignore
+def: !!str # hello
+ 456
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+abc: !!str # hello
+ 123
+# prettier-ignore
+def: !!str # hello
+ 456
+
+`;
+
+exports[`trailing-comma.yml 1`] = `
+[
+ # prettier-ignore
+ { sss }, # 123
+ { qqqq },
+
+ # prettier-ignore
+ [ccc ] # 777
+ , [ddd ]
+]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ # prettier-ignore
+ { sss }, # 123
+ { qqqq },
+
+ # prettier-ignore
+ [ccc ], # 777
+ [ddd],
+]
+
+`;
+
+exports[`trailing-comment.yml 1`] = `
+abc: 123 # hello
+# prettier-ignore
+def: 456 # hello
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+abc: 123 # hello
+# prettier-ignore
+def: 456 # hello
+
+`;
diff --git a/tests/yaml_prettier_ignore/document.yml b/tests/yaml_prettier_ignore/document.yml
new file mode 100644
index 000000000..2cfba56a6
--- /dev/null
+++ b/tests/yaml_prettier_ignore/document.yml
@@ -0,0 +1,7 @@
+# prettier-ignore
+---
+aaaaa:
+ bbbbb
+...
+aaaaa:
+ bbbbb
diff --git a/tests/yaml_prettier_ignore/jsfmt.spec.js b/tests/yaml_prettier_ignore/jsfmt.spec.js
new file mode 100644
index 000000000..89d18c007
--- /dev/null
+++ b/tests/yaml_prettier_ignore/jsfmt.spec.js
@@ -0,0 +1 @@
+run_spec(__dirname, ["yaml"]);
diff --git a/tests/yaml_prettier_ignore/leading-comment.yml b/tests/yaml_prettier_ignore/leading-comment.yml
new file mode 100644
index 000000000..c9b2b054a
--- /dev/null
+++ b/tests/yaml_prettier_ignore/leading-comment.yml
@@ -0,0 +1,3 @@
+abc: 123
+# prettier-ignore
+def: 456
diff --git a/tests/yaml_prettier_ignore/middle-comment.yml b/tests/yaml_prettier_ignore/middle-comment.yml
new file mode 100644
index 000000000..11a645731
--- /dev/null
+++ b/tests/yaml_prettier_ignore/middle-comment.yml
@@ -0,0 +1,5 @@
+abc: !!str # hello
+ 123
+# prettier-ignore
+def: !!str # hello
+ 456
diff --git a/tests/yaml_prettier_ignore/trailing-comma.yml b/tests/yaml_prettier_ignore/trailing-comma.yml
new file mode 100644
index 000000000..84b98fc2e
--- /dev/null
+++ b/tests/yaml_prettier_ignore/trailing-comma.yml
@@ -0,0 +1,9 @@
+[
+ # prettier-ignore
+ { sss }, # 123
+ { qqqq },
+
+ # prettier-ignore
+ [ccc ] # 777
+ , [ddd ]
+]
diff --git a/tests/yaml_prettier_ignore/trailing-comment.yml b/tests/yaml_prettier_ignore/trailing-comment.yml
new file mode 100644
index 000000000..e247f8d99
--- /dev/null
+++ b/tests/yaml_prettier_ignore/trailing-comment.yml
@@ -0,0 +1,3 @@
+abc: 123 # hello
+# prettier-ignore
+def: 456 # hello
diff --git a/tests/yaml_quote/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_quote/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..5d5e58830
--- /dev/null
+++ b/tests/yaml_quote/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,43 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`quote.yml 1`] = `
+- "123"
+- '123'
+- "''"
+- '""'
+- ''''
+- "\\"\\""
+- '\\n123'
+- "\\n123"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- "123"
+- "123"
+- "''"
+- '""'
+- "'"
+- '""'
+- '\\n123'
+- "\\n123"
+
+`;
+
+exports[`quote.yml 2`] = `
+- "123"
+- '123'
+- "''"
+- '""'
+- ''''
+- "\\"\\""
+- '\\n123'
+- "\\n123"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- '123'
+- '123'
+- "''"
+- '""'
+- "'"
+- '""'
+- '\\n123'
+- "\\n123"
+
+`;
diff --git a/tests/yaml_quote/jsfmt.spec.js b/tests/yaml_quote/jsfmt.spec.js
new file mode 100644
index 000000000..e13faa7a5
--- /dev/null
+++ b/tests/yaml_quote/jsfmt.spec.js
@@ -0,0 +1,2 @@
+run_spec(__dirname, ["yaml"]);
+run_spec(__dirname, ["yaml"], { singleQuote: true });
diff --git a/tests/yaml_quote/quote.yml b/tests/yaml_quote/quote.yml
new file mode 100644
index 000000000..dfac998cd
--- /dev/null
+++ b/tests/yaml_quote/quote.yml
@@ -0,0 +1,8 @@
+- "123"
+- '123'
+- "''"
+- '""'
+- ''''
+- "\"\""
+- '\n123'
+- "\n123"
diff --git a/tests/yaml_require_pragma/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_require_pragma/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..fe5a14c9d
--- /dev/null
+++ b/tests/yaml_require_pragma/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,23 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`with-pragma.yml 1`] = `
+# @prettier
+
+ 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# @prettier
+
+123
+
+`;
+
+exports[`without-pragma.yml 1`] = `
+
+
+ 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+ 123
+
+`;
diff --git a/tests/yaml_require_pragma/jsfmt.spec.js b/tests/yaml_require_pragma/jsfmt.spec.js
new file mode 100644
index 000000000..f219135fc
--- /dev/null
+++ b/tests/yaml_require_pragma/jsfmt.spec.js
@@ -0,0 +1 @@
+run_spec(__dirname, ["yaml"], { requirePragma: true });
diff --git a/tests/yaml_require_pragma/with-pragma.yml b/tests/yaml_require_pragma/with-pragma.yml
new file mode 100644
index 000000000..d47b12639
--- /dev/null
+++ b/tests/yaml_require_pragma/with-pragma.yml
@@ -0,0 +1,3 @@
+# @prettier
+
+ 123
diff --git a/tests/yaml_require_pragma/without-pragma.yml b/tests/yaml_require_pragma/without-pragma.yml
new file mode 100644
index 000000000..c4a580e43
--- /dev/null
+++ b/tests/yaml_require_pragma/without-pragma.yml
@@ -0,0 +1,3 @@
+
+
+ 123
diff --git a/tests/yaml_root/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_root/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..d29e66ee2
--- /dev/null
+++ b/tests/yaml_root/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,453 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`documents.yml 1`] = `
+---
+123
+...
+---
+456
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+123
+...
+456
+
+`;
+
+exports[`documents-with-directive.yml 1`] = `
+---
+123
+...
+%YAML 1.2
+---
+456
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+123
+...
+%YAML 1.2
+---
+456
+
+`;
+
+exports[`empty.yml 1`] = `
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+`;
+
+exports[`example.yml 1`] = `
+---
+# Collection Types #############################################################
+################################################################################
+
+# http://yaml.org/type/map.html -----------------------------------------------#
+
+map:
+ # Unordered set of key: value pairs.
+ Block style: !!map
+ Clark : Evans
+ Ingy : döt Net
+ Oren : Ben-Kiki
+ Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki }
+
+# http://yaml.org/type/omap.html ----------------------------------------------#
+
+omap:
+ # Explicitly typed ordered map (dictionary).
+ Bestiary: !!omap
+ - aardvark: African pig-like ant eater. Ugly.
+ - anteater: South-American ant eater. Two species.
+ - anaconda: South-American constrictor snake. Scaly.
+ # Etc.
+ # Flow style
+ Numbers: !!omap [ one: 1, two: 2, three : 3 ]
+
+# http://yaml.org/type/pairs.html ---------------------------------------------#
+
+pairs:
+ # Explicitly typed pairs.
+ Block tasks: !!pairs
+ - meeting: with team.
+ - meeting: with boss.
+ - break: lunch.
+ - meeting: with client.
+ Flow tasks: !!pairs [ meeting: with team, meeting: with boss ]
+
+# http://yaml.org/type/set.html -----------------------------------------------#
+
+set:
+ # Explicitly typed set.
+ baseball players: !!set
+ ? Mark McGwire
+ ? Sammy Sosa
+ ? Ken Griffey
+ # Flow style
+ baseball teams: !!set { Boston Red Sox, Detroit Tigers, New York Yankees }
+
+# http://yaml.org/type/seq.html -----------------------------------------------#
+
+seq:
+ # Ordered sequence of nodes
+ Block style: !!seq
+ - Mercury # Rotates - no light/dark sides.
+ - Venus # Deadliest. Aptly named.
+ - Earth # Mostly dirt.
+ - Mars # Seems empty.
+ - Jupiter # The king.
+ - Saturn # Pretty.
+ - Uranus # Where the sun hardly shines.
+ - Neptune # Boring. No rings.
+ - Pluto # You call this a planet?
+ Flow style: !!seq [ Mercury, Venus, Earth, Mars, # Rocks
+ Jupiter, Saturn, Uranus, Neptune, # Gas
+ Pluto ] # Overrated
+
+
+# Scalar Types #################################################################
+################################################################################
+
+# http://yaml.org/type/bool.html ----------------------------------------------#
+
+bool:
+ - true
+ - True
+ - TRUE
+ - false
+ - False
+ - FALSE
+
+# http://yaml.org/type/float.html ---------------------------------------------#
+
+float:
+ canonical: 6.8523015e+5
+ exponentioal: 685.230_15e+03
+ fixed: 685_230.15
+ sexagesimal: 190:20:30.15
+ negative infinity: -.inf
+ not a number: .NaN
+
+# http://yaml.org/type/int.html -----------------------------------------------#
+
+int:
+ canonical: 685230
+ decimal: +685_230
+ octal: 02472256
+ hexadecimal: 0x_0A_74_AE
+ binary: 0b1010_0111_0100_1010_1110
+ sexagesimal: 190:20:30
+
+# http://yaml.org/type/merge.html ---------------------------------------------#
+
+merge:
+ - &CENTER { x: 1, y: 2 }
+ - &LEFT { x: 0, y: 2 }
+ - &BIG { r: 10 }
+ - &SMALL { r: 1 }
+
+ # All the following maps are equal:
+
+ - # Explicit keys
+ x: 1
+ y: 2
+ r: 10
+ label: nothing
+
+ - # Merge one map
+ << : *CENTER
+ r: 10
+ label: center
+
+ - # Merge multiple maps
+ << : [ *CENTER, *BIG ]
+ label: center/big
+
+ - # Override
+ << : [ *BIG, *LEFT, *SMALL ]
+ x: 1
+ label: big/left/small
+
+# http://yaml.org/type/null.html ----------------------------------------------#
+
+null:
+ # This mapping has four keys,
+ # one has a value.
+ empty:
+ canonical: ~
+ english: null
+ ~: null key
+ # This sequence has five
+ # entries, two have values.
+ sparse:
+ - ~
+ - 2nd entry
+ -
+ - 4th entry
+ - Null
+
+# http://yaml.org/type/str.html -----------------------------------------------#
+
+string: abcd
+
+# http://yaml.org/type/timestamp.html -----------------------------------------#
+
+timestamp:
+ canonical: 2001-12-15T02:59:43.1Z
+ valid iso8601: 2001-12-14t21:59:43.10-05:00
+ space separated: 2001-12-14 21:59:43.10 -5
+ no time zone (Z): 2001-12-15 2:59:43.10
+ date (00:00:00Z): 2002-12-14
+
+
+# JavaScript Specific Types ####################################################
+################################################################################
+
+# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp
+
+regexp:
+ simple: !!js/regexp foobar
+ modifiers: !!js/regexp /foobar/mi
+
+# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/undefined
+
+undefined: !!js/undefined ~
+
+# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function
+
+function: !!js/function >
+ function foobar() {
+ return 'Wow! JS-YAML Rocks!';
+ }
+
+
+# Custom types #################################################################
+################################################################################
+
+
+# JS-YAML allows you to specify a custom YAML types for your structures.
+# This is a simple example of custom constructor defined in \`js/demo.js\` for
+# custom \`!sexy\` type:
+#
+# var SexyYamlType = new jsyaml.Type('!sexy', {
+# kind: 'sequence',
+# construct: function (data) {
+# return data.map(function (string) { return 'sexy ' + string; });
+# }
+# });
+#
+# var SEXY_SCHEMA = jsyaml.Schema.create([ SexyYamlType ]);
+#
+# result = jsyaml.load(yourData, { schema: SEXY_SCHEMA });
+
+foobar: !sexy
+ - bunny
+ - chocolate
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Collection Types #############################################################
+################################################################################
+
+# http://yaml.org/type/map.html -----------------------------------------------#
+
+map:
+ # Unordered set of key: value pairs.
+ Block style: !!map
+ Clark: Evans
+ Ingy: döt Net
+ Oren: Ben-Kiki
+ Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki }
+
+# http://yaml.org/type/omap.html ----------------------------------------------#
+
+omap:
+ # Explicitly typed ordered map (dictionary).
+ Bestiary: !!omap
+ - aardvark: African pig-like ant eater. Ugly.
+ - anteater: South-American ant eater. Two species.
+ - anaconda: South-American constrictor snake. Scaly.
+ # Etc.
+ # Flow style
+ Numbers: !!omap [one: 1, two: 2, three: 3]
+
+# http://yaml.org/type/pairs.html ---------------------------------------------#
+
+pairs:
+ # Explicitly typed pairs.
+ Block tasks: !!pairs
+ - meeting: with team.
+ - meeting: with boss.
+ - break: lunch.
+ - meeting: with client.
+ Flow tasks: !!pairs [meeting: with team, meeting: with boss]
+
+# http://yaml.org/type/set.html -----------------------------------------------#
+
+set:
+ # Explicitly typed set.
+ baseball players: !!set
+ ? Mark McGwire
+ ? Sammy Sosa
+ ? Ken Griffey
+ # Flow style
+ baseball teams: !!set { Boston Red Sox, Detroit Tigers, New York Yankees }
+
+# http://yaml.org/type/seq.html -----------------------------------------------#
+
+seq:
+ # Ordered sequence of nodes
+ Block style: !!seq
+ - Mercury # Rotates - no light/dark sides.
+ - Venus # Deadliest. Aptly named.
+ - Earth # Mostly dirt.
+ - Mars # Seems empty.
+ - Jupiter # The king.
+ - Saturn # Pretty.
+ - Uranus # Where the sun hardly shines.
+ - Neptune # Boring. No rings.
+ - Pluto # You call this a planet?
+ Flow style: !!seq [
+ Mercury,
+ Venus,
+ Earth,
+ Mars, # Rocks
+ Jupiter,
+ Saturn,
+ Uranus,
+ Neptune, # Gas
+ Pluto,
+ ] # Overrated
+
+# Scalar Types #################################################################
+################################################################################
+
+# http://yaml.org/type/bool.html ----------------------------------------------#
+
+bool:
+ - true
+ - True
+ - TRUE
+ - false
+ - False
+ - FALSE
+
+# http://yaml.org/type/float.html ---------------------------------------------#
+
+float:
+ canonical: 6.8523015e+5
+ exponentioal: 685.230_15e+03
+ fixed: 685_230.15
+ sexagesimal: 190:20:30.15
+ negative infinity: -.inf
+ not a number: .NaN
+
+# http://yaml.org/type/int.html -----------------------------------------------#
+
+int:
+ canonical: 685230
+ decimal: +685_230
+ octal: 02472256
+ hexadecimal: 0x_0A_74_AE
+ binary: 0b1010_0111_0100_1010_1110
+ sexagesimal: 190:20:30
+
+# http://yaml.org/type/merge.html ---------------------------------------------#
+
+merge:
+ - &CENTER { x: 1, y: 2 }
+ - &LEFT { x: 0, y: 2 }
+ - &BIG { r: 10 }
+ - &SMALL { r: 1 }
+
+ # All the following maps are equal:
+
+ - # Explicit keys
+ x: 1
+ y: 2
+ r: 10
+ label: nothing
+
+ - # Merge one map
+ <<: *CENTER
+ r: 10
+ label: center
+
+ - # Merge multiple maps
+ <<: [*CENTER, *BIG]
+ label: center/big
+
+ - # Override
+ <<: [*BIG, *LEFT, *SMALL]
+ x: 1
+ label: big/left/small
+
+# http://yaml.org/type/null.html ----------------------------------------------#
+
+null:
+ # This mapping has four keys,
+ # one has a value.
+ ? empty
+ canonical: ~
+ english: null
+ ~: null key
+ # This sequence has five
+ # entries, two have values.
+ sparse:
+ - ~
+ - 2nd entry
+ -
+ - 4th entry
+ - Null
+
+# http://yaml.org/type/str.html -----------------------------------------------#
+
+string: abcd
+
+# http://yaml.org/type/timestamp.html -----------------------------------------#
+
+timestamp:
+ canonical: 2001-12-15T02:59:43.1Z
+ valid iso8601: 2001-12-14t21:59:43.10-05:00
+ space separated: 2001-12-14 21:59:43.10 -5
+ no time zone (Z): 2001-12-15 2:59:43.10
+ date (00:00:00Z): 2002-12-14
+
+# JavaScript Specific Types ####################################################
+################################################################################
+
+# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp
+
+regexp:
+ simple: !!js/regexp foobar
+ modifiers: !!js/regexp /foobar/mi
+
+# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/undefined
+
+undefined: !!js/undefined ~
+
+# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function
+
+function: !!js/function >
+ function foobar() {
+ return 'Wow! JS-YAML Rocks!';
+ }
+
+# Custom types #################################################################
+################################################################################
+
+# JS-YAML allows you to specify a custom YAML types for your structures.
+# This is a simple example of custom constructor defined in \`js/demo.js\` for
+# custom \`!sexy\` type:
+#
+# var SexyYamlType = new jsyaml.Type('!sexy', {
+# kind: 'sequence',
+# construct: function (data) {
+# return data.map(function (string) { return 'sexy ' + string; });
+# }
+# });
+#
+# var SEXY_SCHEMA = jsyaml.Schema.create([ SexyYamlType ]);
+#
+# result = jsyaml.load(yourData, { schema: SEXY_SCHEMA });
+
+foobar: !sexy
+ - bunny
+ - chocolate
+
+`;
diff --git a/tests/yaml_root/documents-with-directive.yml b/tests/yaml_root/documents-with-directive.yml
new file mode 100644
index 000000000..ac27a78ce
--- /dev/null
+++ b/tests/yaml_root/documents-with-directive.yml
@@ -0,0 +1,6 @@
+---
+123
+...
+%YAML 1.2
+---
+456
diff --git a/tests/yaml_root/documents.yml b/tests/yaml_root/documents.yml
new file mode 100644
index 000000000..80a0d4a7f
--- /dev/null
+++ b/tests/yaml_root/documents.yml
@@ -0,0 +1,5 @@
+---
+123
+...
+---
+456
diff --git a/tests/yaml_root/empty.yml b/tests/yaml_root/empty.yml
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/yaml_root/example.yml b/tests/yaml_root/example.yml
new file mode 100644
index 000000000..bb7de4f66
--- /dev/null
+++ b/tests/yaml_root/example.yml
@@ -0,0 +1,205 @@
+---
+# Collection Types #############################################################
+################################################################################
+
+# http://yaml.org/type/map.html -----------------------------------------------#
+
+map:
+ # Unordered set of key: value pairs.
+ Block style: !!map
+ Clark : Evans
+ Ingy : döt Net
+ Oren : Ben-Kiki
+ Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki }
+
+# http://yaml.org/type/omap.html ----------------------------------------------#
+
+omap:
+ # Explicitly typed ordered map (dictionary).
+ Bestiary: !!omap
+ - aardvark: African pig-like ant eater. Ugly.
+ - anteater: South-American ant eater. Two species.
+ - anaconda: South-American constrictor snake. Scaly.
+ # Etc.
+ # Flow style
+ Numbers: !!omap [ one: 1, two: 2, three : 3 ]
+
+# http://yaml.org/type/pairs.html ---------------------------------------------#
+
+pairs:
+ # Explicitly typed pairs.
+ Block tasks: !!pairs
+ - meeting: with team.
+ - meeting: with boss.
+ - break: lunch.
+ - meeting: with client.
+ Flow tasks: !!pairs [ meeting: with team, meeting: with boss ]
+
+# http://yaml.org/type/set.html -----------------------------------------------#
+
+set:
+ # Explicitly typed set.
+ baseball players: !!set
+ ? Mark McGwire
+ ? Sammy Sosa
+ ? Ken Griffey
+ # Flow style
+ baseball teams: !!set { Boston Red Sox, Detroit Tigers, New York Yankees }
+
+# http://yaml.org/type/seq.html -----------------------------------------------#
+
+seq:
+ # Ordered sequence of nodes
+ Block style: !!seq
+ - Mercury # Rotates - no light/dark sides.
+ - Venus # Deadliest. Aptly named.
+ - Earth # Mostly dirt.
+ - Mars # Seems empty.
+ - Jupiter # The king.
+ - Saturn # Pretty.
+ - Uranus # Where the sun hardly shines.
+ - Neptune # Boring. No rings.
+ - Pluto # You call this a planet?
+ Flow style: !!seq [ Mercury, Venus, Earth, Mars, # Rocks
+ Jupiter, Saturn, Uranus, Neptune, # Gas
+ Pluto ] # Overrated
+
+
+# Scalar Types #################################################################
+################################################################################
+
+# http://yaml.org/type/bool.html ----------------------------------------------#
+
+bool:
+ - true
+ - True
+ - TRUE
+ - false
+ - False
+ - FALSE
+
+# http://yaml.org/type/float.html ---------------------------------------------#
+
+float:
+ canonical: 6.8523015e+5
+ exponentioal: 685.230_15e+03
+ fixed: 685_230.15
+ sexagesimal: 190:20:30.15
+ negative infinity: -.inf
+ not a number: .NaN
+
+# http://yaml.org/type/int.html -----------------------------------------------#
+
+int:
+ canonical: 685230
+ decimal: +685_230
+ octal: 02472256
+ hexadecimal: 0x_0A_74_AE
+ binary: 0b1010_0111_0100_1010_1110
+ sexagesimal: 190:20:30
+
+# http://yaml.org/type/merge.html ---------------------------------------------#
+
+merge:
+ - &CENTER { x: 1, y: 2 }
+ - &LEFT { x: 0, y: 2 }
+ - &BIG { r: 10 }
+ - &SMALL { r: 1 }
+
+ # All the following maps are equal:
+
+ - # Explicit keys
+ x: 1
+ y: 2
+ r: 10
+ label: nothing
+
+ - # Merge one map
+ << : *CENTER
+ r: 10
+ label: center
+
+ - # Merge multiple maps
+ << : [ *CENTER, *BIG ]
+ label: center/big
+
+ - # Override
+ << : [ *BIG, *LEFT, *SMALL ]
+ x: 1
+ label: big/left/small
+
+# http://yaml.org/type/null.html ----------------------------------------------#
+
+null:
+ # This mapping has four keys,
+ # one has a value.
+ empty:
+ canonical: ~
+ english: null
+ ~: null key
+ # This sequence has five
+ # entries, two have values.
+ sparse:
+ - ~
+ - 2nd entry
+ -
+ - 4th entry
+ - Null
+
+# http://yaml.org/type/str.html -----------------------------------------------#
+
+string: abcd
+
+# http://yaml.org/type/timestamp.html -----------------------------------------#
+
+timestamp:
+ canonical: 2001-12-15T02:59:43.1Z
+ valid iso8601: 2001-12-14t21:59:43.10-05:00
+ space separated: 2001-12-14 21:59:43.10 -5
+ no time zone (Z): 2001-12-15 2:59:43.10
+ date (00:00:00Z): 2002-12-14
+
+
+# JavaScript Specific Types ####################################################
+################################################################################
+
+# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp
+
+regexp:
+ simple: !!js/regexp foobar
+ modifiers: !!js/regexp /foobar/mi
+
+# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/undefined
+
+undefined: !!js/undefined ~
+
+# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function
+
+function: !!js/function >
+ function foobar() {
+ return 'Wow! JS-YAML Rocks!';
+ }
+
+
+# Custom types #################################################################
+################################################################################
+
+
+# JS-YAML allows you to specify a custom YAML types for your structures.
+# This is a simple example of custom constructor defined in `js/demo.js` for
+# custom `!sexy` type:
+#
+# var SexyYamlType = new jsyaml.Type('!sexy', {
+# kind: 'sequence',
+# construct: function (data) {
+# return data.map(function (string) { return 'sexy ' + string; });
+# }
+# });
+#
+# var SEXY_SCHEMA = jsyaml.Schema.create([ SexyYamlType ]);
+#
+# result = jsyaml.load(yourData, { schema: SEXY_SCHEMA });
+
+foobar: !sexy
+ - bunny
+ - chocolate
diff --git a/tests/yaml_root/jsfmt.spec.js b/tests/yaml_root/jsfmt.spec.js
new file mode 100644
index 000000000..89d18c007
--- /dev/null
+++ b/tests/yaml_root/jsfmt.spec.js
@@ -0,0 +1 @@
+run_spec(__dirname, ["yaml"]);
diff --git a/tests/yaml_sequence/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_sequence/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..0ba4dca14
--- /dev/null
+++ b/tests/yaml_sequence/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,153 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`items.yml 1`] = `
+- 123
+- 456
+- 789
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- 123
+- 456
+- 789
+
+`;
+
+exports[`items.yml 2`] = `
+- 123
+- 456
+- 789
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- 123
+- 456
+- 789
+
+`;
+
+exports[`middle-comment.yml 1`] = `
+!!set # comment
+- 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set # comment
+- 123
+
+`;
+
+exports[`middle-comment.yml 2`] = `
+!!set # comment
+- 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set # comment
+- 123
+
+`;
+
+exports[`middle-comments.yml 1`] = `
+!!set # comment 1
+# comment 2
+- 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set
+# comment 1
+# comment 2
+- 123
+
+`;
+
+exports[`middle-comments.yml 2`] = `
+!!set # comment 1
+# comment 2
+- 123
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set
+# comment 1
+# comment 2
+- 123
+
+`;
+
+exports[`nested.yml 1`] = `
+- 1
+- - 2-1
+ - 2-2
+- - - 3-1-1
+ - 3-2-1
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- 1
+- - 2-1
+ - 2-2
+- - - 3-1-1
+ - 3-2-1
+
+`;
+
+exports[`nested.yml 2`] = `
+- 1
+- - 2-1
+ - 2-2
+- - - 3-1-1
+ - 3-2-1
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- 1
+- - 2-1
+ - 2-2
+- - - 3-1-1
+ - 3-2-1
+
+`;
+
+exports[`null-item.yml 1`] = `
+-
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+-
+
+`;
+
+exports[`null-item.yml 2`] = `
+-
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+-
+
+`;
+
+exports[`props.yml 1`] = `
+--- !!set &anchor
+- 123
+- 456
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set &anchor
+- 123
+- 456
+
+`;
+
+exports[`props.yml 2`] = `
+--- !!set &anchor
+- 123
+- 456
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!set &anchor
+- 123
+- 456
+
+`;
+
+exports[`props-in-map.yml 1`] = `
+a: !!set &anchor
+- 123
+- 456
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: !!set &anchor
+ - 123
+ - 456
+
+`;
+
+exports[`props-in-map.yml 2`] = `
+a: !!set &anchor
+- 123
+- 456
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: !!set &anchor
+ - 123
+ - 456
+
+`;
diff --git a/tests/yaml_sequence/items.yml b/tests/yaml_sequence/items.yml
new file mode 100644
index 000000000..a9b4dce96
--- /dev/null
+++ b/tests/yaml_sequence/items.yml
@@ -0,0 +1,3 @@
+- 123
+- 456
+- 789
diff --git a/tests/yaml_sequence/jsfmt.spec.js b/tests/yaml_sequence/jsfmt.spec.js
new file mode 100644
index 000000000..6fbe16994
--- /dev/null
+++ b/tests/yaml_sequence/jsfmt.spec.js
@@ -0,0 +1,2 @@
+run_spec(__dirname, ["yaml"]);
+run_spec(__dirname, ["yaml"], { tabWidth: 4 });
diff --git a/tests/yaml_sequence/middle-comment.yml b/tests/yaml_sequence/middle-comment.yml
new file mode 100644
index 000000000..d418e494e
--- /dev/null
+++ b/tests/yaml_sequence/middle-comment.yml
@@ -0,0 +1,2 @@
+!!set # comment
+- 123
diff --git a/tests/yaml_sequence/middle-comments.yml b/tests/yaml_sequence/middle-comments.yml
new file mode 100644
index 000000000..e75c5d1a2
--- /dev/null
+++ b/tests/yaml_sequence/middle-comments.yml
@@ -0,0 +1,3 @@
+!!set # comment 1
+# comment 2
+- 123
diff --git a/tests/yaml_sequence/nested.yml b/tests/yaml_sequence/nested.yml
new file mode 100644
index 000000000..2e11894da
--- /dev/null
+++ b/tests/yaml_sequence/nested.yml
@@ -0,0 +1,5 @@
+- 1
+- - 2-1
+ - 2-2
+- - - 3-1-1
+ - 3-2-1
diff --git a/tests/yaml_sequence/null-item.yml b/tests/yaml_sequence/null-item.yml
new file mode 100644
index 000000000..39cdd0ded
--- /dev/null
+++ b/tests/yaml_sequence/null-item.yml
@@ -0,0 +1 @@
+-
diff --git a/tests/yaml_sequence/props-in-map.yml b/tests/yaml_sequence/props-in-map.yml
new file mode 100644
index 000000000..e3cdfb43c
--- /dev/null
+++ b/tests/yaml_sequence/props-in-map.yml
@@ -0,0 +1,3 @@
+a: !!set &anchor
+- 123
+- 456
diff --git a/tests/yaml_sequence/props.yml b/tests/yaml_sequence/props.yml
new file mode 100644
index 000000000..14b8ecf50
--- /dev/null
+++ b/tests/yaml_sequence/props.yml
@@ -0,0 +1,3 @@
+--- !!set &anchor
+- 123
+- 456
diff --git a/tests/yaml_spec/__snapshots__/jsfmt.spec.js.snap b/tests/yaml_spec/__snapshots__/jsfmt.spec.js.snap
new file mode 100644
index 000000000..eaecada89
--- /dev/null
+++ b/tests/yaml_spec/__snapshots__/jsfmt.spec.js.snap
@@ -0,0 +1,2782 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`aliases-in-block-sequence.yml 1`] = `
+- &a a
+- &b b
+- *a
+- *b
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- &a a
+- &b b
+- *a
+- *b
+
+`;
+
+exports[`aliases-in-explicit-block-mapping.yml 1`] = `
+? &a a
+: &b b
+: *a
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+&a a: &b b
+: *a
+
+`;
+
+exports[`allowed-characters-in-alias.yml 1`] = `
+a: &:@*!$": scalar a
+b: *:@*!$":
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: &:@*!$": scalar a
+b: *:@*!$":
+
+`;
+
+exports[`allowed-characters-in-keys.yml 1`] = `
+a!"#$%&'()*+,-./09:;<=>?@AZ[\\]^_\`az{|}~: safe
+?foo: safe question mark
+:foo: safe colon
+-foo: safe dash
+this is#not: a comment
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a!"#$%&'()*+,-./09:;<=>?@AZ[\\]^_\`az{|}~: safe
+?foo: safe question mark
+:foo: safe colon
+-foo: safe dash
+this is#not: a comment
+
+`;
+
+exports[`allowed-characters-in-plain-scalars.yml 1`] = `
+safe: a!"#$%&'()*+,-./09:;<=>?@AZ[\\]^_\`az{|}~
+ !"#$%&'()*+,-./09:;<=>?@AZ[\\]^_\`az{|}~
+safe question mark: ?foo
+safe colon: :foo
+safe dash: -foo
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+safe:
+ a!"#$%&'()*+,-./09:;<=>?@AZ[\\]^_\`az{|}~ !"#$%&'()*+,-./09:;<=>?@AZ[\\]^_\`az{|}~
+safe question mark: ?foo
+safe colon: :foo
+safe dash: -foo
+
+`;
+
+exports[`allowed-characters-in-quoted-mapping-key.yml 1`] = `
+"foo\\nbar:baz\\tx \\\\$%^&*()x": 23
+'x\\ny:z\\tx $%^&*()x': 24
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"foo\\nbar:baz\\tx \\\\$%^&*()x": 23
+'x\\ny:z\\tx $%^&*()x': 24
+
+`;
+
+exports[`anchor-before-zero-indented-sequence.yml 1`] = `
+---
+seq:
+ &anchor
+- a
+- b
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+seq: &anchor
+ - a
+ - b
+
+`;
+
+exports[`anchor-with-unicode-character.yml 1`] = `
+---
+- &😁 unicode anchor
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- &😁 unicode anchor
+
+`;
+
+exports[`anchors-and-tags.yml 1`] = `
+ - &a !!str a
+ - !!int 2
+ - !!int &c 4
+ - &d d
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- !!str &a a
+- !!int 2
+- !!int &c 4
+- &d d
+
+`;
+
+exports[`anchors-in-mapping.yml 1`] = `
+&a a: b
+c: &d d
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+&a a: b
+c: &d d
+
+`;
+
+exports[`anchors-with-colon-in-name.yml 1`] = `
+&a: key: &a value
+foo:
+ *a:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+&a: key: &a value
+foo: *a:
+
+`;
+
+exports[`backslashes-in-singlequotes.yml 1`] = `
+'foo: bar\\': baz'
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+'foo: bar\\': baz'
+
+`;
+
+exports[`bare-document-after-document-end-marker.yml 1`] = `
+---
+scalar1
+...
+key: value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+scalar1
+...
+key: value
+
+`;
+
+exports[`blank-lines.yml 1`] = `
+foo: 1
+
+bar: 2
+
+text: |
+ a
+
+ b
+
+ c
+
+ d
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+foo: 1
+
+bar: 2
+
+text: |
+ a
+
+ b
+
+ c
+
+ d
+
+`;
+
+exports[`block-mapping-with-missing-values.yml 1`] = `
+? a
+? b
+c:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+? a
+? b
+? c
+
+`;
+
+exports[`block-mapping-with-multiline-scalars.yml 1`] = `
+? a
+ true
+: null
+ d
+? e
+ 42
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a true: null d
+? e 42
+
+`;
+
+exports[`block-mappings-in-block-sequence.yml 1`] = `
+ - key: value
+ key2: value2
+ -
+ key3: value3
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- key: value
+ key2: value2
+- key3: value3
+
+`;
+
+exports[`block-scalar-indicator-order.yml 1`] = `
+- |2-
+ explicit indent and chomp
+- |-2
+ chomp and explicit indent
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- |2-
+ explicit indent and chomp
+- |2-
+ chomp and explicit indent
+
+`;
+
+exports[`block-scalar-keep.yml 1`] = `
+--- |+
+ ab
+
+
+...
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+|+
+ ab
+
+
+
+`;
+
+exports[`block-scalar-strip.yml 1`] = `
+|-
+ ab
+
+
+...
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+|-
+ ab
+
+`;
+
+exports[`block-scalar-with-spaces-only.yml 1`] = `
+empty block scalar: >
+
+
+
+ # comment
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+empty block scalar: >
+# comment
+
+`;
+
+exports[`block-sequence-in-block-mapping.yml 1`] = `
+key:
+ - item1
+ - item2
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+key:
+ - item1
+ - item2
+
+`;
+
+exports[`block-sequence-in-block-sequence.yml 1`] = `
+- - s1_i1
+ - s1_i2
+- s2
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- - s1_i1
+ - s1_i2
+- s2
+
+`;
+
+exports[`block-submapping.yml 1`] = `
+foo:
+ bar: 1
+baz: 2
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+foo:
+ bar: 1
+baz: 2
+
+`;
+
+exports[`colon-in-double-quoted-string.yml 1`] = `
+"foo: bar\\": baz"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+'foo: bar": baz'
+
+`;
+
+exports[`comment-in-flow-sequence-before-comma.yml 1`] = `
+---
+[ word1
+# comment
+, word2]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[
+ word1,
+ # comment
+ word2,
+]
+
+`;
+
+exports[`construct-binary.yml 1`] = `
+canonical: !!binary "\\
+ R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\\
+ OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\\
+ +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\\
+ AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs="
+generic: !!binary |
+ R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5
+ OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+
+ +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC
+ AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=
+description:
+ The binary value above is a tiny arrow encoded as a gif image.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+canonical:
+ !!binary "\\
+ R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\\
+ OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\\
+ +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\\
+ AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs="
+generic: !!binary |
+ R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5
+ OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+
+ +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC
+ AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=
+description: The binary value above is a tiny arrow encoded as a gif image.
+
+`;
+
+exports[`document-start-on-last-line.yml 1`] = `
+---
+a: b
+---
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: b
+...
+
+
+`;
+
+exports[`document-with-footer.yml 1`] = `
+aaa: bbb
+...
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+aaa: bbb
+
+`;
+
+exports[`empty-lines-at-end-of-document.yml 1`] = `
+:
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+:
+
+`;
+
+exports[`empty-lines-between-mapping-elements.yml 1`] = `
+1: 2
+
+
+3: 4
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1: 2
+
+3: 4
+
+`;
+
+exports[`empty-stream.yml 1`] = `
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+`;
+
+exports[`escaped-slash-in-double-quotes.yml 1`] = `
+escaped slash: "a\\/b"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+escaped slash: "a\\/b"
+
+`;
+
+exports[`explicit-non-specific-tag.yml 1`] = `
+! a
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+! a
+
+`;
+
+exports[`flow-mapping.yml 1`] = `
+{foo: you, bar: far}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ foo: you, bar: far }
+
+`;
+
+exports[`flow-mapping-in-block-sequence.yml 1`] = `
+- {a: b}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- { a: b }
+
+`;
+
+exports[`flow-sequence.yml 1`] = `
+[foo, bar, 42]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[foo, bar, 42]
+
+`;
+
+exports[`flow-sequence-in-block-mapping.yml 1`] = `
+a: [b, c]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: [b, c]
+
+`;
+
+exports[`flow-sequence-in-flow-mapping.yml 1`] = `
+{a: [b, c], [d, e]: f}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ a: [b, c], [d, e]: f }
+
+`;
+
+exports[`flow-sequence-in-flow-sequence.yml 1`] = `
+[a, [b, c]]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[a, [b, c]]
+
+`;
+
+exports[`folded-block-scalar.yml 1`] = `
+>
+ ab
+ cd
+
+ ef
+
+
+ gh
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>
+ ab cd
+
+ ef
+
+
+ gh
+
+`;
+
+exports[`implicit-flow-mapping-key-on-one-line.yml 1`] = `
+[flow]: block
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[flow]: block
+
+`;
+
+exports[`key-with-anchor-after-missing-explicit-mapping-value.yml 1`] = `
+---
+a: 1
+? b
+&anchor c: 3
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: 1
+? b
+&anchor c: 3
+
+`;
+
+exports[`literal-block-scalar.yml 1`] = `
+a: |
+ ab
+
+ cd
+ ef
+
+
+...
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: |
+ ab
+
+ cd
+ ef
+
+
+`;
+
+exports[`literal-unicode.yml 1`] = `
+---
+wanted: love ♥ and peace ☮
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+wanted: love ♥ and peace ☮
+
+`;
+
+exports[`lookahead-test-cases.yml 1`] = `
+- bla"keks: foo
+- bla]keks: foo
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- bla"keks: foo
+- bla]keks: foo
+
+`;
+
+exports[`mapping-key-and-flow-sequence-item-anchors.yml 1`] = `
+---
+&mapping
+&key [ &item a, b, c ]: value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+&mapping
+&key [&item a, b, c]: value
+
+`;
+
+exports[`mapping-with-anchor-on-document-start-line.yml 1`] = `
+--- &anchor a: b
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+&anchor a: b
+
+`;
+
+exports[`mixed-block-mapping-explicit-to-implicit.yml 1`] = `
+? a
+: 13
+1.5: d
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: 13
+1.5: d
+
+`;
+
+exports[`mixed-block-mapping-implicit-to-explicit.yml 1`] = `
+a: 4.2
+? 23
+: d
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: 4.2
+23: d
+
+`;
+
+exports[`multi-level-mapping-indent.yml 1`] = `
+a:
+ b:
+ c: d
+ e:
+ f: g
+h: i
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a:
+ b:
+ c: d
+ e:
+ f: g
+h: i
+
+`;
+
+exports[`multiline-plain-scalar-with-empty-line.yml 1`] = `
+---
+plain: a
+ b
+
+ c
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+plain: a b
+
+ c
+
+`;
+
+exports[`multiline-scalar-at-top-level.yml 1`] = `
+a
+b
+ c
+d
+
+e
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a b c d
+
+e
+
+`;
+
+exports[`multiline-scalar-in-mapping.yml 1`] = `
+a: b
+ c
+d:
+ e
+ f
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: b c
+d: e f
+
+`;
+
+exports[`multiline-scalar-that-looks-like-a-yaml-directive.yml 1`] = `
+---
+scalar
+%YAML 1.2
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+scalar %YAML 1.2
+
+`;
+
+exports[`multiple-entry-block-sequence.yml 1`] = `
+- foo
+- bar
+- 42
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- foo
+- bar
+- 42
+
+`;
+
+exports[`multiple-pair-block-mapping.yml 1`] = `
+foo: blue
+bar: arrr
+baz: jazz
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+foo: blue
+bar: arrr
+baz: jazz
+
+`;
+
+exports[`nested-flow-collections.yml 1`] = `
+---
+{
+ a: [
+ b, c, {
+ d: [e, f]
+ }
+ ]
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ a: [b, c, { d: [e, f] }] }
+
+`;
+
+exports[`nested-flow-collections-on-one-line.yml 1`] = `
+---
+{ a: [b, c, { d: [e, f] } ] }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ a: [b, c, { d: [e, f] }] }
+
+`;
+
+exports[`node-anchor-and-tag-on-seperate-lines.yml 1`] = `
+key: &anchor
+ !!map
+ a: b
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+key: !!map &anchor
+ a: b
+
+`;
+
+exports[`node-and-mapping-key-anchors.yml 1`] = `
+---
+top1: &node1
+ &k1 key1: one
+top2: &node2 # comment
+ key2: two
+top3:
+ &k3 key3: three
+top4:
+ &node4
+ &k4 key4: four
+top5:
+ &node5
+ key5: five
+top6: &val6
+ six
+top7:
+ &val7 seven
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+top1: &node1
+ &k1 key1: one
+top2: &node2 # comment
+ key2: two
+top3:
+ &k3 key3: three
+top4: &node4
+ &k4 key4: four
+top5: &node5
+ key5: five
+top6: &val6 six
+top7: &val7 seven
+
+`;
+
+exports[`non-specific-tags-on-scalars.yml 1`] = `
+- plain
+- "double quoted"
+- 'single quoted'
+- >
+ block
+- plain again
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- plain
+- "double quoted"
+- "single quoted"
+- >
+ block
+- plain again
+
+`;
+
+exports[`plain-mapping-key-ending-with-colon.yml 1`] = `
+---
+key ends with two colons::: value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+key ends with two colons::: value
+
+`;
+
+exports[`plain-scalar-looking-like-key-comment-anchor-and-tag.yml 1`] = `
+k:#foo
+ &a !t s
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+k:#foo &a !t s
+
+`;
+
+exports[`plain-scalar-with-backslashes.yml 1`] = `
+---
+plain\\value\\with\\backslashes
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+plain\\value\\with\\backslashes
+
+`;
+
+exports[`plain-url-in-flow-mapping.yml 1`] = `
+- { url: http://example.org }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- { url: http://example.org }
+
+`;
+
+exports[`scalars-on-line.yml 1`] = `
+--- "quoted
+string"
+--- &node foo
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"quoted
+string"
+...
+&node foo
+
+`;
+
+exports[`sequence-entry-that-looks-like-two-with-wrong-indentation.yml 1`] = `
+- single multiline
+ - sequence entry
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- single multiline - sequence entry
+
+`;
+
+exports[`sequence-indent.yml 1`] = `
+foo:
+- 42
+bar:
+ - 44
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+foo:
+ - 42
+bar:
+ - 44
+
+`;
+
+exports[`sequence-with-same-indentation-as-parent-mapping.yml 1`] = `
+1:
+- 2
+- 3
+4: 5
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1:
+ - 2
+ - 3
+4: 5
+
+`;
+
+exports[`simple-mapping-indent.yml 1`] = `
+foo:
+ bar: baz
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+foo:
+ bar: baz
+
+`;
+
+exports[`single-entry-block-sequence.yml 1`] = `
+- foo
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- foo
+
+`;
+
+exports[`single-pair-block-mapping.yml 1`] = `
+foo: bar
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+foo: bar
+
+`;
+
+exports[`spec-example-2-1-sequence-of-scalars.yml 1`] = `
+- Mark McGwire
+- Sammy Sosa
+- Ken Griffey
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- Mark McGwire
+- Sammy Sosa
+- Ken Griffey
+
+`;
+
+exports[`spec-example-2-2-mapping-scalars-to-scalars.yml 1`] = `
+hr: 65 # Home runs
+avg: 0.278 # Batting average
+rbi: 147 # Runs Batted In
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+hr: 65 # Home runs
+avg: 0.278 # Batting average
+rbi: 147 # Runs Batted In
+
+`;
+
+exports[`spec-example-2-3-mapping-scalars-to-sequences.yml 1`] = `
+american:
+ - Boston Red Sox
+ - Detroit Tigers
+ - New York Yankees
+national:
+ - New York Mets
+ - Chicago Cubs
+ - Atlanta Braves
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+american:
+ - Boston Red Sox
+ - Detroit Tigers
+ - New York Yankees
+national:
+ - New York Mets
+ - Chicago Cubs
+ - Atlanta Braves
+
+`;
+
+exports[`spec-example-2-4-sequence-of-mappings.yml 1`] = `
+-
+ name: Mark McGwire
+ hr: 65
+ avg: 0.278
+-
+ name: Sammy Sosa
+ hr: 63
+ avg: 0.288
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- name: Mark McGwire
+ hr: 65
+ avg: 0.278
+- name: Sammy Sosa
+ hr: 63
+ avg: 0.288
+
+`;
+
+exports[`spec-example-2-5-sequence-of-sequences.yml 1`] = `
+- [name , hr, avg ]
+- [Mark McGwire, 65, 0.278]
+- [Sammy Sosa , 63, 0.288]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- [name, hr, avg]
+- [Mark McGwire, 65, 0.278]
+- [Sammy Sosa, 63, 0.288]
+
+`;
+
+exports[`spec-example-2-6-mapping-of-mappings.yml 1`] = `
+Mark McGwire: {hr: 65, avg: 0.278}
+Sammy Sosa: {
+ hr: 63,
+ avg: 0.288
+ }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Mark McGwire: { hr: 65, avg: 0.278 }
+Sammy Sosa: { hr: 63, avg: 0.288 }
+
+`;
+
+exports[`spec-example-2-7-two-documents-in-a-stream.yml 1`] = `
+# Ranking of 1998 home runs
+---
+- Mark McGwire
+- Sammy Sosa
+- Ken Griffey
+
+# Team ranking
+---
+- Chicago Cubs
+- St Louis Cardinals
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Ranking of 1998 home runs
+---
+- Mark McGwire
+- Sammy Sosa
+- Ken Griffey
+
+# Team ranking
+...
+- Chicago Cubs
+- St Louis Cardinals
+
+`;
+
+exports[`spec-example-2-8-play-by-play-feed-from-a-game.yml 1`] = `
+---
+time: 20:03:20
+player: Sammy Sosa
+action: strike (miss)
+...
+---
+time: 20:03:47
+player: Sammy Sosa
+action: grand slam
+...
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+time: 20:03:20
+player: Sammy Sosa
+action: strike (miss)
+...
+time: 20:03:47
+player: Sammy Sosa
+action: grand slam
+
+`;
+
+exports[`spec-example-2-9-single-document-with-two-comments.yml 1`] = `
+---
+hr: # 1998 hr ranking
+ - Mark McGwire
+ - Sammy Sosa
+rbi:
+ # 1998 rbi ranking
+ - Sammy Sosa
+ - Ken Griffey
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+hr: # 1998 hr ranking
+ - Mark McGwire
+ - Sammy Sosa
+rbi:
+ # 1998 rbi ranking
+ - Sammy Sosa
+ - Ken Griffey
+
+`;
+
+exports[`spec-example-2-10-node-for-sammy-sosa-appears-twice-in-this-document.yml 1`] = `
+---
+hr:
+ - Mark McGwire
+ # Following node labeled SS
+ - &SS Sammy Sosa
+rbi:
+ - *SS # Subsequent occurrence
+ - Ken Griffey
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+hr:
+ - Mark McGwire
+ # Following node labeled SS
+ - &SS Sammy Sosa
+rbi:
+ - *SS # Subsequent occurrence
+ - Ken Griffey
+
+`;
+
+exports[`spec-example-2-11-mapping-between-sequences.yml 1`] = `
+? - Detroit Tigers
+ - Chicago cubs
+:
+ - 2001-07-23
+
+? [ New York Yankees,
+ Atlanta Braves ]
+: [ 2001-07-02, 2001-08-12,
+ 2001-08-14 ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+? - Detroit Tigers
+ - Chicago cubs
+: - 2001-07-23
+
+[New York Yankees, Atlanta Braves]: [2001-07-02, 2001-08-12, 2001-08-14]
+
+`;
+
+exports[`spec-example-2-12-compact-nested-mapping.yml 1`] = `
+---
+# Products purchased
+- item : Super Hoop
+ quantity: 1
+- item : Basketball
+ quantity: 4
+- item : Big Shoes
+ quantity: 1
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Products purchased
+- item: Super Hoop
+ quantity: 1
+- item: Basketball
+ quantity: 4
+- item: Big Shoes
+ quantity: 1
+
+`;
+
+exports[`spec-example-2-13-in-literals-newlines-are-preserved.yml 1`] = `
+# ASCII Art
+--- |
+ \\//||\\/||
+ // || ||__
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ASCII Art
+---
+|
+ \\//||\\/||
+ // || ||__
+
+`;
+
+exports[`spec-example-2-14-in-the-folded-scalars-newlines-become-spaces.yml 1`] = `
+--- >
+ Mark McGwire's
+ year was crippled
+ by a knee injury.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>
+ Mark McGwire's year was crippled by a knee injury.
+
+`;
+
+exports[`spec-example-2-15-folded-newlines-are-preserved-for-more-indented-and-blank-lines.yml 1`] = `
+>
+ Sammy Sosa completed another
+ fine season with great stats.
+
+ 63 Home Runs
+ 0.288 Batting Average
+
+ What a year!
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>
+ Sammy Sosa completed another fine season with great stats.
+
+ 63 Home Runs
+ 0.288 Batting Average
+
+ What a year!
+
+`;
+
+exports[`spec-example-2-16-indentation-determines-scope.yml 1`] = `
+name: Mark McGwire
+accomplishment: >
+ Mark set a major league
+ home run record in 1998.
+stats: |
+ 65 Home Runs
+ 0.278 Batting Average
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+name: Mark McGwire
+accomplishment: >
+ Mark set a major league home run record in 1998.
+stats: |
+ 65 Home Runs
+ 0.278 Batting Average
+
+`;
+
+exports[`spec-example-2-17-quoted-scalars.yml 1`] = `
+unicode: "Sosa did fine.\\u263A"
+control: "\\b1998\\t1999\\t2000\\n"
+hex esc: "\\x0d\\x0a is \\r\\n"
+
+single: '"Howdy!" he cried.'
+quoted: ' # Not a ''comment''.'
+tie-fighter: '|\\-*-/|'
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+unicode: "Sosa did fine.\\u263A"
+control: "\\b1998\\t1999\\t2000\\n"
+hex esc: "\\x0d\\x0a is \\r\\n"
+
+single: '"Howdy!" he cried.'
+quoted: " # Not a 'comment'."
+tie-fighter: '|\\-*-/|'
+
+`;
+
+exports[`spec-example-2-18-multi-line-flow-scalars.yml 1`] = `
+plain:
+ This unquoted scalar
+ spans many lines.
+
+quoted: "So does this
+ quoted scalar.\\n"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+plain: This unquoted scalar spans many lines.
+
+quoted: "So does this
+ quoted scalar.\\n"
+
+`;
+
+exports[`spec-example-2-23-various-explicit-tags.yml 1`] = `
+---
+not-date: !!str 2002-04-28
+
+picture: !!binary |
+ R0lGODlhDAAMAIQAAP//9/X
+ 17unp5WZmZgAAAOfn515eXv
+ Pz7Y6OjuDg4J+fn5OTk6enp
+ 56enmleECcgggoBADs=
+
+application specific tag: !something |
+ The semantics of the tag
+ above may be different for
+ different documents.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+not-date: !!str 2002-04-28
+
+picture: !!binary |
+ R0lGODlhDAAMAIQAAP//9/X
+ 17unp5WZmZgAAAOfn515eXv
+ Pz7Y6OjuDg4J+fn5OTk6enp
+ 56enmleECcgggoBADs=
+
+application specific tag: !something |
+ The semantics of the tag
+ above may be different for
+ different documents.
+
+`;
+
+exports[`spec-example-2-24-global-tags.yml 1`] = `
+%TAG ! tag:clarkevans.com,2002:
+--- !shape
+ # Use the ! handle for presenting
+ # tag:clarkevans.com,2002:circle
+- !circle
+ center: &ORIGIN {x: 73, y: 129}
+ radius: 7
+- !line
+ start: *ORIGIN
+ finish: { x: 89, y: 102 }
+- !label
+ start: *ORIGIN
+ color: 0xFFEEBB
+ text: Pretty vector drawing.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%TAG ! tag:clarkevans.com,2002:
+---
+!shape
+# Use the ! handle for presenting
+# tag:clarkevans.com,2002:circle
+- !circle
+ center: &ORIGIN { x: 73, y: 129 }
+ radius: 7
+- !line
+ start: *ORIGIN
+ finish: { x: 89, y: 102 }
+- !label
+ start: *ORIGIN
+ color: 0xFFEEBB
+ text: Pretty vector drawing.
+
+`;
+
+exports[`spec-example-2-25-unordered-sets.yml 1`] = `
+# Sets are represented as a
+# Mapping where each key is
+# associated with a null value
+--- !!set
+? Mark McGwire
+? Sammy Sosa
+? Ken Griff
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Sets are represented as a
+# Mapping where each key is
+# associated with a null value
+---
+!!set
+? Mark McGwire
+? Sammy Sosa
+? Ken Griff
+
+`;
+
+exports[`spec-example-2-26-ordered-mappings.yml 1`] = `
+# Ordered maps are represented as
+# A sequence of mappings, with
+# each mapping having one key
+--- !!omap
+- Mark McGwire: 65
+- Sammy Sosa: 63
+- Ken Griffy: 58
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Ordered maps are represented as
+# A sequence of mappings, with
+# each mapping having one key
+---
+!!omap
+- Mark McGwire: 65
+- Sammy Sosa: 63
+- Ken Griffy: 58
+
+`;
+
+exports[`spec-example-2-27-invoice.yml 1`] = `
+--- !
+invoice: 34843
+date : 2001-01-23
+bill-to: &id001
+ given : Chris
+ family : Dumars
+ address:
+ lines: |
+ 458 Walkman Dr.
+ Suite #292
+ city : Royal Oak
+ state : MI
+ postal : 48046
+ship-to: *id001
+product:
+ - sku : BL394D
+ quantity : 4
+ description : Basketball
+ price : 450.00
+ - sku : BL4438H
+ quantity : 1
+ description : Super Hoop
+ price : 2392.00
+tax : 251.42
+total: 4443.52
+comments:
+ Late afternoon is best.
+ Backup contact is Nancy
+ Billsmer @ 338-4338.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!
+invoice: 34843
+date: 2001-01-23
+bill-to: &id001
+ given: Chris
+ family: Dumars
+ address:
+ lines: |
+ 458 Walkman Dr.
+ Suite #292
+ city: Royal Oak
+ state: MI
+ postal: 48046
+ship-to: *id001
+product:
+ - sku: BL394D
+ quantity: 4
+ description: Basketball
+ price: 450.00
+ - sku: BL4438H
+ quantity: 1
+ description: Super Hoop
+ price: 2392.00
+tax: 251.42
+total: 4443.52
+comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.
+
+`;
+
+exports[`spec-example-2-28-log-file.yml 1`] = `
+---
+Time: 2001-11-23 15:01:42 -5
+User: ed
+Warning:
+ This is an error message
+ for the log file
+---
+Time: 2001-11-23 15:02:31 -5
+User: ed
+Warning:
+ A slightly different error
+ message.
+---
+Date: 2001-11-23 15:03:17 -5
+User: ed
+Fatal:
+ Unknown variable "bar"
+Stack:
+ - file: TopClass.py
+ line: 23
+ code: |
+ x = MoreObject("345\\n")
+ - file: MoreClass.py
+ line: 58
+ code: |-
+ foo = bar
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Time: 2001-11-23 15:01:42 -5
+User: ed
+Warning: This is an error message for the log file
+...
+Time: 2001-11-23 15:02:31 -5
+User: ed
+Warning: A slightly different error message.
+...
+Date: 2001-11-23 15:03:17 -5
+User: ed
+Fatal: Unknown variable "bar"
+Stack:
+ - file: TopClass.py
+ line: 23
+ code: |
+ x = MoreObject("345\\n")
+ - file: MoreClass.py
+ line: 58
+ code: |-
+ foo = bar
+
+`;
+
+exports[`spec-example-5-3-block-structure-indicators.yml 1`] = `
+sequence:
+- one
+- two
+mapping:
+ ? sky
+ : blue
+ sea : green
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+sequence:
+ - one
+ - two
+mapping:
+ sky: blue
+ sea: green
+
+`;
+
+exports[`spec-example-5-4-flow-collection-indicators.yml 1`] = `
+sequence: [ one, two, ]
+mapping: { sky: blue, sea: green }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+sequence: [one, two]
+mapping: { sky: blue, sea: green }
+
+`;
+
+exports[`spec-example-5-5-comment-indicator.yml 1`] = `
+# Comment only.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Comment only.
+
+`;
+
+exports[`spec-example-5-6-node-property-indicators.yml 1`] = `
+anchored: !local &anchor value
+alias: *anchor
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+anchored: !local &anchor value
+alias: *anchor
+
+`;
+
+exports[`spec-example-5-7-block-scalar-indicators.yml 1`] = `
+literal: |
+ some
+ text
+folded: >
+ some
+ text
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+literal: |
+ some
+ text
+folded: >
+ some text
+
+`;
+
+exports[`spec-example-5-8-quoted-scalar-indicators.yml 1`] = `
+single: 'text'
+double: "text"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+single: "text"
+double: "text"
+
+`;
+
+exports[`spec-example-5-9-directive-indicator.yml 1`] = `
+%YAML 1.2
+--- text
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%YAML 1.2
+---
+text
+
+`;
+
+exports[`spec-example-5-12-tabs-and-spaces.yml 1`] = `
+# Tabs and spaces
+quoted: "Quoted "
+block: |
+ void main() {
+ printf("Hello, world!\\n");
+ }
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Tabs and spaces
+quoted: "Quoted "
+block: |
+ void main() {
+ printf("Hello, world!\\n");
+ }
+
+`;
+
+exports[`spec-example-6-1-indentation-spaces.yml 1`] = `
+ # Leading comment line spaces are
+ # neither content nor indentation.
+
+Not indented:
+ By one space: |
+ By four
+ spaces
+ Flow style: [ # Leading spaces
+ By two, # in flow style
+ Also by two, # are neither
+ Still by two # content nor
+ ] # indentation.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Leading comment line spaces are
+# neither content nor indentation.
+
+Not indented:
+ By one space: |
+ By four
+ spaces
+ Flow style: # Leading spaces
+ [
+ By two, # in flow style
+ Also by two, # are neither
+ Still by two, # content nor
+ ] # indentation.
+
+`;
+
+exports[`spec-example-6-2-indentation-indicators.yml 1`] = `
+? a
+: - b
+ - - c
+ - d
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a:
+ - b
+ - - c
+ - d
+
+`;
+
+exports[`spec-example-6-3-separation-spaces.yml 1`] = `
+- foo: bar
+- - baz
+ - baz
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- foo: bar
+- - baz
+ - baz
+
+`;
+
+exports[`spec-example-6-4-line-prefixes.yml 1`] = `
+plain: text
+ lines
+quoted: "text
+ lines"
+block: |
+ text
+ lines
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+plain: text lines
+quoted: "text
+ lines"
+block: |
+ text
+ lines
+
+`;
+
+exports[`spec-example-6-5-empty-lines.yml 1`] = `
+Folding:
+ "Empty line
+
+ as a line feed"
+Chomping: |
+ Clipped empty lines
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Folding: "Empty line
+
+ as a line feed"
+Chomping: |
+ Clipped empty lines
+
+`;
+
+exports[`spec-example-6-6-line-folding.yml 1`] = `
+>-
+ trimmed
+
+
+
+ as
+ space
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>-
+ trimmed
+
+
+
+ as space
+
+`;
+
+exports[`spec-example-6-7-block-folding.yml 1`] = `
+>
+ foo
+
+ bar
+
+ baz
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>
+ foo
+
+ bar
+
+ baz
+
+`;
+
+exports[`spec-example-6-8-flow-folding.yml 1`] = `
+"
+ foo
+
+ bar
+
+ baz
+"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"
+ foo
+
+ bar
+
+ baz
+"
+
+`;
+
+exports[`spec-example-6-9-separated-comment.yml 1`] = `
+key: # Comment
+ value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+key: # Comment
+ value
+
+`;
+
+exports[`spec-example-6-10-comment-lines.yml 1`] = `
+ # Comment
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Comment
+
+`;
+
+exports[`spec-example-6-11-multi-line-comments.yml 1`] = `
+key: # Comment
+ # lines
+ value
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+key: # Comment
+ # lines
+ value
+
+`;
+
+exports[`spec-example-6-12-separation-spaces.yml 1`] = `
+{ first: Sammy, last: Sosa }:
+# Statistics:
+ hr: # Home runs
+ 65
+ avg: # Average
+ 0.278
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ first: Sammy, last: Sosa }:
+ # Statistics:
+ hr: # Home runs
+ 65
+ avg: # Average
+ 0.278
+
+`;
+
+exports[`spec-example-6-13-reserved-directives.yml 1`] = `
+%FOO bar baz # Should be ignored
+ # with a warning.
+--- "foo"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%FOO bar baz # Should be ignored
+# with a warning.
+---
+"foo"
+
+`;
+
+exports[`spec-example-6-14-yaml-directive.yml 1`] = `
+%YAML 1.3 # Attempt parsing
+ # with a warning
+---
+"foo"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%YAML 1.3 # Attempt parsing
+# with a warning
+---
+"foo"
+
+`;
+
+exports[`spec-example-6-16-tag-directive.yml 1`] = `
+%TAG !yaml! tag:yaml.org,2002:
+---
+!yaml!str "foo"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%TAG !yaml! tag:yaml.org,2002:
+---
+!yaml!str "foo"
+
+`;
+
+exports[`spec-example-6-18-primary-tag-handle.yml 1`] = `
+# Private
+!foo "bar"
+...
+# Global
+%TAG ! tag:example.com,2000:app/
+---
+!foo "bar"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Private
+!foo "bar"
+...
+# Global
+%TAG ! tag:example.com,2000:app/
+---
+!foo "bar"
+
+`;
+
+exports[`spec-example-6-19-secondary-tag-handle.yml 1`] = `
+%TAG !! tag:example.com,2000:app/
+---
+!!int 1 - 3 # Interval, not integer
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%TAG !! tag:example.com,2000:app/
+---
+!!int 1 - 3 # Interval, not integer
+
+`;
+
+exports[`spec-example-6-20-tag-handles.yml 1`] = `
+%TAG !e! tag:example.com,2000:app/
+---
+!e!foo "bar"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%TAG !e! tag:example.com,2000:app/
+---
+!e!foo "bar"
+
+`;
+
+exports[`spec-example-6-21-local-tag-prefix.yml 1`] = `
+%TAG !m! !my-
+--- # Bulb here
+!m!light fluorescent
+...
+%TAG !m! !my-
+--- # Color here
+!m!light green
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%TAG !m! !my-
+---
+# Bulb here
+!m!light fluorescent
+...
+%TAG !m! !my-
+---
+# Color here
+!m!light green
+
+`;
+
+exports[`spec-example-6-22-global-tag-prefix.yml 1`] = `
+%TAG !e! tag:example.com,2000:app/
+---
+- !e!foo "bar"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%TAG !e! tag:example.com,2000:app/
+---
+- !e!foo "bar"
+
+`;
+
+exports[`spec-example-6-23-node-properties.yml 1`] = `
+!!str &a1 "foo":
+ !!str bar
+&a2 baz : *a1
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!str &a1 "foo": !!str bar
+&a2 baz: *a1
+
+`;
+
+exports[`spec-example-6-24-verbatim-tags.yml 1`] = `
+! foo :
+ ! baz
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+! foo: ! baz
+
+`;
+
+exports[`spec-example-6-26-tag-shorthands.yml 1`] = `
+%TAG !e! tag:example.com,2000:app/
+---
+- !local foo
+- !!str bar
+- !e!tag%21 baz
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%TAG !e! tag:example.com,2000:app/
+---
+- !local foo
+- !!str bar
+- !e!tag%21 baz
+
+`;
+
+exports[`spec-example-6-28-non-specific-tags.yml 1`] = `
+# Assuming conventional resolution:
+- "12"
+- 12
+- ! 12
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Assuming conventional resolution:
+- "12"
+- 12
+- ! 12
+
+`;
+
+exports[`spec-example-6-29-node-anchors.yml 1`] = `
+First occurrence: &anchor Value
+Second occurrence: *anchor
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+First occurrence: &anchor Value
+Second occurrence: *anchor
+
+`;
+
+exports[`spec-example-7-1-alias-nodes.yml 1`] = `
+First occurrence: &anchor Foo
+Second occurrence: *anchor
+Override anchor: &anchor Bar
+Reuse anchor: *anchor
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+First occurrence: &anchor Foo
+Second occurrence: *anchor
+Override anchor: &anchor Bar
+Reuse anchor: *anchor
+
+`;
+
+exports[`spec-example-7-2-empty-content.yml 1`] = `
+{
+ foo : !!str,
+ !!str : bar,
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ foo: !!str , !!str : bar }
+
+`;
+
+exports[`spec-example-7-3-completely-empty-flow-nodes.yml 1`] = `
+{
+ ? foo :,
+ : bar,
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ foo, : bar }
+
+`;
+
+exports[`spec-example-7-4-double-quoted-implicit-keys.yml 1`] = `
+"implicit block key" : [
+ "implicit flow key" : value,
+ ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"implicit block key": ["implicit flow key": value]
+
+`;
+
+exports[`spec-example-7-5-double-quoted-line-breaks.yml 1`] = `
+"folded
+to a space,
+
+to a line feed, or \\
+ \\ non-content"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"folded
+to a space,
+
+to a line feed, or \\
+ \\ non-content"
+
+`;
+
+exports[`spec-example-7-6-double-quoted-lines.yml 1`] = `
+" 1st non-empty
+
+ 2nd non-empty
+ 3rd non-empty "
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+" 1st non-empty
+
+ 2nd non-empty
+ 3rd non-empty "
+
+`;
+
+exports[`spec-example-7-7-single-quoted-characters.yml 1`] = `
+'here''s to "quotes"'
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+'here''s to "quotes"'
+
+`;
+
+exports[`spec-example-7-8-single-quoted-implicit-keys.yml 1`] = `
+'implicit block key' : [
+ 'implicit flow key' : value,
+ ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"implicit block key": ["implicit flow key": value]
+
+`;
+
+exports[`spec-example-7-9-single-quoted-lines.yml 1`] = `
+' 1st non-empty
+
+ 2nd non-empty
+ 3rd non-empty '
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+" 1st non-empty
+
+ 2nd non-empty
+ 3rd non-empty "
+
+`;
+
+exports[`spec-example-7-10-plain-characters.yml 1`] = `
+# Outside flow collection:
+- ::vector
+- ": - ()"
+- Up, up, and away!
+- -123
+- http://example.com/foo#bar
+# Inside flow collection:
+- [ ::vector,
+ ": - ()",
+ "Up, up and away!",
+ -123,
+ http://example.com/foo#bar ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Outside flow collection:
+- ::vector
+- ": - ()"
+- Up, up, and away!
+- -123
+- http://example.com/foo#bar
+# Inside flow collection:
+- [::vector, ": - ()", "Up, up and away!", -123, http://example.com/foo#bar]
+
+`;
+
+exports[`spec-example-7-11-plain-implicit-keys.yml 1`] = `
+implicit block key : [
+ implicit flow key : value,
+ ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+implicit block key: [implicit flow key: value]
+
+`;
+
+exports[`spec-example-7-12-plain-lines.yml 1`] = `
+1st non-empty
+
+ 2nd non-empty
+ 3rd non-empty
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+1st non-empty
+
+2nd non-empty 3rd non-empty
+
+`;
+
+exports[`spec-example-7-13-flow-sequence.yml 1`] = `
+- [ one, two, ]
+- [three ,four]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- [one, two]
+- [three, four]
+
+`;
+
+exports[`spec-example-7-14-flow-sequence-entries.yml 1`] = `
+[
+"double
+ quoted", 'single
+ quoted',
+plain
+ text, [ nested ],
+single: pair,
+]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+["double
+ quoted", "single
+ quoted", plain text, [nested], single: pair]
+
+`;
+
+exports[`spec-example-7-15-flow-mappings.yml 1`] = `
+- { one : two , three: four , }
+- {five: six,seven : eight}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- { one: two, three: four }
+- { five: six, seven: eight }
+
+`;
+
+exports[`spec-example-7-16-flow-mapping-entries.yml 1`] = `
+{
+? explicit: entry,
+implicit: entry,
+?
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ explicit: entry, implicit: entry, : }
+
+`;
+
+exports[`spec-example-7-17-flow-mapping-separate-values.yml 1`] = `
+{
+unquoted : "separate",
+http://foo.com,
+omitted value:,
+: omitted key,
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ unquoted: "separate", http://foo.com, omitted value, : omitted key }
+
+`;
+
+exports[`spec-example-7-18-flow-mapping-adjacent-values.yml 1`] = `
+{
+"adjacent":value,
+"readable": value,
+"empty":
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ "adjacent": value, "readable": value, "empty" }
+
+`;
+
+exports[`spec-example-7-19-single-pair-flow-mappings.yml 1`] = `
+[
+foo: bar
+]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[foo: bar]
+
+`;
+
+exports[`spec-example-7-20-single-pair-explicit-entry.yml 1`] = `
+[
+? foo
+ bar : baz
+]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[foo bar: baz]
+
+`;
+
+exports[`spec-example-7-21-single-pair-implicit-entries.yml 1`] = `
+- [ YAML : separate ]
+- [ : empty key entry ]
+- [ {JSON: like}:adjacent ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- [YAML: separate]
+- [: empty key entry]
+- [{ JSON: like }: adjacent]
+
+`;
+
+exports[`spec-example-7-23-flow-content.yml 1`] = `
+- [ a, b ]
+- { a: b }
+- "a"
+- 'b'
+- c
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- [a, b]
+- { a: b }
+- "a"
+- "b"
+- c
+
+`;
+
+exports[`spec-example-7-24-flow-nodes.yml 1`] = `
+- !!str "a"
+- 'b'
+- &anchor "c"
+- *anchor
+- !!str
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- !!str "a"
+- "b"
+- &anchor "c"
+- *anchor
+- !!str
+
+`;
+
+exports[`spec-example-8-1-block-scalar-header.yml 1`] = `
+- | # Empty header↓
+ literal
+- >1 # Indentation indicator↓
+ folded
+- |+ # Chomping indicator↓
+ keep
+
+- >1- # Both indicators↓
+ strip
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- | # Empty header↓
+ literal
+- >1 # Indentation indicator↓
+ folded
+- |+ # Chomping indicator↓
+ keep
+
+- >1- # Both indicators↓
+ strip
+
+`;
+
+exports[`spec-example-8-2-block-indentation-indicator.yml 1`] = `
+- |
+ detected
+- >
+
+
+ # detected
+- |1
+ explicit
+- >
+
+ detected
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- |
+ detected
+- >
+
+
+ # detected
+- |1
+ explicit
+- >
+
+ detected
+
+`;
+
+exports[`spec-example-8-4-chomping-final-line-break.yml 1`] = `
+strip: |-
+ text
+clip: |
+ text
+keep: |+
+ text
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+strip: |-
+ text
+clip: |
+ text
+keep: |+
+ text
+
+`;
+
+exports[`spec-example-8-5-chomping-trailing-lines.yml 1`] = `
+ # Strip
+ # Comments:
+strip: |-
+ # text
+
+ # Clip
+ # comments:
+
+clip: |
+ # text
+
+ # Keep
+ # comments:
+
+keep: |+
+ # text
+
+ # Trail
+ # comments.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# Strip
+# Comments:
+strip: |-
+ # text
+# Clip
+# comments:
+
+clip: |
+ # text
+# Keep
+# comments:
+
+keep: |+
+ # text
+
+# Trail
+# comments.
+
+`;
+
+exports[`spec-example-8-6-empty-scalar-chomping.yml 1`] = `
+strip: >-
+
+clip: >
+
+keep: |+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+strip: >-
+clip: >
+keep: |+
+
+
+`;
+
+exports[`spec-example-8-7-literal-scalar.yml 1`] = `
+|
+ literal
+ text
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+|
+ literal
+ text
+
+`;
+
+exports[`spec-example-8-8-literal-content.yml 1`] = `
+|
+
+
+ literal
+
+
+ text
+
+ # Comment
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+|
+
+
+ literal
+
+
+ text
+
+# Comment
+
+`;
+
+exports[`spec-example-8-9-folded-scalar.yml 1`] = `
+>
+ folded
+ text
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>
+ folded text
+
+`;
+
+exports[`spec-example-8-10-folded-lines-8-13-final-empty-lines.yml 1`] = `
+>
+
+ folded
+ line
+
+ next
+ line
+ * bullet
+
+ * list
+ * lines
+
+ last
+ line
+
+# Comment
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>
+
+ folded line
+
+ next line
+ * bullet
+
+ * list
+ * lines
+
+ last line
+
+# Comment
+
+`;
+
+exports[`spec-example-8-14-block-sequence.yml 1`] = `
+block sequence:
+ - one
+ - two : three
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+block sequence:
+ - one
+ - two: three
+
+`;
+
+exports[`spec-example-8-15-block-sequence-entry-types.yml 1`] = `
+- # Empty
+- |
+ block node
+- - one # Compact
+ - two # sequence
+- one: two # Compact mapping
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- # Empty
+- |
+ block node
+- - one # Compact
+ - two # sequence
+- one: two # Compact mapping
+
+`;
+
+exports[`spec-example-8-16-block-mappings.yml 1`] = `
+block mapping:
+ key: value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+block mapping:
+ key: value
+
+`;
+
+exports[`spec-example-8-17-explicit-block-mapping-entries.yml 1`] = `
+? explicit key # Empty value
+? |
+ block key
+: - one # Explicit compact
+ - two # block value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+? explicit key # Empty value
+? |
+ block key
+: - one # Explicit compact
+ - two # block value
+
+`;
+
+exports[`spec-example-8-18-implicit-block-mapping-entries.yml 1`] = `
+plain key: in-line value
+: # Both empty
+"quoted key":
+- entry
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+plain key: in-line value
+: # Both empty
+"quoted key":
+ - entry
+
+`;
+
+exports[`spec-example-8-19-compact-block-mappings.yml 1`] = `
+- sun: yellow
+- ? earth: blue
+ : moon: white
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- sun: yellow
+- ? earth: blue
+ : moon: white
+
+`;
+
+exports[`spec-example-8-20-block-node-types.yml 1`] = `
+-
+ "flow in block"
+- >
+ Block scalar
+- !!map # Block collection
+ foo : bar
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- "flow in block"
+- >
+ Block scalar
+- !!map # Block collection
+ foo: bar
+
+`;
+
+exports[`spec-example-8-21-block-scalar-nodes.yml 1`] = `
+literal: |2
+ value
+folded:
+ !foo
+ >1
+ value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+literal: |2
+ value
+folded: !foo >1
+ value
+
+`;
+
+exports[`spec-example-8-22-block-collection-nodes.yml 1`] = `
+sequence: !!seq
+- entry
+- !!seq
+ - nested
+mapping: !!map
+ foo: bar
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+sequence: !!seq
+ - entry
+ - !!seq
+ - nested
+mapping: !!map
+ foo: bar
+
+`;
+
+exports[`spec-example-9-2-document-markers.yml 1`] = `
+%YAML 1.2
+---
+Document
+... # Suffix
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%YAML 1.2
+---
+Document
+... # Suffix
+
+`;
+
+exports[`spec-example-9-3-bare-documents.yml 1`] = `
+Bare
+document
+...
+# No document
+...
+|
+%!PS-Adobe-2.0 # Not the first line
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Bare document
+...
+# No document
+...
+|
+ %!PS-Adobe-2.0 # Not the first line
+
+`;
+
+exports[`spec-example-9-4-explicit-documents.yml 1`] = `
+---
+{ matches
+% : 20 }
+...
+---
+# Empty
+...
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{ matches %: 20 }
+...
+# Empty
+
+`;
+
+exports[`spec-example-9-5-directives-documents.yml 1`] = `
+%YAML 1.2
+--- |
+%!PS-Adobe-2.0
+...
+%YAML1.2
+---
+# Empty
+...
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+%YAML 1.2
+---
+|
+ %!PS-Adobe-2.0
+...
+%YAML1.2
+---
+# Empty
+
+`;
+
+exports[`spec-example-9-6-stream.yml 1`] = `
+Document
+---
+# Empty
+...
+%YAML 1.2
+---
+matches %: 20
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Document
+...
+# Empty
+...
+%YAML 1.2
+---
+matches %: 20
+
+`;
+
+exports[`tab-after-document-header.yml 1`] = `
+--- scalar
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+scalar
+
+`;
+
+exports[`tab-at-beginning-of-line-followed-by-a-flow-mapping.yml 1`] = `
+ {}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+{}
+
+`;
+
+exports[`tags-for-block-objects.yml 1`] = `
+foo: !!seq
+ - !!str a
+ - !!map
+ key: !!str value
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+foo: !!seq
+ - !!str a
+ - !!map
+ key: !!str value
+
+`;
+
+exports[`tags-for-flow-objects.yml 1`] = `
+!!map {
+ k: !!seq
+ [ a, !!str b]
+}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map { k: !!seq [a, !!str b] }
+
+`;
+
+exports[`tags-for-root-objects.yml 1`] = `
+--- !!map
+? a
+: b
+--- !!seq
+- !!str c
+--- !!str
+d
+e
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!map
+a: b
+...
+!!seq
+- !!str c
+...
+!!str d e
+
+`;
+
+exports[`tags-in-block-sequence.yml 1`] = `
+ - !!str a
+ - b
+ - !!int 42
+ - d
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- !!str a
+- b
+- !!int 42
+- d
+
+`;
+
+exports[`tags-in-explicit-mapping.yml 1`] = `
+? !!str a
+: !!int 47
+? c
+: !!str d
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!str a: !!int 47
+c: !!str d
+
+`;
+
+exports[`tags-in-implicit-mapping.yml 1`] = `
+!!str a: b
+c: !!int 42
+e: !!str f
+g: h
+!!int 23: !!bool false
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!str a: b
+c: !!int 42
+e: !!str f
+g: h
+!!int 23: !!bool false
+
+`;
+
+exports[`tags-on-empty-scalars.yml 1`] = `
+- !!str
+-
+ !!null : a
+ b: !!str
+- !!str : !!null
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- !!str
+- !!null : a
+ b: !!str
+- !!str : !!null
+
+`;
+
+exports[`three-dashes-and-content-without-space.yml 1`] = `
+---word1
+word2
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+---word1 word2
+
+`;
+
+exports[`various-combinations-of-tags-and-anchors.yml 1`] = `
+---
+&a1
+!!str
+scalar1
+---
+!!str
+&a2
+scalar2
+---
+&a3
+!!str scalar3
+---
+&a4 !!map
+&a5 !!str key5: value4
+---
+a6: 1
+&anchor6 b6: 2
+---
+!!map
+&a8 !!str key8: value7
+---
+!!map
+!!str &a10 key10: value9
+---
+!!str &a11
+value11
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+!!str &a1 scalar1
+...
+!!str &a2 scalar2
+...
+!!str &a3 scalar3
+...
+!!map &a4
+!!str &a5 key5: value4
+...
+a6: 1
+&anchor6 b6: 2
+...
+!!map
+!!str &a8 key8: value7
+...
+!!map
+!!str &a10 key10: value9
+...
+!!str &a11 value11
+
+`;
+
+exports[`various-location-of-anchors-in-flow-sequence.yml 1`] = `
+&flowseq [
+ a: b,
+ &c c: d,
+ { &e e: f },
+ &g { g: h }
+]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+&flowseq [a: b, &c c: d, { &e e: f }, &g { g: h }]
+
+`;
+
+exports[`various-trailing-comments.yml 1`] = `
+a: "double
+ quotes" # lala
+b: plain
+ value # lala
+c : #lala
+ d
+? # lala
+ - seq1
+: # lala
+ - #lala
+ seq2
+e:
+ &node # lala
+ - x: y
+block: > # lala
+ abcde
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: "double
+ quotes" # lala
+b: plain value # lala
+c: #lala
+ d
+? # lala
+ - seq1
+: # lala
+ - #lala
+ seq2
+e: &node # lala
+ - x: y
+block: > # lala
+ abcde
+
+`;
+
+exports[`various-trailing-tabs.yml 1`] = `
+a: b
+seq:
+ - a
+c: d #X
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+a: b
+seq:
+ - a
+c: d #X
+
+`;
+
+exports[`whitespace-after-scalars-in-flow.yml 1`] = `
+- [a, b , c ]
+- { "a" : b
+ , c : 'd' ,
+ e : "f"
+ }
+- [ ]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- [a, b, c]
+- { "a": b, c: "d", e: "f" }
+- []
+
+`;
+
+exports[`whitespace-around-colon-in-mappings.yml 1`] = `
+"top1" :
+ "key1" : &alias1 scalar1
+'top2' :
+ 'key2' : &alias2 scalar2
+top3: &node3
+ *alias1 : scalar3
+top4:
+ *alias2 : scalar4
+top5 :
+ scalar5
+top6:
+ &anchor6 'key6' : scalar6
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"top1":
+ "key1": &alias1 scalar1
+"top2":
+ "key2": &alias2 scalar2
+top3: &node3
+ *alias1 : scalar3
+top4:
+ *alias2 : scalar4
+top5: scalar5
+top6:
+ &anchor6 "key6": scalar6
+
+`;
+
+exports[`zero-indented-block-scalar.yml 1`] = `
+--- >
+line1
+line2
+line3
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>
+ line1 line2 line3
+
+`;
+
+exports[`zero-indented-block-scalar-with-line-that-looks-like-a-comment.yml 1`] = `
+--- >
+line1
+# no comment
+line3
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+>
+ line1 # no comment line3
+
+`;
diff --git a/tests/yaml_spec/aliases-in-block-sequence.yml b/tests/yaml_spec/aliases-in-block-sequence.yml
new file mode 100644
index 000000000..b3c45b5c0
--- /dev/null
+++ b/tests/yaml_spec/aliases-in-block-sequence.yml
@@ -0,0 +1,4 @@
+- &a a
+- &b b
+- *a
+- *b
diff --git a/tests/yaml_spec/aliases-in-explicit-block-mapping.yml b/tests/yaml_spec/aliases-in-explicit-block-mapping.yml
new file mode 100644
index 000000000..b1490a679
--- /dev/null
+++ b/tests/yaml_spec/aliases-in-explicit-block-mapping.yml
@@ -0,0 +1,3 @@
+? &a a
+: &b b
+: *a
diff --git a/tests/yaml_spec/allowed-characters-in-alias.yml b/tests/yaml_spec/allowed-characters-in-alias.yml
new file mode 100644
index 000000000..43c7a1516
--- /dev/null
+++ b/tests/yaml_spec/allowed-characters-in-alias.yml
@@ -0,0 +1,2 @@
+a: &:@*!$": scalar a
+b: *:@*!$":
diff --git a/tests/yaml_spec/allowed-characters-in-keys.yml b/tests/yaml_spec/allowed-characters-in-keys.yml
new file mode 100644
index 000000000..3a5b0a3fb
--- /dev/null
+++ b/tests/yaml_spec/allowed-characters-in-keys.yml
@@ -0,0 +1,5 @@
+a!"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~: safe
+?foo: safe question mark
+:foo: safe colon
+-foo: safe dash
+this is#not: a comment
diff --git a/tests/yaml_spec/allowed-characters-in-plain-scalars.yml b/tests/yaml_spec/allowed-characters-in-plain-scalars.yml
new file mode 100644
index 000000000..ed2516d57
--- /dev/null
+++ b/tests/yaml_spec/allowed-characters-in-plain-scalars.yml
@@ -0,0 +1,5 @@
+safe: a!"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~
+ !"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~
+safe question mark: ?foo
+safe colon: :foo
+safe dash: -foo
diff --git a/tests/yaml_spec/allowed-characters-in-quoted-mapping-key.yml b/tests/yaml_spec/allowed-characters-in-quoted-mapping-key.yml
new file mode 100644
index 000000000..5b8cd26e3
--- /dev/null
+++ b/tests/yaml_spec/allowed-characters-in-quoted-mapping-key.yml
@@ -0,0 +1,2 @@
+"foo\nbar:baz\tx \\$%^&*()x": 23
+'x\ny:z\tx $%^&*()x': 24
diff --git a/tests/yaml_spec/anchor-before-zero-indented-sequence.yml b/tests/yaml_spec/anchor-before-zero-indented-sequence.yml
new file mode 100644
index 000000000..6a8937a91
--- /dev/null
+++ b/tests/yaml_spec/anchor-before-zero-indented-sequence.yml
@@ -0,0 +1,5 @@
+---
+seq:
+ &anchor
+- a
+- b
diff --git a/tests/yaml_spec/anchor-with-unicode-character.yml b/tests/yaml_spec/anchor-with-unicode-character.yml
new file mode 100644
index 000000000..72c1c378f
--- /dev/null
+++ b/tests/yaml_spec/anchor-with-unicode-character.yml
@@ -0,0 +1,2 @@
+---
+- &😁 unicode anchor
diff --git a/tests/yaml_spec/anchors-and-tags.yml b/tests/yaml_spec/anchors-and-tags.yml
new file mode 100644
index 000000000..8574f9575
--- /dev/null
+++ b/tests/yaml_spec/anchors-and-tags.yml
@@ -0,0 +1,4 @@
+ - &a !!str a
+ - !!int 2
+ - !!int &c 4
+ - &d d
diff --git a/tests/yaml_spec/anchors-in-mapping.yml b/tests/yaml_spec/anchors-in-mapping.yml
new file mode 100644
index 000000000..64d718fdb
--- /dev/null
+++ b/tests/yaml_spec/anchors-in-mapping.yml
@@ -0,0 +1,2 @@
+&a a: b
+c: &d d
diff --git a/tests/yaml_spec/anchors-with-colon-in-name.yml b/tests/yaml_spec/anchors-with-colon-in-name.yml
new file mode 100644
index 000000000..243c466a7
--- /dev/null
+++ b/tests/yaml_spec/anchors-with-colon-in-name.yml
@@ -0,0 +1,3 @@
+&a: key: &a value
+foo:
+ *a:
diff --git a/tests/yaml_spec/backslashes-in-singlequotes.yml b/tests/yaml_spec/backslashes-in-singlequotes.yml
new file mode 100644
index 000000000..33424c030
--- /dev/null
+++ b/tests/yaml_spec/backslashes-in-singlequotes.yml
@@ -0,0 +1 @@
+'foo: bar\': baz'
diff --git a/tests/yaml_spec/bare-document-after-document-end-marker.yml b/tests/yaml_spec/bare-document-after-document-end-marker.yml
new file mode 100644
index 000000000..696494465
--- /dev/null
+++ b/tests/yaml_spec/bare-document-after-document-end-marker.yml
@@ -0,0 +1,4 @@
+---
+scalar1
+...
+key: value
diff --git a/tests/yaml_spec/blank-lines.yml b/tests/yaml_spec/blank-lines.yml
new file mode 100644
index 000000000..4987de226
--- /dev/null
+++ b/tests/yaml_spec/blank-lines.yml
@@ -0,0 +1,12 @@
+foo: 1
+
+bar: 2
+
+text: |
+ a
+
+ b
+
+ c
+
+ d
diff --git a/tests/yaml_spec/block-mapping-with-missing-values.yml b/tests/yaml_spec/block-mapping-with-missing-values.yml
new file mode 100644
index 000000000..e36dcc928
--- /dev/null
+++ b/tests/yaml_spec/block-mapping-with-missing-values.yml
@@ -0,0 +1,3 @@
+? a
+? b
+c:
diff --git a/tests/yaml_spec/block-mapping-with-multiline-scalars.yml b/tests/yaml_spec/block-mapping-with-multiline-scalars.yml
new file mode 100644
index 000000000..247a8cd5d
--- /dev/null
+++ b/tests/yaml_spec/block-mapping-with-multiline-scalars.yml
@@ -0,0 +1,6 @@
+? a
+ true
+: null
+ d
+? e
+ 42
diff --git a/tests/yaml_spec/block-mappings-in-block-sequence.yml b/tests/yaml_spec/block-mappings-in-block-sequence.yml
new file mode 100644
index 000000000..30c49a332
--- /dev/null
+++ b/tests/yaml_spec/block-mappings-in-block-sequence.yml
@@ -0,0 +1,4 @@
+ - key: value
+ key2: value2
+ -
+ key3: value3
diff --git a/tests/yaml_spec/block-scalar-indicator-order.yml b/tests/yaml_spec/block-scalar-indicator-order.yml
new file mode 100644
index 000000000..3d603d18f
--- /dev/null
+++ b/tests/yaml_spec/block-scalar-indicator-order.yml
@@ -0,0 +1,4 @@
+- |2-
+ explicit indent and chomp
+- |-2
+ chomp and explicit indent
diff --git a/tests/yaml_spec/block-scalar-keep.yml b/tests/yaml_spec/block-scalar-keep.yml
new file mode 100644
index 000000000..1ff9bfa3c
--- /dev/null
+++ b/tests/yaml_spec/block-scalar-keep.yml
@@ -0,0 +1,5 @@
+--- |+
+ ab
+
+
+...
diff --git a/tests/yaml_spec/block-scalar-strip.yml b/tests/yaml_spec/block-scalar-strip.yml
new file mode 100644
index 000000000..1056edd74
--- /dev/null
+++ b/tests/yaml_spec/block-scalar-strip.yml
@@ -0,0 +1,5 @@
+|-
+ ab
+
+
+...
diff --git a/tests/yaml_spec/block-scalar-with-spaces-only.yml b/tests/yaml_spec/block-scalar-with-spaces-only.yml
new file mode 100644
index 000000000..3574e0214
--- /dev/null
+++ b/tests/yaml_spec/block-scalar-with-spaces-only.yml
@@ -0,0 +1,5 @@
+empty block scalar: >
+
+
+
+ # comment
diff --git a/tests/yaml_spec/block-sequence-in-block-mapping.yml b/tests/yaml_spec/block-sequence-in-block-mapping.yml
new file mode 100644
index 000000000..6b937f800
--- /dev/null
+++ b/tests/yaml_spec/block-sequence-in-block-mapping.yml
@@ -0,0 +1,3 @@
+key:
+ - item1
+ - item2
diff --git a/tests/yaml_spec/block-sequence-in-block-sequence.yml b/tests/yaml_spec/block-sequence-in-block-sequence.yml
new file mode 100644
index 000000000..4738eb107
--- /dev/null
+++ b/tests/yaml_spec/block-sequence-in-block-sequence.yml
@@ -0,0 +1,3 @@
+- - s1_i1
+ - s1_i2
+- s2
diff --git a/tests/yaml_spec/block-submapping.yml b/tests/yaml_spec/block-submapping.yml
new file mode 100644
index 000000000..32d211420
--- /dev/null
+++ b/tests/yaml_spec/block-submapping.yml
@@ -0,0 +1,3 @@
+foo:
+ bar: 1
+baz: 2
diff --git a/tests/yaml_spec/colon-in-double-quoted-string.yml b/tests/yaml_spec/colon-in-double-quoted-string.yml
new file mode 100644
index 000000000..912727ef4
--- /dev/null
+++ b/tests/yaml_spec/colon-in-double-quoted-string.yml
@@ -0,0 +1 @@
+"foo: bar\": baz"
diff --git a/tests/yaml_spec/comment-in-flow-sequence-before-comma.yml b/tests/yaml_spec/comment-in-flow-sequence-before-comma.yml
new file mode 100644
index 000000000..312847e51
--- /dev/null
+++ b/tests/yaml_spec/comment-in-flow-sequence-before-comma.yml
@@ -0,0 +1,4 @@
+---
+[ word1
+# comment
+, word2]
diff --git a/tests/yaml_spec/construct-binary.yml b/tests/yaml_spec/construct-binary.yml
new file mode 100644
index 000000000..dcdb16f3b
--- /dev/null
+++ b/tests/yaml_spec/construct-binary.yml
@@ -0,0 +1,12 @@
+canonical: !!binary "\
+ R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\
+ OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\
+ +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\
+ AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs="
+generic: !!binary |
+ R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5
+ OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+
+ +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC
+ AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=
+description:
+ The binary value above is a tiny arrow encoded as a gif image.
diff --git a/tests/yaml_spec/document-start-on-last-line.yml b/tests/yaml_spec/document-start-on-last-line.yml
new file mode 100644
index 000000000..6e88f36f7
--- /dev/null
+++ b/tests/yaml_spec/document-start-on-last-line.yml
@@ -0,0 +1,3 @@
+---
+a: b
+---
diff --git a/tests/yaml_spec/document-with-footer.yml b/tests/yaml_spec/document-with-footer.yml
new file mode 100644
index 000000000..4fc70de56
--- /dev/null
+++ b/tests/yaml_spec/document-with-footer.yml
@@ -0,0 +1,2 @@
+aaa: bbb
+...
diff --git a/tests/yaml_spec/empty-lines-at-end-of-document.yml b/tests/yaml_spec/empty-lines-at-end-of-document.yml
new file mode 100644
index 000000000..df6563abd
--- /dev/null
+++ b/tests/yaml_spec/empty-lines-at-end-of-document.yml
@@ -0,0 +1,4 @@
+:
+
+
+
diff --git a/tests/yaml_spec/empty-lines-between-mapping-elements.yml b/tests/yaml_spec/empty-lines-between-mapping-elements.yml
new file mode 100644
index 000000000..21b320d57
--- /dev/null
+++ b/tests/yaml_spec/empty-lines-between-mapping-elements.yml
@@ -0,0 +1,4 @@
+1: 2
+
+
+3: 4
diff --git a/tests/yaml_spec/empty-stream.yml b/tests/yaml_spec/empty-stream.yml
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/yaml_spec/escaped-slash-in-double-quotes.yml b/tests/yaml_spec/escaped-slash-in-double-quotes.yml
new file mode 100644
index 000000000..e47bf7231
--- /dev/null
+++ b/tests/yaml_spec/escaped-slash-in-double-quotes.yml
@@ -0,0 +1 @@
+escaped slash: "a\/b"
diff --git a/tests/yaml_spec/explicit-non-specific-tag.yml b/tests/yaml_spec/explicit-non-specific-tag.yml
new file mode 100644
index 000000000..eae54f783
--- /dev/null
+++ b/tests/yaml_spec/explicit-non-specific-tag.yml
@@ -0,0 +1 @@
+! a
diff --git a/tests/yaml_spec/flow-mapping-in-block-sequence.yml b/tests/yaml_spec/flow-mapping-in-block-sequence.yml
new file mode 100644
index 000000000..9d8ba51ee
--- /dev/null
+++ b/tests/yaml_spec/flow-mapping-in-block-sequence.yml
@@ -0,0 +1 @@
+- {a: b}
diff --git a/tests/yaml_spec/flow-mapping.yml b/tests/yaml_spec/flow-mapping.yml
new file mode 100644
index 000000000..fc448be72
--- /dev/null
+++ b/tests/yaml_spec/flow-mapping.yml
@@ -0,0 +1 @@
+{foo: you, bar: far}
diff --git a/tests/yaml_spec/flow-sequence-in-block-mapping.yml b/tests/yaml_spec/flow-sequence-in-block-mapping.yml
new file mode 100644
index 000000000..8238fdf55
--- /dev/null
+++ b/tests/yaml_spec/flow-sequence-in-block-mapping.yml
@@ -0,0 +1 @@
+a: [b, c]
diff --git a/tests/yaml_spec/flow-sequence-in-flow-mapping.yml b/tests/yaml_spec/flow-sequence-in-flow-mapping.yml
new file mode 100644
index 000000000..e6e30e2a9
--- /dev/null
+++ b/tests/yaml_spec/flow-sequence-in-flow-mapping.yml
@@ -0,0 +1 @@
+{a: [b, c], [d, e]: f}
diff --git a/tests/yaml_spec/flow-sequence-in-flow-sequence.yml b/tests/yaml_spec/flow-sequence-in-flow-sequence.yml
new file mode 100644
index 000000000..5f76a2e4c
--- /dev/null
+++ b/tests/yaml_spec/flow-sequence-in-flow-sequence.yml
@@ -0,0 +1 @@
+[a, [b, c]]
diff --git a/tests/yaml_spec/flow-sequence.yml b/tests/yaml_spec/flow-sequence.yml
new file mode 100644
index 000000000..bf3415868
--- /dev/null
+++ b/tests/yaml_spec/flow-sequence.yml
@@ -0,0 +1 @@
+[foo, bar, 42]
diff --git a/tests/yaml_spec/folded-block-scalar.yml b/tests/yaml_spec/folded-block-scalar.yml
new file mode 100644
index 000000000..f63944e24
--- /dev/null
+++ b/tests/yaml_spec/folded-block-scalar.yml
@@ -0,0 +1,8 @@
+>
+ ab
+ cd
+
+ ef
+
+
+ gh
diff --git a/tests/yaml_spec/implicit-flow-mapping-key-on-one-line.yml b/tests/yaml_spec/implicit-flow-mapping-key-on-one-line.yml
new file mode 100644
index 000000000..b13c841c4
--- /dev/null
+++ b/tests/yaml_spec/implicit-flow-mapping-key-on-one-line.yml
@@ -0,0 +1 @@
+[flow]: block
diff --git a/tests/yaml_spec/jsfmt.spec.js b/tests/yaml_spec/jsfmt.spec.js
new file mode 100644
index 000000000..c7bdf4fc3
--- /dev/null
+++ b/tests/yaml_spec/jsfmt.spec.js
@@ -0,0 +1 @@
+run_spec(__dirname, ["yaml"], { useTabs: true });
diff --git a/tests/yaml_spec/key-with-anchor-after-missing-explicit-mapping-value.yml b/tests/yaml_spec/key-with-anchor-after-missing-explicit-mapping-value.yml
new file mode 100644
index 000000000..b6fca2a3c
--- /dev/null
+++ b/tests/yaml_spec/key-with-anchor-after-missing-explicit-mapping-value.yml
@@ -0,0 +1,4 @@
+---
+a: 1
+? b
+&anchor c: 3
diff --git a/tests/yaml_spec/literal-block-scalar.yml b/tests/yaml_spec/literal-block-scalar.yml
new file mode 100644
index 000000000..d472650e3
--- /dev/null
+++ b/tests/yaml_spec/literal-block-scalar.yml
@@ -0,0 +1,8 @@
+a: |
+ ab
+
+ cd
+ ef
+
+
+...
diff --git a/tests/yaml_spec/literal-unicode.yml b/tests/yaml_spec/literal-unicode.yml
new file mode 100644
index 000000000..3cf0d466d
--- /dev/null
+++ b/tests/yaml_spec/literal-unicode.yml
@@ -0,0 +1,2 @@
+---
+wanted: love ♥ and peace ☮
diff --git a/tests/yaml_spec/lookahead-test-cases.yml b/tests/yaml_spec/lookahead-test-cases.yml
new file mode 100644
index 000000000..c9219e952
--- /dev/null
+++ b/tests/yaml_spec/lookahead-test-cases.yml
@@ -0,0 +1,2 @@
+- bla"keks: foo
+- bla]keks: foo
diff --git a/tests/yaml_spec/mapping-key-and-flow-sequence-item-anchors.yml b/tests/yaml_spec/mapping-key-and-flow-sequence-item-anchors.yml
new file mode 100644
index 000000000..19d1e3ee3
--- /dev/null
+++ b/tests/yaml_spec/mapping-key-and-flow-sequence-item-anchors.yml
@@ -0,0 +1,3 @@
+---
+&mapping
+&key [ &item a, b, c ]: value
diff --git a/tests/yaml_spec/mapping-with-anchor-on-document-start-line.yml b/tests/yaml_spec/mapping-with-anchor-on-document-start-line.yml
new file mode 100644
index 000000000..9c0012073
--- /dev/null
+++ b/tests/yaml_spec/mapping-with-anchor-on-document-start-line.yml
@@ -0,0 +1 @@
+--- &anchor a: b
diff --git a/tests/yaml_spec/mixed-block-mapping-explicit-to-implicit.yml b/tests/yaml_spec/mixed-block-mapping-explicit-to-implicit.yml
new file mode 100644
index 000000000..a491d4ace
--- /dev/null
+++ b/tests/yaml_spec/mixed-block-mapping-explicit-to-implicit.yml
@@ -0,0 +1,3 @@
+? a
+: 13
+1.5: d
diff --git a/tests/yaml_spec/mixed-block-mapping-implicit-to-explicit.yml b/tests/yaml_spec/mixed-block-mapping-implicit-to-explicit.yml
new file mode 100644
index 000000000..403ca3630
--- /dev/null
+++ b/tests/yaml_spec/mixed-block-mapping-implicit-to-explicit.yml
@@ -0,0 +1,3 @@
+a: 4.2
+? 23
+: d
diff --git a/tests/yaml_spec/multi-level-mapping-indent.yml b/tests/yaml_spec/multi-level-mapping-indent.yml
new file mode 100644
index 000000000..25f0447c4
--- /dev/null
+++ b/tests/yaml_spec/multi-level-mapping-indent.yml
@@ -0,0 +1,6 @@
+a:
+ b:
+ c: d
+ e:
+ f: g
+h: i
diff --git a/tests/yaml_spec/multiline-plain-scalar-with-empty-line.yml b/tests/yaml_spec/multiline-plain-scalar-with-empty-line.yml
new file mode 100644
index 000000000..71600b85b
--- /dev/null
+++ b/tests/yaml_spec/multiline-plain-scalar-with-empty-line.yml
@@ -0,0 +1,5 @@
+---
+plain: a
+ b
+
+ c
diff --git a/tests/yaml_spec/multiline-scalar-at-top-level.yml b/tests/yaml_spec/multiline-scalar-at-top-level.yml
new file mode 100644
index 000000000..8a21b02a0
--- /dev/null
+++ b/tests/yaml_spec/multiline-scalar-at-top-level.yml
@@ -0,0 +1,6 @@
+a
+b
+ c
+d
+
+e
diff --git a/tests/yaml_spec/multiline-scalar-in-mapping.yml b/tests/yaml_spec/multiline-scalar-in-mapping.yml
new file mode 100644
index 000000000..62fe04a38
--- /dev/null
+++ b/tests/yaml_spec/multiline-scalar-in-mapping.yml
@@ -0,0 +1,5 @@
+a: b
+ c
+d:
+ e
+ f
diff --git a/tests/yaml_spec/multiline-scalar-that-looks-like-a-yaml-directive.yml b/tests/yaml_spec/multiline-scalar-that-looks-like-a-yaml-directive.yml
new file mode 100644
index 000000000..dbe36b960
--- /dev/null
+++ b/tests/yaml_spec/multiline-scalar-that-looks-like-a-yaml-directive.yml
@@ -0,0 +1,3 @@
+---
+scalar
+%YAML 1.2
diff --git a/tests/yaml_spec/multiple-entry-block-sequence.yml b/tests/yaml_spec/multiple-entry-block-sequence.yml
new file mode 100644
index 000000000..5fae9f4f6
--- /dev/null
+++ b/tests/yaml_spec/multiple-entry-block-sequence.yml
@@ -0,0 +1,3 @@
+- foo
+- bar
+- 42
diff --git a/tests/yaml_spec/multiple-pair-block-mapping.yml b/tests/yaml_spec/multiple-pair-block-mapping.yml
new file mode 100644
index 000000000..a40b18e8b
--- /dev/null
+++ b/tests/yaml_spec/multiple-pair-block-mapping.yml
@@ -0,0 +1,3 @@
+foo: blue
+bar: arrr
+baz: jazz
diff --git a/tests/yaml_spec/nested-flow-collections-on-one-line.yml b/tests/yaml_spec/nested-flow-collections-on-one-line.yml
new file mode 100644
index 000000000..04e631bbb
--- /dev/null
+++ b/tests/yaml_spec/nested-flow-collections-on-one-line.yml
@@ -0,0 +1,2 @@
+---
+{ a: [b, c, { d: [e, f] } ] }
diff --git a/tests/yaml_spec/nested-flow-collections.yml b/tests/yaml_spec/nested-flow-collections.yml
new file mode 100644
index 000000000..d8f46c457
--- /dev/null
+++ b/tests/yaml_spec/nested-flow-collections.yml
@@ -0,0 +1,8 @@
+---
+{
+ a: [
+ b, c, {
+ d: [e, f]
+ }
+ ]
+}
diff --git a/tests/yaml_spec/node-anchor-and-tag-on-seperate-lines.yml b/tests/yaml_spec/node-anchor-and-tag-on-seperate-lines.yml
new file mode 100644
index 000000000..35d556dd1
--- /dev/null
+++ b/tests/yaml_spec/node-anchor-and-tag-on-seperate-lines.yml
@@ -0,0 +1,3 @@
+key: &anchor
+ !!map
+ a: b
diff --git a/tests/yaml_spec/node-and-mapping-key-anchors.yml b/tests/yaml_spec/node-and-mapping-key-anchors.yml
new file mode 100644
index 000000000..76660a8f5
--- /dev/null
+++ b/tests/yaml_spec/node-and-mapping-key-anchors.yml
@@ -0,0 +1,17 @@
+---
+top1: &node1
+ &k1 key1: one
+top2: &node2 # comment
+ key2: two
+top3:
+ &k3 key3: three
+top4:
+ &node4
+ &k4 key4: four
+top5:
+ &node5
+ key5: five
+top6: &val6
+ six
+top7:
+ &val7 seven
diff --git a/tests/yaml_spec/non-specific-tags-on-scalars.yml b/tests/yaml_spec/non-specific-tags-on-scalars.yml
new file mode 100644
index 000000000..81acc2166
--- /dev/null
+++ b/tests/yaml_spec/non-specific-tags-on-scalars.yml
@@ -0,0 +1,6 @@
+- plain
+- "double quoted"
+- 'single quoted'
+- >
+ block
+- plain again
diff --git a/tests/yaml_spec/plain-mapping-key-ending-with-colon.yml b/tests/yaml_spec/plain-mapping-key-ending-with-colon.yml
new file mode 100644
index 000000000..79d518dd7
--- /dev/null
+++ b/tests/yaml_spec/plain-mapping-key-ending-with-colon.yml
@@ -0,0 +1,2 @@
+---
+key ends with two colons::: value
diff --git a/tests/yaml_spec/plain-scalar-looking-like-key-comment-anchor-and-tag.yml b/tests/yaml_spec/plain-scalar-looking-like-key-comment-anchor-and-tag.yml
new file mode 100644
index 000000000..fa0ab6676
--- /dev/null
+++ b/tests/yaml_spec/plain-scalar-looking-like-key-comment-anchor-and-tag.yml
@@ -0,0 +1,2 @@
+k:#foo
+ &a !t s
diff --git a/tests/yaml_spec/plain-scalar-with-backslashes.yml b/tests/yaml_spec/plain-scalar-with-backslashes.yml
new file mode 100644
index 000000000..9a786b307
--- /dev/null
+++ b/tests/yaml_spec/plain-scalar-with-backslashes.yml
@@ -0,0 +1,2 @@
+---
+plain\value\with\backslashes
diff --git a/tests/yaml_spec/plain-url-in-flow-mapping.yml b/tests/yaml_spec/plain-url-in-flow-mapping.yml
new file mode 100644
index 000000000..fa95c05e2
--- /dev/null
+++ b/tests/yaml_spec/plain-url-in-flow-mapping.yml
@@ -0,0 +1 @@
+- { url: http://example.org }
diff --git a/tests/yaml_spec/scalars-on-line.yml b/tests/yaml_spec/scalars-on-line.yml
new file mode 100644
index 000000000..5cbbe234c
--- /dev/null
+++ b/tests/yaml_spec/scalars-on-line.yml
@@ -0,0 +1,3 @@
+--- "quoted
+string"
+--- &node foo
diff --git a/tests/yaml_spec/sequence-entry-that-looks-like-two-with-wrong-indentation.yml b/tests/yaml_spec/sequence-entry-that-looks-like-two-with-wrong-indentation.yml
new file mode 100644
index 000000000..abf6cecb9
--- /dev/null
+++ b/tests/yaml_spec/sequence-entry-that-looks-like-two-with-wrong-indentation.yml
@@ -0,0 +1,2 @@
+- single multiline
+ - sequence entry
diff --git a/tests/yaml_spec/sequence-indent.yml b/tests/yaml_spec/sequence-indent.yml
new file mode 100644
index 000000000..5896eef37
--- /dev/null
+++ b/tests/yaml_spec/sequence-indent.yml
@@ -0,0 +1,4 @@
+foo:
+- 42
+bar:
+ - 44
diff --git a/tests/yaml_spec/sequence-with-same-indentation-as-parent-mapping.yml b/tests/yaml_spec/sequence-with-same-indentation-as-parent-mapping.yml
new file mode 100644
index 000000000..d4983f92a
--- /dev/null
+++ b/tests/yaml_spec/sequence-with-same-indentation-as-parent-mapping.yml
@@ -0,0 +1,4 @@
+1:
+- 2
+- 3
+4: 5
diff --git a/tests/yaml_spec/simple-mapping-indent.yml b/tests/yaml_spec/simple-mapping-indent.yml
new file mode 100644
index 000000000..4ee8d9dbf
--- /dev/null
+++ b/tests/yaml_spec/simple-mapping-indent.yml
@@ -0,0 +1,2 @@
+foo:
+ bar: baz
diff --git a/tests/yaml_spec/single-entry-block-sequence.yml b/tests/yaml_spec/single-entry-block-sequence.yml
new file mode 100644
index 000000000..a4b65cdd2
--- /dev/null
+++ b/tests/yaml_spec/single-entry-block-sequence.yml
@@ -0,0 +1 @@
+- foo
diff --git a/tests/yaml_spec/single-pair-block-mapping.yml b/tests/yaml_spec/single-pair-block-mapping.yml
new file mode 100644
index 000000000..20e9ff3fe
--- /dev/null
+++ b/tests/yaml_spec/single-pair-block-mapping.yml
@@ -0,0 +1 @@
+foo: bar
diff --git a/tests/yaml_spec/spec-example-2-1-sequence-of-scalars.yml b/tests/yaml_spec/spec-example-2-1-sequence-of-scalars.yml
new file mode 100644
index 000000000..d12e67111
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-1-sequence-of-scalars.yml
@@ -0,0 +1,3 @@
+- Mark McGwire
+- Sammy Sosa
+- Ken Griffey
diff --git a/tests/yaml_spec/spec-example-2-10-node-for-sammy-sosa-appears-twice-in-this-document.yml b/tests/yaml_spec/spec-example-2-10-node-for-sammy-sosa-appears-twice-in-this-document.yml
new file mode 100644
index 000000000..61808f678
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-10-node-for-sammy-sosa-appears-twice-in-this-document.yml
@@ -0,0 +1,8 @@
+---
+hr:
+ - Mark McGwire
+ # Following node labeled SS
+ - &SS Sammy Sosa
+rbi:
+ - *SS # Subsequent occurrence
+ - Ken Griffey
diff --git a/tests/yaml_spec/spec-example-2-11-mapping-between-sequences.yml b/tests/yaml_spec/spec-example-2-11-mapping-between-sequences.yml
new file mode 100644
index 000000000..9123ce213
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-11-mapping-between-sequences.yml
@@ -0,0 +1,9 @@
+? - Detroit Tigers
+ - Chicago cubs
+:
+ - 2001-07-23
+
+? [ New York Yankees,
+ Atlanta Braves ]
+: [ 2001-07-02, 2001-08-12,
+ 2001-08-14 ]
diff --git a/tests/yaml_spec/spec-example-2-12-compact-nested-mapping.yml b/tests/yaml_spec/spec-example-2-12-compact-nested-mapping.yml
new file mode 100644
index 000000000..63a8ed7e6
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-12-compact-nested-mapping.yml
@@ -0,0 +1,8 @@
+---
+# Products purchased
+- item : Super Hoop
+ quantity: 1
+- item : Basketball
+ quantity: 4
+- item : Big Shoes
+ quantity: 1
diff --git a/tests/yaml_spec/spec-example-2-13-in-literals-newlines-are-preserved.yml b/tests/yaml_spec/spec-example-2-13-in-literals-newlines-are-preserved.yml
new file mode 100644
index 000000000..13fb65601
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-13-in-literals-newlines-are-preserved.yml
@@ -0,0 +1,4 @@
+# ASCII Art
+--- |
+ \//||\/||
+ // || ||__
diff --git a/tests/yaml_spec/spec-example-2-14-in-the-folded-scalars-newlines-become-spaces.yml b/tests/yaml_spec/spec-example-2-14-in-the-folded-scalars-newlines-become-spaces.yml
new file mode 100644
index 000000000..fb4ed4a3f
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-14-in-the-folded-scalars-newlines-become-spaces.yml
@@ -0,0 +1,4 @@
+--- >
+ Mark McGwire's
+ year was crippled
+ by a knee injury.
diff --git a/tests/yaml_spec/spec-example-2-15-folded-newlines-are-preserved-for-more-indented-and-blank-lines.yml b/tests/yaml_spec/spec-example-2-15-folded-newlines-are-preserved-for-more-indented-and-blank-lines.yml
new file mode 100644
index 000000000..80b89a6d9
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-15-folded-newlines-are-preserved-for-more-indented-and-blank-lines.yml
@@ -0,0 +1,8 @@
+>
+ Sammy Sosa completed another
+ fine season with great stats.
+
+ 63 Home Runs
+ 0.288 Batting Average
+
+ What a year!
diff --git a/tests/yaml_spec/spec-example-2-16-indentation-determines-scope.yml b/tests/yaml_spec/spec-example-2-16-indentation-determines-scope.yml
new file mode 100644
index 000000000..9f66d881c
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-16-indentation-determines-scope.yml
@@ -0,0 +1,7 @@
+name: Mark McGwire
+accomplishment: >
+ Mark set a major league
+ home run record in 1998.
+stats: |
+ 65 Home Runs
+ 0.278 Batting Average
diff --git a/tests/yaml_spec/spec-example-2-17-quoted-scalars.yml b/tests/yaml_spec/spec-example-2-17-quoted-scalars.yml
new file mode 100644
index 000000000..c5c2a1815
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-17-quoted-scalars.yml
@@ -0,0 +1,7 @@
+unicode: "Sosa did fine.\u263A"
+control: "\b1998\t1999\t2000\n"
+hex esc: "\x0d\x0a is \r\n"
+
+single: '"Howdy!" he cried.'
+quoted: ' # Not a ''comment''.'
+tie-fighter: '|\-*-/|'
diff --git a/tests/yaml_spec/spec-example-2-18-multi-line-flow-scalars.yml b/tests/yaml_spec/spec-example-2-18-multi-line-flow-scalars.yml
new file mode 100644
index 000000000..e0a8bfa99
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-18-multi-line-flow-scalars.yml
@@ -0,0 +1,6 @@
+plain:
+ This unquoted scalar
+ spans many lines.
+
+quoted: "So does this
+ quoted scalar.\n"
diff --git a/tests/yaml_spec/spec-example-2-2-mapping-scalars-to-scalars.yml b/tests/yaml_spec/spec-example-2-2-mapping-scalars-to-scalars.yml
new file mode 100644
index 000000000..7b7ec948d
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-2-mapping-scalars-to-scalars.yml
@@ -0,0 +1,3 @@
+hr: 65 # Home runs
+avg: 0.278 # Batting average
+rbi: 147 # Runs Batted In
diff --git a/tests/yaml_spec/spec-example-2-23-various-explicit-tags.yml b/tests/yaml_spec/spec-example-2-23-various-explicit-tags.yml
new file mode 100644
index 000000000..5dbd992d6
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-23-various-explicit-tags.yml
@@ -0,0 +1,13 @@
+---
+not-date: !!str 2002-04-28
+
+picture: !!binary |
+ R0lGODlhDAAMAIQAAP//9/X
+ 17unp5WZmZgAAAOfn515eXv
+ Pz7Y6OjuDg4J+fn5OTk6enp
+ 56enmleECcgggoBADs=
+
+application specific tag: !something |
+ The semantics of the tag
+ above may be different for
+ different documents.
diff --git a/tests/yaml_spec/spec-example-2-24-global-tags.yml b/tests/yaml_spec/spec-example-2-24-global-tags.yml
new file mode 100644
index 000000000..1180757d8
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-24-global-tags.yml
@@ -0,0 +1,14 @@
+%TAG ! tag:clarkevans.com,2002:
+--- !shape
+ # Use the ! handle for presenting
+ # tag:clarkevans.com,2002:circle
+- !circle
+ center: &ORIGIN {x: 73, y: 129}
+ radius: 7
+- !line
+ start: *ORIGIN
+ finish: { x: 89, y: 102 }
+- !label
+ start: *ORIGIN
+ color: 0xFFEEBB
+ text: Pretty vector drawing.
diff --git a/tests/yaml_spec/spec-example-2-25-unordered-sets.yml b/tests/yaml_spec/spec-example-2-25-unordered-sets.yml
new file mode 100644
index 000000000..cf4943a20
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-25-unordered-sets.yml
@@ -0,0 +1,7 @@
+# Sets are represented as a
+# Mapping where each key is
+# associated with a null value
+--- !!set
+? Mark McGwire
+? Sammy Sosa
+? Ken Griff
diff --git a/tests/yaml_spec/spec-example-2-26-ordered-mappings.yml b/tests/yaml_spec/spec-example-2-26-ordered-mappings.yml
new file mode 100644
index 000000000..a28a7ac07
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-26-ordered-mappings.yml
@@ -0,0 +1,7 @@
+# Ordered maps are represented as
+# A sequence of mappings, with
+# each mapping having one key
+--- !!omap
+- Mark McGwire: 65
+- Sammy Sosa: 63
+- Ken Griffy: 58
diff --git a/tests/yaml_spec/spec-example-2-27-invoice.yml b/tests/yaml_spec/spec-example-2-27-invoice.yml
new file mode 100644
index 000000000..4625739d7
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-27-invoice.yml
@@ -0,0 +1,29 @@
+--- !
+invoice: 34843
+date : 2001-01-23
+bill-to: &id001
+ given : Chris
+ family : Dumars
+ address:
+ lines: |
+ 458 Walkman Dr.
+ Suite #292
+ city : Royal Oak
+ state : MI
+ postal : 48046
+ship-to: *id001
+product:
+ - sku : BL394D
+ quantity : 4
+ description : Basketball
+ price : 450.00
+ - sku : BL4438H
+ quantity : 1
+ description : Super Hoop
+ price : 2392.00
+tax : 251.42
+total: 4443.52
+comments:
+ Late afternoon is best.
+ Backup contact is Nancy
+ Billsmer @ 338-4338.
diff --git a/tests/yaml_spec/spec-example-2-28-log-file.yml b/tests/yaml_spec/spec-example-2-28-log-file.yml
new file mode 100644
index 000000000..a5c8dc85d
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-28-log-file.yml
@@ -0,0 +1,26 @@
+---
+Time: 2001-11-23 15:01:42 -5
+User: ed
+Warning:
+ This is an error message
+ for the log file
+---
+Time: 2001-11-23 15:02:31 -5
+User: ed
+Warning:
+ A slightly different error
+ message.
+---
+Date: 2001-11-23 15:03:17 -5
+User: ed
+Fatal:
+ Unknown variable "bar"
+Stack:
+ - file: TopClass.py
+ line: 23
+ code: |
+ x = MoreObject("345\n")
+ - file: MoreClass.py
+ line: 58
+ code: |-
+ foo = bar
diff --git a/tests/yaml_spec/spec-example-2-3-mapping-scalars-to-sequences.yml b/tests/yaml_spec/spec-example-2-3-mapping-scalars-to-sequences.yml
new file mode 100644
index 000000000..656d628ec
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-3-mapping-scalars-to-sequences.yml
@@ -0,0 +1,8 @@
+american:
+ - Boston Red Sox
+ - Detroit Tigers
+ - New York Yankees
+national:
+ - New York Mets
+ - Chicago Cubs
+ - Atlanta Braves
diff --git a/tests/yaml_spec/spec-example-2-4-sequence-of-mappings.yml b/tests/yaml_spec/spec-example-2-4-sequence-of-mappings.yml
new file mode 100644
index 000000000..430f6b3db
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-4-sequence-of-mappings.yml
@@ -0,0 +1,8 @@
+-
+ name: Mark McGwire
+ hr: 65
+ avg: 0.278
+-
+ name: Sammy Sosa
+ hr: 63
+ avg: 0.288
diff --git a/tests/yaml_spec/spec-example-2-5-sequence-of-sequences.yml b/tests/yaml_spec/spec-example-2-5-sequence-of-sequences.yml
new file mode 100644
index 000000000..cdd777062
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-5-sequence-of-sequences.yml
@@ -0,0 +1,3 @@
+- [name , hr, avg ]
+- [Mark McGwire, 65, 0.278]
+- [Sammy Sosa , 63, 0.288]
diff --git a/tests/yaml_spec/spec-example-2-6-mapping-of-mappings.yml b/tests/yaml_spec/spec-example-2-6-mapping-of-mappings.yml
new file mode 100644
index 000000000..7a957b23a
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-6-mapping-of-mappings.yml
@@ -0,0 +1,5 @@
+Mark McGwire: {hr: 65, avg: 0.278}
+Sammy Sosa: {
+ hr: 63,
+ avg: 0.288
+ }
diff --git a/tests/yaml_spec/spec-example-2-7-two-documents-in-a-stream.yml b/tests/yaml_spec/spec-example-2-7-two-documents-in-a-stream.yml
new file mode 100644
index 000000000..bc711d547
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-7-two-documents-in-a-stream.yml
@@ -0,0 +1,10 @@
+# Ranking of 1998 home runs
+---
+- Mark McGwire
+- Sammy Sosa
+- Ken Griffey
+
+# Team ranking
+---
+- Chicago Cubs
+- St Louis Cardinals
diff --git a/tests/yaml_spec/spec-example-2-8-play-by-play-feed-from-a-game.yml b/tests/yaml_spec/spec-example-2-8-play-by-play-feed-from-a-game.yml
new file mode 100644
index 000000000..05e102d8e
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-8-play-by-play-feed-from-a-game.yml
@@ -0,0 +1,10 @@
+---
+time: 20:03:20
+player: Sammy Sosa
+action: strike (miss)
+...
+---
+time: 20:03:47
+player: Sammy Sosa
+action: grand slam
+...
diff --git a/tests/yaml_spec/spec-example-2-9-single-document-with-two-comments.yml b/tests/yaml_spec/spec-example-2-9-single-document-with-two-comments.yml
new file mode 100644
index 000000000..e26418053
--- /dev/null
+++ b/tests/yaml_spec/spec-example-2-9-single-document-with-two-comments.yml
@@ -0,0 +1,8 @@
+---
+hr: # 1998 hr ranking
+ - Mark McGwire
+ - Sammy Sosa
+rbi:
+ # 1998 rbi ranking
+ - Sammy Sosa
+ - Ken Griffey
diff --git a/tests/yaml_spec/spec-example-5-12-tabs-and-spaces.yml b/tests/yaml_spec/spec-example-5-12-tabs-and-spaces.yml
new file mode 100644
index 000000000..af9a32170
--- /dev/null
+++ b/tests/yaml_spec/spec-example-5-12-tabs-and-spaces.yml
@@ -0,0 +1,6 @@
+# Tabs and spaces
+quoted: "Quoted "
+block: |
+ void main() {
+ printf("Hello, world!\n");
+ }
diff --git a/tests/yaml_spec/spec-example-5-3-block-structure-indicators.yml b/tests/yaml_spec/spec-example-5-3-block-structure-indicators.yml
new file mode 100644
index 000000000..608ea1992
--- /dev/null
+++ b/tests/yaml_spec/spec-example-5-3-block-structure-indicators.yml
@@ -0,0 +1,7 @@
+sequence:
+- one
+- two
+mapping:
+ ? sky
+ : blue
+ sea : green
diff --git a/tests/yaml_spec/spec-example-5-4-flow-collection-indicators.yml b/tests/yaml_spec/spec-example-5-4-flow-collection-indicators.yml
new file mode 100644
index 000000000..df3384775
--- /dev/null
+++ b/tests/yaml_spec/spec-example-5-4-flow-collection-indicators.yml
@@ -0,0 +1,2 @@
+sequence: [ one, two, ]
+mapping: { sky: blue, sea: green }
diff --git a/tests/yaml_spec/spec-example-5-5-comment-indicator.yml b/tests/yaml_spec/spec-example-5-5-comment-indicator.yml
new file mode 100644
index 000000000..62524c0d7
--- /dev/null
+++ b/tests/yaml_spec/spec-example-5-5-comment-indicator.yml
@@ -0,0 +1 @@
+# Comment only.
diff --git a/tests/yaml_spec/spec-example-5-6-node-property-indicators.yml b/tests/yaml_spec/spec-example-5-6-node-property-indicators.yml
new file mode 100644
index 000000000..7a1f9b309
--- /dev/null
+++ b/tests/yaml_spec/spec-example-5-6-node-property-indicators.yml
@@ -0,0 +1,2 @@
+anchored: !local &anchor value
+alias: *anchor
diff --git a/tests/yaml_spec/spec-example-5-7-block-scalar-indicators.yml b/tests/yaml_spec/spec-example-5-7-block-scalar-indicators.yml
new file mode 100644
index 000000000..934726cbf
--- /dev/null
+++ b/tests/yaml_spec/spec-example-5-7-block-scalar-indicators.yml
@@ -0,0 +1,6 @@
+literal: |
+ some
+ text
+folded: >
+ some
+ text
diff --git a/tests/yaml_spec/spec-example-5-8-quoted-scalar-indicators.yml b/tests/yaml_spec/spec-example-5-8-quoted-scalar-indicators.yml
new file mode 100644
index 000000000..04ebf691b
--- /dev/null
+++ b/tests/yaml_spec/spec-example-5-8-quoted-scalar-indicators.yml
@@ -0,0 +1,2 @@
+single: 'text'
+double: "text"
diff --git a/tests/yaml_spec/spec-example-5-9-directive-indicator.yml b/tests/yaml_spec/spec-example-5-9-directive-indicator.yml
new file mode 100644
index 000000000..62204de2f
--- /dev/null
+++ b/tests/yaml_spec/spec-example-5-9-directive-indicator.yml
@@ -0,0 +1,2 @@
+%YAML 1.2
+--- text
diff --git a/tests/yaml_spec/spec-example-6-1-indentation-spaces.yml b/tests/yaml_spec/spec-example-6-1-indentation-spaces.yml
new file mode 100644
index 000000000..b5496c114
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-1-indentation-spaces.yml
@@ -0,0 +1,12 @@
+ # Leading comment line spaces are
+ # neither content nor indentation.
+
+Not indented:
+ By one space: |
+ By four
+ spaces
+ Flow style: [ # Leading spaces
+ By two, # in flow style
+ Also by two, # are neither
+ Still by two # content nor
+ ] # indentation.
diff --git a/tests/yaml_spec/spec-example-6-10-comment-lines.yml b/tests/yaml_spec/spec-example-6-10-comment-lines.yml
new file mode 100644
index 000000000..e5f1a84f0
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-10-comment-lines.yml
@@ -0,0 +1,4 @@
+ # Comment
+
+
+
diff --git a/tests/yaml_spec/spec-example-6-11-multi-line-comments.yml b/tests/yaml_spec/spec-example-6-11-multi-line-comments.yml
new file mode 100644
index 000000000..6776e8afc
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-11-multi-line-comments.yml
@@ -0,0 +1,5 @@
+key: # Comment
+ # lines
+ value
+
+
diff --git a/tests/yaml_spec/spec-example-6-12-separation-spaces.yml b/tests/yaml_spec/spec-example-6-12-separation-spaces.yml
new file mode 100644
index 000000000..e1e111340
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-12-separation-spaces.yml
@@ -0,0 +1,6 @@
+{ first: Sammy, last: Sosa }:
+# Statistics:
+ hr: # Home runs
+ 65
+ avg: # Average
+ 0.278
diff --git a/tests/yaml_spec/spec-example-6-13-reserved-directives.yml b/tests/yaml_spec/spec-example-6-13-reserved-directives.yml
new file mode 100644
index 000000000..cedbf2336
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-13-reserved-directives.yml
@@ -0,0 +1,3 @@
+%FOO bar baz # Should be ignored
+ # with a warning.
+--- "foo"
diff --git a/tests/yaml_spec/spec-example-6-14-yaml-directive.yml b/tests/yaml_spec/spec-example-6-14-yaml-directive.yml
new file mode 100644
index 000000000..fb5521568
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-14-yaml-directive.yml
@@ -0,0 +1,4 @@
+%YAML 1.3 # Attempt parsing
+ # with a warning
+---
+"foo"
diff --git a/tests/yaml_spec/spec-example-6-16-tag-directive.yml b/tests/yaml_spec/spec-example-6-16-tag-directive.yml
new file mode 100644
index 000000000..50f5ab935
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-16-tag-directive.yml
@@ -0,0 +1,3 @@
+%TAG !yaml! tag:yaml.org,2002:
+---
+!yaml!str "foo"
diff --git a/tests/yaml_spec/spec-example-6-18-primary-tag-handle.yml b/tests/yaml_spec/spec-example-6-18-primary-tag-handle.yml
new file mode 100644
index 000000000..d79f04e4f
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-18-primary-tag-handle.yml
@@ -0,0 +1,7 @@
+# Private
+!foo "bar"
+...
+# Global
+%TAG ! tag:example.com,2000:app/
+---
+!foo "bar"
diff --git a/tests/yaml_spec/spec-example-6-19-secondary-tag-handle.yml b/tests/yaml_spec/spec-example-6-19-secondary-tag-handle.yml
new file mode 100644
index 000000000..7b9d9b10a
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-19-secondary-tag-handle.yml
@@ -0,0 +1,3 @@
+%TAG !! tag:example.com,2000:app/
+---
+!!int 1 - 3 # Interval, not integer
diff --git a/tests/yaml_spec/spec-example-6-2-indentation-indicators.yml b/tests/yaml_spec/spec-example-6-2-indentation-indicators.yml
new file mode 100644
index 000000000..ac0d970de
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-2-indentation-indicators.yml
@@ -0,0 +1,4 @@
+? a
+: - b
+ - - c
+ - d
diff --git a/tests/yaml_spec/spec-example-6-20-tag-handles.yml b/tests/yaml_spec/spec-example-6-20-tag-handles.yml
new file mode 100644
index 000000000..690f138e0
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-20-tag-handles.yml
@@ -0,0 +1,3 @@
+%TAG !e! tag:example.com,2000:app/
+---
+!e!foo "bar"
diff --git a/tests/yaml_spec/spec-example-6-21-local-tag-prefix.yml b/tests/yaml_spec/spec-example-6-21-local-tag-prefix.yml
new file mode 100644
index 000000000..57315a5bb
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-21-local-tag-prefix.yml
@@ -0,0 +1,7 @@
+%TAG !m! !my-
+--- # Bulb here
+!m!light fluorescent
+...
+%TAG !m! !my-
+--- # Color here
+!m!light green
diff --git a/tests/yaml_spec/spec-example-6-22-global-tag-prefix.yml b/tests/yaml_spec/spec-example-6-22-global-tag-prefix.yml
new file mode 100644
index 000000000..eedfe04db
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-22-global-tag-prefix.yml
@@ -0,0 +1,3 @@
+%TAG !e! tag:example.com,2000:app/
+---
+- !e!foo "bar"
diff --git a/tests/yaml_spec/spec-example-6-23-node-properties.yml b/tests/yaml_spec/spec-example-6-23-node-properties.yml
new file mode 100644
index 000000000..66d75f365
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-23-node-properties.yml
@@ -0,0 +1,3 @@
+!!str &a1 "foo":
+ !!str bar
+&a2 baz : *a1
diff --git a/tests/yaml_spec/spec-example-6-24-verbatim-tags.yml b/tests/yaml_spec/spec-example-6-24-verbatim-tags.yml
new file mode 100644
index 000000000..8e51f52a0
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-24-verbatim-tags.yml
@@ -0,0 +1,2 @@
+! foo :
+ ! baz
diff --git a/tests/yaml_spec/spec-example-6-26-tag-shorthands.yml b/tests/yaml_spec/spec-example-6-26-tag-shorthands.yml
new file mode 100644
index 000000000..70365f4ed
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-26-tag-shorthands.yml
@@ -0,0 +1,5 @@
+%TAG !e! tag:example.com,2000:app/
+---
+- !local foo
+- !!str bar
+- !e!tag%21 baz
diff --git a/tests/yaml_spec/spec-example-6-28-non-specific-tags.yml b/tests/yaml_spec/spec-example-6-28-non-specific-tags.yml
new file mode 100644
index 000000000..98aa565ea
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-28-non-specific-tags.yml
@@ -0,0 +1,4 @@
+# Assuming conventional resolution:
+- "12"
+- 12
+- ! 12
diff --git a/tests/yaml_spec/spec-example-6-29-node-anchors.yml b/tests/yaml_spec/spec-example-6-29-node-anchors.yml
new file mode 100644
index 000000000..600d1792f
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-29-node-anchors.yml
@@ -0,0 +1,2 @@
+First occurrence: &anchor Value
+Second occurrence: *anchor
diff --git a/tests/yaml_spec/spec-example-6-3-separation-spaces.yml b/tests/yaml_spec/spec-example-6-3-separation-spaces.yml
new file mode 100644
index 000000000..5f48cf497
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-3-separation-spaces.yml
@@ -0,0 +1,3 @@
+- foo: bar
+- - baz
+ - baz
diff --git a/tests/yaml_spec/spec-example-6-4-line-prefixes.yml b/tests/yaml_spec/spec-example-6-4-line-prefixes.yml
new file mode 100644
index 000000000..2f62d0823
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-4-line-prefixes.yml
@@ -0,0 +1,7 @@
+plain: text
+ lines
+quoted: "text
+ lines"
+block: |
+ text
+ lines
diff --git a/tests/yaml_spec/spec-example-6-5-empty-lines.yml b/tests/yaml_spec/spec-example-6-5-empty-lines.yml
new file mode 100644
index 000000000..60958d5f5
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-5-empty-lines.yml
@@ -0,0 +1,8 @@
+Folding:
+ "Empty line
+
+ as a line feed"
+Chomping: |
+ Clipped empty lines
+
+
diff --git a/tests/yaml_spec/spec-example-6-6-line-folding.yml b/tests/yaml_spec/spec-example-6-6-line-folding.yml
new file mode 100644
index 000000000..1c5090d0d
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-6-line-folding.yml
@@ -0,0 +1,7 @@
+>-
+ trimmed
+
+
+
+ as
+ space
diff --git a/tests/yaml_spec/spec-example-6-7-block-folding.yml b/tests/yaml_spec/spec-example-6-7-block-folding.yml
new file mode 100644
index 000000000..0896cc6f4
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-7-block-folding.yml
@@ -0,0 +1,6 @@
+>
+ foo
+
+ bar
+
+ baz
diff --git a/tests/yaml_spec/spec-example-6-8-flow-folding.yml b/tests/yaml_spec/spec-example-6-8-flow-folding.yml
new file mode 100644
index 000000000..d6af812c9
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-8-flow-folding.yml
@@ -0,0 +1,7 @@
+"
+ foo
+
+ bar
+
+ baz
+"
diff --git a/tests/yaml_spec/spec-example-6-9-separated-comment.yml b/tests/yaml_spec/spec-example-6-9-separated-comment.yml
new file mode 100644
index 000000000..9db091295
--- /dev/null
+++ b/tests/yaml_spec/spec-example-6-9-separated-comment.yml
@@ -0,0 +1,2 @@
+key: # Comment
+ value
diff --git a/tests/yaml_spec/spec-example-7-1-alias-nodes.yml b/tests/yaml_spec/spec-example-7-1-alias-nodes.yml
new file mode 100644
index 000000000..388767607
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-1-alias-nodes.yml
@@ -0,0 +1,4 @@
+First occurrence: &anchor Foo
+Second occurrence: *anchor
+Override anchor: &anchor Bar
+Reuse anchor: *anchor
diff --git a/tests/yaml_spec/spec-example-7-10-plain-characters.yml b/tests/yaml_spec/spec-example-7-10-plain-characters.yml
new file mode 100644
index 000000000..7ed369fbf
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-10-plain-characters.yml
@@ -0,0 +1,12 @@
+# Outside flow collection:
+- ::vector
+- ": - ()"
+- Up, up, and away!
+- -123
+- http://example.com/foo#bar
+# Inside flow collection:
+- [ ::vector,
+ ": - ()",
+ "Up, up and away!",
+ -123,
+ http://example.com/foo#bar ]
diff --git a/tests/yaml_spec/spec-example-7-11-plain-implicit-keys.yml b/tests/yaml_spec/spec-example-7-11-plain-implicit-keys.yml
new file mode 100644
index 000000000..fd57f6588
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-11-plain-implicit-keys.yml
@@ -0,0 +1,3 @@
+implicit block key : [
+ implicit flow key : value,
+ ]
diff --git a/tests/yaml_spec/spec-example-7-12-plain-lines.yml b/tests/yaml_spec/spec-example-7-12-plain-lines.yml
new file mode 100644
index 000000000..0499250b9
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-12-plain-lines.yml
@@ -0,0 +1,4 @@
+1st non-empty
+
+ 2nd non-empty
+ 3rd non-empty
diff --git a/tests/yaml_spec/spec-example-7-13-flow-sequence.yml b/tests/yaml_spec/spec-example-7-13-flow-sequence.yml
new file mode 100644
index 000000000..cd774803c
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-13-flow-sequence.yml
@@ -0,0 +1,2 @@
+- [ one, two, ]
+- [three ,four]
diff --git a/tests/yaml_spec/spec-example-7-14-flow-sequence-entries.yml b/tests/yaml_spec/spec-example-7-14-flow-sequence-entries.yml
new file mode 100644
index 000000000..632711672
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-14-flow-sequence-entries.yml
@@ -0,0 +1,8 @@
+[
+"double
+ quoted", 'single
+ quoted',
+plain
+ text, [ nested ],
+single: pair,
+]
diff --git a/tests/yaml_spec/spec-example-7-15-flow-mappings.yml b/tests/yaml_spec/spec-example-7-15-flow-mappings.yml
new file mode 100644
index 000000000..07186437a
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-15-flow-mappings.yml
@@ -0,0 +1,2 @@
+- { one : two , three: four , }
+- {five: six,seven : eight}
diff --git a/tests/yaml_spec/spec-example-7-16-flow-mapping-entries.yml b/tests/yaml_spec/spec-example-7-16-flow-mapping-entries.yml
new file mode 100644
index 000000000..cb84a9953
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-16-flow-mapping-entries.yml
@@ -0,0 +1,5 @@
+{
+? explicit: entry,
+implicit: entry,
+?
+}
diff --git a/tests/yaml_spec/spec-example-7-17-flow-mapping-separate-values.yml b/tests/yaml_spec/spec-example-7-17-flow-mapping-separate-values.yml
new file mode 100644
index 000000000..3cc12967d
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-17-flow-mapping-separate-values.yml
@@ -0,0 +1,6 @@
+{
+unquoted : "separate",
+http://foo.com,
+omitted value:,
+: omitted key,
+}
diff --git a/tests/yaml_spec/spec-example-7-18-flow-mapping-adjacent-values.yml b/tests/yaml_spec/spec-example-7-18-flow-mapping-adjacent-values.yml
new file mode 100644
index 000000000..7fc069c46
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-18-flow-mapping-adjacent-values.yml
@@ -0,0 +1,5 @@
+{
+"adjacent":value,
+"readable": value,
+"empty":
+}
diff --git a/tests/yaml_spec/spec-example-7-19-single-pair-flow-mappings.yml b/tests/yaml_spec/spec-example-7-19-single-pair-flow-mappings.yml
new file mode 100644
index 000000000..77f3eb3e9
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-19-single-pair-flow-mappings.yml
@@ -0,0 +1,3 @@
+[
+foo: bar
+]
diff --git a/tests/yaml_spec/spec-example-7-2-empty-content.yml b/tests/yaml_spec/spec-example-7-2-empty-content.yml
new file mode 100644
index 000000000..aa861037e
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-2-empty-content.yml
@@ -0,0 +1,4 @@
+{
+ foo : !!str,
+ !!str : bar,
+}
diff --git a/tests/yaml_spec/spec-example-7-20-single-pair-explicit-entry.yml b/tests/yaml_spec/spec-example-7-20-single-pair-explicit-entry.yml
new file mode 100644
index 000000000..19dc4f580
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-20-single-pair-explicit-entry.yml
@@ -0,0 +1,4 @@
+[
+? foo
+ bar : baz
+]
diff --git a/tests/yaml_spec/spec-example-7-21-single-pair-implicit-entries.yml b/tests/yaml_spec/spec-example-7-21-single-pair-implicit-entries.yml
new file mode 100644
index 000000000..fdff3b56f
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-21-single-pair-implicit-entries.yml
@@ -0,0 +1,3 @@
+- [ YAML : separate ]
+- [ : empty key entry ]
+- [ {JSON: like}:adjacent ]
diff --git a/tests/yaml_spec/spec-example-7-23-flow-content.yml b/tests/yaml_spec/spec-example-7-23-flow-content.yml
new file mode 100644
index 000000000..f709dc846
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-23-flow-content.yml
@@ -0,0 +1,5 @@
+- [ a, b ]
+- { a: b }
+- "a"
+- 'b'
+- c
diff --git a/tests/yaml_spec/spec-example-7-24-flow-nodes.yml b/tests/yaml_spec/spec-example-7-24-flow-nodes.yml
new file mode 100644
index 000000000..db4007f3f
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-24-flow-nodes.yml
@@ -0,0 +1,5 @@
+- !!str "a"
+- 'b'
+- &anchor "c"
+- *anchor
+- !!str
diff --git a/tests/yaml_spec/spec-example-7-3-completely-empty-flow-nodes.yml b/tests/yaml_spec/spec-example-7-3-completely-empty-flow-nodes.yml
new file mode 100644
index 000000000..f46900d1e
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-3-completely-empty-flow-nodes.yml
@@ -0,0 +1,4 @@
+{
+ ? foo :,
+ : bar,
+}
diff --git a/tests/yaml_spec/spec-example-7-4-double-quoted-implicit-keys.yml b/tests/yaml_spec/spec-example-7-4-double-quoted-implicit-keys.yml
new file mode 100644
index 000000000..1b7a55076
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-4-double-quoted-implicit-keys.yml
@@ -0,0 +1,3 @@
+"implicit block key" : [
+ "implicit flow key" : value,
+ ]
diff --git a/tests/yaml_spec/spec-example-7-5-double-quoted-line-breaks.yml b/tests/yaml_spec/spec-example-7-5-double-quoted-line-breaks.yml
new file mode 100644
index 000000000..eda4b4921
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-5-double-quoted-line-breaks.yml
@@ -0,0 +1,5 @@
+"folded
+to a space,
+
+to a line feed, or \
+ \ non-content"
diff --git a/tests/yaml_spec/spec-example-7-6-double-quoted-lines.yml b/tests/yaml_spec/spec-example-7-6-double-quoted-lines.yml
new file mode 100644
index 000000000..3d8b76da9
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-6-double-quoted-lines.yml
@@ -0,0 +1,4 @@
+" 1st non-empty
+
+ 2nd non-empty
+ 3rd non-empty "
diff --git a/tests/yaml_spec/spec-example-7-7-single-quoted-characters.yml b/tests/yaml_spec/spec-example-7-7-single-quoted-characters.yml
new file mode 100644
index 000000000..3efcb9150
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-7-single-quoted-characters.yml
@@ -0,0 +1 @@
+'here''s to "quotes"'
diff --git a/tests/yaml_spec/spec-example-7-8-single-quoted-implicit-keys.yml b/tests/yaml_spec/spec-example-7-8-single-quoted-implicit-keys.yml
new file mode 100644
index 000000000..f1baf58c0
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-8-single-quoted-implicit-keys.yml
@@ -0,0 +1,3 @@
+'implicit block key' : [
+ 'implicit flow key' : value,
+ ]
diff --git a/tests/yaml_spec/spec-example-7-9-single-quoted-lines.yml b/tests/yaml_spec/spec-example-7-9-single-quoted-lines.yml
new file mode 100644
index 000000000..6dd946e2c
--- /dev/null
+++ b/tests/yaml_spec/spec-example-7-9-single-quoted-lines.yml
@@ -0,0 +1,4 @@
+' 1st non-empty
+
+ 2nd non-empty
+ 3rd non-empty '
diff --git a/tests/yaml_spec/spec-example-8-1-block-scalar-header.yml b/tests/yaml_spec/spec-example-8-1-block-scalar-header.yml
new file mode 100644
index 000000000..1dbadca3e
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-1-block-scalar-header.yml
@@ -0,0 +1,9 @@
+- | # Empty header↓
+ literal
+- >1 # Indentation indicator↓
+ folded
+- |+ # Chomping indicator↓
+ keep
+
+- >1- # Both indicators↓
+ strip
diff --git a/tests/yaml_spec/spec-example-8-10-folded-lines-8-13-final-empty-lines.yml b/tests/yaml_spec/spec-example-8-10-folded-lines-8-13-final-empty-lines.yml
new file mode 100644
index 000000000..992dd76c2
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-10-folded-lines-8-13-final-empty-lines.yml
@@ -0,0 +1,16 @@
+>
+
+ folded
+ line
+
+ next
+ line
+ * bullet
+
+ * list
+ * lines
+
+ last
+ line
+
+# Comment
diff --git a/tests/yaml_spec/spec-example-8-14-block-sequence.yml b/tests/yaml_spec/spec-example-8-14-block-sequence.yml
new file mode 100644
index 000000000..d2f2ccfb2
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-14-block-sequence.yml
@@ -0,0 +1,3 @@
+block sequence:
+ - one
+ - two : three
diff --git a/tests/yaml_spec/spec-example-8-15-block-sequence-entry-types.yml b/tests/yaml_spec/spec-example-8-15-block-sequence-entry-types.yml
new file mode 100644
index 000000000..35ac92365
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-15-block-sequence-entry-types.yml
@@ -0,0 +1,6 @@
+- # Empty
+- |
+ block node
+- - one # Compact
+ - two # sequence
+- one: two # Compact mapping
diff --git a/tests/yaml_spec/spec-example-8-16-block-mappings.yml b/tests/yaml_spec/spec-example-8-16-block-mappings.yml
new file mode 100644
index 000000000..2ef9084ac
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-16-block-mappings.yml
@@ -0,0 +1,2 @@
+block mapping:
+ key: value
diff --git a/tests/yaml_spec/spec-example-8-17-explicit-block-mapping-entries.yml b/tests/yaml_spec/spec-example-8-17-explicit-block-mapping-entries.yml
new file mode 100644
index 000000000..cb0cfd06d
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-17-explicit-block-mapping-entries.yml
@@ -0,0 +1,5 @@
+? explicit key # Empty value
+? |
+ block key
+: - one # Explicit compact
+ - two # block value
diff --git a/tests/yaml_spec/spec-example-8-18-implicit-block-mapping-entries.yml b/tests/yaml_spec/spec-example-8-18-implicit-block-mapping-entries.yml
new file mode 100644
index 000000000..c81951228
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-18-implicit-block-mapping-entries.yml
@@ -0,0 +1,4 @@
+plain key: in-line value
+: # Both empty
+"quoted key":
+- entry
diff --git a/tests/yaml_spec/spec-example-8-19-compact-block-mappings.yml b/tests/yaml_spec/spec-example-8-19-compact-block-mappings.yml
new file mode 100644
index 000000000..d675cfd6b
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-19-compact-block-mappings.yml
@@ -0,0 +1,3 @@
+- sun: yellow
+- ? earth: blue
+ : moon: white
diff --git a/tests/yaml_spec/spec-example-8-2-block-indentation-indicator.yml b/tests/yaml_spec/spec-example-8-2-block-indentation-indicator.yml
new file mode 100644
index 000000000..39bee044b
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-2-block-indentation-indicator.yml
@@ -0,0 +1,11 @@
+- |
+ detected
+- >
+
+
+ # detected
+- |1
+ explicit
+- >
+
+ detected
diff --git a/tests/yaml_spec/spec-example-8-20-block-node-types.yml b/tests/yaml_spec/spec-example-8-20-block-node-types.yml
new file mode 100644
index 000000000..a3f13ae6e
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-20-block-node-types.yml
@@ -0,0 +1,6 @@
+-
+ "flow in block"
+- >
+ Block scalar
+- !!map # Block collection
+ foo : bar
diff --git a/tests/yaml_spec/spec-example-8-21-block-scalar-nodes.yml b/tests/yaml_spec/spec-example-8-21-block-scalar-nodes.yml
new file mode 100644
index 000000000..f86be74ad
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-21-block-scalar-nodes.yml
@@ -0,0 +1,6 @@
+literal: |2
+ value
+folded:
+ !foo
+ >1
+ value
diff --git a/tests/yaml_spec/spec-example-8-22-block-collection-nodes.yml b/tests/yaml_spec/spec-example-8-22-block-collection-nodes.yml
new file mode 100644
index 000000000..5c5966992
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-22-block-collection-nodes.yml
@@ -0,0 +1,6 @@
+sequence: !!seq
+- entry
+- !!seq
+ - nested
+mapping: !!map
+ foo: bar
diff --git a/tests/yaml_spec/spec-example-8-4-chomping-final-line-break.yml b/tests/yaml_spec/spec-example-8-4-chomping-final-line-break.yml
new file mode 100644
index 000000000..fa6190fd5
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-4-chomping-final-line-break.yml
@@ -0,0 +1,6 @@
+strip: |-
+ text
+clip: |
+ text
+keep: |+
+ text
diff --git a/tests/yaml_spec/spec-example-8-5-chomping-trailing-lines.yml b/tests/yaml_spec/spec-example-8-5-chomping-trailing-lines.yml
new file mode 100644
index 000000000..32fa08f0a
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-5-chomping-trailing-lines.yml
@@ -0,0 +1,19 @@
+ # Strip
+ # Comments:
+strip: |-
+ # text
+
+ # Clip
+ # comments:
+
+clip: |
+ # text
+
+ # Keep
+ # comments:
+
+keep: |+
+ # text
+
+ # Trail
+ # comments.
diff --git a/tests/yaml_spec/spec-example-8-6-empty-scalar-chomping.yml b/tests/yaml_spec/spec-example-8-6-empty-scalar-chomping.yml
new file mode 100644
index 000000000..de0b64bbe
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-6-empty-scalar-chomping.yml
@@ -0,0 +1,6 @@
+strip: >-
+
+clip: >
+
+keep: |+
+
diff --git a/tests/yaml_spec/spec-example-8-7-literal-scalar.yml b/tests/yaml_spec/spec-example-8-7-literal-scalar.yml
new file mode 100644
index 000000000..31f9966a0
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-7-literal-scalar.yml
@@ -0,0 +1,5 @@
+|
+ literal
+ text
+
+
diff --git a/tests/yaml_spec/spec-example-8-8-literal-content.yml b/tests/yaml_spec/spec-example-8-8-literal-content.yml
new file mode 100644
index 000000000..9d537cb51
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-8-literal-content.yml
@@ -0,0 +1,9 @@
+|
+
+
+ literal
+
+
+ text
+
+ # Comment
diff --git a/tests/yaml_spec/spec-example-8-9-folded-scalar.yml b/tests/yaml_spec/spec-example-8-9-folded-scalar.yml
new file mode 100644
index 000000000..078fbc89b
--- /dev/null
+++ b/tests/yaml_spec/spec-example-8-9-folded-scalar.yml
@@ -0,0 +1,5 @@
+>
+ folded
+ text
+
+
diff --git a/tests/yaml_spec/spec-example-9-2-document-markers.yml b/tests/yaml_spec/spec-example-9-2-document-markers.yml
new file mode 100644
index 000000000..886e57446
--- /dev/null
+++ b/tests/yaml_spec/spec-example-9-2-document-markers.yml
@@ -0,0 +1,4 @@
+%YAML 1.2
+---
+Document
+... # Suffix
diff --git a/tests/yaml_spec/spec-example-9-3-bare-documents.yml b/tests/yaml_spec/spec-example-9-3-bare-documents.yml
new file mode 100644
index 000000000..57423e908
--- /dev/null
+++ b/tests/yaml_spec/spec-example-9-3-bare-documents.yml
@@ -0,0 +1,7 @@
+Bare
+document
+...
+# No document
+...
+|
+%!PS-Adobe-2.0 # Not the first line
diff --git a/tests/yaml_spec/spec-example-9-4-explicit-documents.yml b/tests/yaml_spec/spec-example-9-4-explicit-documents.yml
new file mode 100644
index 000000000..bc363b1c1
--- /dev/null
+++ b/tests/yaml_spec/spec-example-9-4-explicit-documents.yml
@@ -0,0 +1,7 @@
+---
+{ matches
+% : 20 }
+...
+---
+# Empty
+...
diff --git a/tests/yaml_spec/spec-example-9-5-directives-documents.yml b/tests/yaml_spec/spec-example-9-5-directives-documents.yml
new file mode 100644
index 000000000..de2463db9
--- /dev/null
+++ b/tests/yaml_spec/spec-example-9-5-directives-documents.yml
@@ -0,0 +1,8 @@
+%YAML 1.2
+--- |
+%!PS-Adobe-2.0
+...
+%YAML1.2
+---
+# Empty
+...
diff --git a/tests/yaml_spec/spec-example-9-6-stream.yml b/tests/yaml_spec/spec-example-9-6-stream.yml
new file mode 100644
index 000000000..52bd345d6
--- /dev/null
+++ b/tests/yaml_spec/spec-example-9-6-stream.yml
@@ -0,0 +1,7 @@
+Document
+---
+# Empty
+...
+%YAML 1.2
+---
+matches %: 20
diff --git a/tests/yaml_spec/tab-after-document-header.yml b/tests/yaml_spec/tab-after-document-header.yml
new file mode 100644
index 000000000..8171dccea
--- /dev/null
+++ b/tests/yaml_spec/tab-after-document-header.yml
@@ -0,0 +1 @@
+--- scalar
diff --git a/tests/yaml_spec/tab-at-beginning-of-line-followed-by-a-flow-mapping.yml b/tests/yaml_spec/tab-at-beginning-of-line-followed-by-a-flow-mapping.yml
new file mode 100644
index 000000000..db07de097
--- /dev/null
+++ b/tests/yaml_spec/tab-at-beginning-of-line-followed-by-a-flow-mapping.yml
@@ -0,0 +1 @@
+ {}
diff --git a/tests/yaml_spec/tags-for-block-objects.yml b/tests/yaml_spec/tags-for-block-objects.yml
new file mode 100644
index 000000000..7a3e8f1a3
--- /dev/null
+++ b/tests/yaml_spec/tags-for-block-objects.yml
@@ -0,0 +1,4 @@
+foo: !!seq
+ - !!str a
+ - !!map
+ key: !!str value
diff --git a/tests/yaml_spec/tags-for-flow-objects.yml b/tests/yaml_spec/tags-for-flow-objects.yml
new file mode 100644
index 000000000..f69ccded7
--- /dev/null
+++ b/tests/yaml_spec/tags-for-flow-objects.yml
@@ -0,0 +1,4 @@
+!!map {
+ k: !!seq
+ [ a, !!str b]
+}
diff --git a/tests/yaml_spec/tags-for-root-objects.yml b/tests/yaml_spec/tags-for-root-objects.yml
new file mode 100644
index 000000000..f0d91aa4f
--- /dev/null
+++ b/tests/yaml_spec/tags-for-root-objects.yml
@@ -0,0 +1,8 @@
+--- !!map
+? a
+: b
+--- !!seq
+- !!str c
+--- !!str
+d
+e
diff --git a/tests/yaml_spec/tags-in-block-sequence.yml b/tests/yaml_spec/tags-in-block-sequence.yml
new file mode 100644
index 000000000..51529617f
--- /dev/null
+++ b/tests/yaml_spec/tags-in-block-sequence.yml
@@ -0,0 +1,4 @@
+ - !!str a
+ - b
+ - !!int 42
+ - d
diff --git a/tests/yaml_spec/tags-in-explicit-mapping.yml b/tests/yaml_spec/tags-in-explicit-mapping.yml
new file mode 100644
index 000000000..c5e6ceb7e
--- /dev/null
+++ b/tests/yaml_spec/tags-in-explicit-mapping.yml
@@ -0,0 +1,4 @@
+? !!str a
+: !!int 47
+? c
+: !!str d
diff --git a/tests/yaml_spec/tags-in-implicit-mapping.yml b/tests/yaml_spec/tags-in-implicit-mapping.yml
new file mode 100644
index 000000000..e07dceb1d
--- /dev/null
+++ b/tests/yaml_spec/tags-in-implicit-mapping.yml
@@ -0,0 +1,5 @@
+!!str a: b
+c: !!int 42
+e: !!str f
+g: h
+!!int 23: !!bool false
diff --git a/tests/yaml_spec/tags-on-empty-scalars.yml b/tests/yaml_spec/tags-on-empty-scalars.yml
new file mode 100644
index 000000000..2b07b28b3
--- /dev/null
+++ b/tests/yaml_spec/tags-on-empty-scalars.yml
@@ -0,0 +1,5 @@
+- !!str
+-
+ !!null : a
+ b: !!str
+- !!str : !!null
diff --git a/tests/yaml_spec/three-dashes-and-content-without-space.yml b/tests/yaml_spec/three-dashes-and-content-without-space.yml
new file mode 100644
index 000000000..fffaf580e
--- /dev/null
+++ b/tests/yaml_spec/three-dashes-and-content-without-space.yml
@@ -0,0 +1,2 @@
+---word1
+word2
diff --git a/tests/yaml_spec/various-combinations-of-tags-and-anchors.yml b/tests/yaml_spec/various-combinations-of-tags-and-anchors.yml
new file mode 100644
index 000000000..0ade841d2
--- /dev/null
+++ b/tests/yaml_spec/various-combinations-of-tags-and-anchors.yml
@@ -0,0 +1,26 @@
+---
+&a1
+!!str
+scalar1
+---
+!!str
+&a2
+scalar2
+---
+&a3
+!!str scalar3
+---
+&a4 !!map
+&a5 !!str key5: value4
+---
+a6: 1
+&anchor6 b6: 2
+---
+!!map
+&a8 !!str key8: value7
+---
+!!map
+!!str &a10 key10: value9
+---
+!!str &a11
+value11
diff --git a/tests/yaml_spec/various-location-of-anchors-in-flow-sequence.yml b/tests/yaml_spec/various-location-of-anchors-in-flow-sequence.yml
new file mode 100644
index 000000000..8345dfc93
--- /dev/null
+++ b/tests/yaml_spec/various-location-of-anchors-in-flow-sequence.yml
@@ -0,0 +1,6 @@
+&flowseq [
+ a: b,
+ &c c: d,
+ { &e e: f },
+ &g { g: h }
+]
diff --git a/tests/yaml_spec/various-trailing-comments.yml b/tests/yaml_spec/various-trailing-comments.yml
new file mode 100644
index 000000000..4fcc93e70
--- /dev/null
+++ b/tests/yaml_spec/various-trailing-comments.yml
@@ -0,0 +1,16 @@
+a: "double
+ quotes" # lala
+b: plain
+ value # lala
+c : #lala
+ d
+? # lala
+ - seq1
+: # lala
+ - #lala
+ seq2
+e:
+ &node # lala
+ - x: y
+block: > # lala
+ abcde
diff --git a/tests/yaml_spec/various-trailing-tabs.yml b/tests/yaml_spec/various-trailing-tabs.yml
new file mode 100644
index 000000000..42ad1a994
--- /dev/null
+++ b/tests/yaml_spec/various-trailing-tabs.yml
@@ -0,0 +1,4 @@
+a: b
+seq:
+ - a
+c: d #X
diff --git a/tests/yaml_spec/whitespace-after-scalars-in-flow.yml b/tests/yaml_spec/whitespace-after-scalars-in-flow.yml
new file mode 100644
index 000000000..3a6090961
--- /dev/null
+++ b/tests/yaml_spec/whitespace-after-scalars-in-flow.yml
@@ -0,0 +1,6 @@
+- [a, b , c ]
+- { "a" : b
+ , c : 'd' ,
+ e : "f"
+ }
+- [ ]
diff --git a/tests/yaml_spec/whitespace-around-colon-in-mappings.yml b/tests/yaml_spec/whitespace-around-colon-in-mappings.yml
new file mode 100644
index 000000000..5df48e7c6
--- /dev/null
+++ b/tests/yaml_spec/whitespace-around-colon-in-mappings.yml
@@ -0,0 +1,12 @@
+"top1" :
+ "key1" : &alias1 scalar1
+'top2' :
+ 'key2' : &alias2 scalar2
+top3: &node3
+ *alias1 : scalar3
+top4:
+ *alias2 : scalar4
+top5 :
+ scalar5
+top6:
+ &anchor6 'key6' : scalar6
diff --git a/tests/yaml_spec/zero-indented-block-scalar-with-line-that-looks-like-a-comment.yml b/tests/yaml_spec/zero-indented-block-scalar-with-line-that-looks-like-a-comment.yml
new file mode 100644
index 000000000..ffb9aebc0
--- /dev/null
+++ b/tests/yaml_spec/zero-indented-block-scalar-with-line-that-looks-like-a-comment.yml
@@ -0,0 +1,4 @@
+--- >
+line1
+# no comment
+line3
diff --git a/tests/yaml_spec/zero-indented-block-scalar.yml b/tests/yaml_spec/zero-indented-block-scalar.yml
new file mode 100644
index 000000000..b4e414d7f
--- /dev/null
+++ b/tests/yaml_spec/zero-indented-block-scalar.yml
@@ -0,0 +1,4 @@
+--- >
+line1
+line2
+line3
diff --git a/tests_config/require_standalone.js b/tests_config/require_standalone.js
index deef3c51d..5da1a9a0d 100644
--- a/tests_config/require_standalone.js
+++ b/tests_config/require_standalone.js
@@ -12,7 +12,8 @@ const sources = [
"parser-postcss.js",
"parser-graphql.js",
"parser-markdown.js",
- "parser-vue.js"
+ "parser-vue.js",
+ "parser-yaml.js"
].map(filename =>
fs.readFileSync(path.join(process.env.PRETTIER_DIR, filename), "utf-8")
);
diff --git a/tests_integration/__tests__/__snapshots__/early-exit.js.snap b/tests_integration/__tests__/__snapshots__/early-exit.js.snap
index f15528e1d..90a782af5 100644
--- a/tests_integration/__tests__/__snapshots__/early-exit.js.snap
+++ b/tests_integration/__tests__/__snapshots__/early-exit.js.snap
@@ -62,7 +62,7 @@ Format options:
--no-bracket-spacing Do not print spaces between brackets.
--jsx-bracket-same-line Put > on the last line instead of at a new line.
Defaults to false.
- --parser
+ --parser
Which parser to use.
--print-width The line length where Prettier will try wrap.
Defaults to 80.
@@ -165,7 +165,7 @@ exports[`show warning with --help not-found (typo) (stderr) 1`] = `
`;
exports[`show warning with --help not-found (typo) (stdout) 1`] = `
-"--parser
+"--parser
Which parser to use.
@@ -183,6 +183,7 @@ Valid options:
graphql GraphQL
markdown Markdown
vue Vue
+ yaml YAML
"
`;
@@ -211,7 +212,7 @@ Format options:
--no-bracket-spacing Do not print spaces between brackets.
--jsx-bracket-same-line Put > on the last line instead of at a new line.
Defaults to false.
- --parser
+ --parser
Which parser to use.
--print-width The line length where Prettier will try wrap.
Defaults to 80.
diff --git a/tests_integration/__tests__/__snapshots__/help-options.js.snap b/tests_integration/__tests__/__snapshots__/help-options.js.snap
index 7f5978866..4038ee9b3 100644
--- a/tests_integration/__tests__/__snapshots__/help-options.js.snap
+++ b/tests_integration/__tests__/__snapshots__/help-options.js.snap
@@ -267,7 +267,7 @@ exports[`show detailed usage with --help no-semi (write) 1`] = `Array []`;
exports[`show detailed usage with --help parser (stderr) 1`] = `""`;
exports[`show detailed usage with --help parser (stdout) 1`] = `
-"--parser
+"--parser
Which parser to use.
@@ -285,6 +285,7 @@ Valid options:
graphql GraphQL
markdown Markdown
vue Vue
+ yaml YAML
"
`;
diff --git a/tests_integration/__tests__/__snapshots__/plugin-options.js.snap b/tests_integration/__tests__/__snapshots__/plugin-options.js.snap
index 2714d56b1..f3088198a 100644
--- a/tests_integration/__tests__/__snapshots__/plugin-options.js.snap
+++ b/tests_integration/__tests__/__snapshots__/plugin-options.js.snap
@@ -15,7 +15,7 @@ exports[` 1`] = `
+ Defaults to bar.
--jsx-bracket-same-line Put > on the last line instead of at a new line.
Defaults to false.
- --parser
+ --parser
Which parser to use.
--print-width The line length where Prettier will try wrap."
`;
diff --git a/tests_integration/__tests__/__snapshots__/support-info.js.snap b/tests_integration/__tests__/__snapshots__/support-info.js.snap
index c0d166046..51915d876 100644
--- a/tests_integration/__tests__/__snapshots__/support-info.js.snap
+++ b/tests_integration/__tests__/__snapshots__/support-info.js.snap
@@ -5,7 +5,7 @@ exports[`API getSupportInfo() with version 0.0.0 -> 1.0.0 1`] = `
- First value
+ Second value
-@@ -12,19 +12,35 @@
+@@ -15,19 +15,35 @@
\\"options\\": Object {
\\"bracketSpacing\\": Object {
\\"default\\": true,
@@ -41,7 +41,7 @@ exports[`API getSupportInfo() with version 0.0.0 -> 1.0.0 1`] = `
\\"type\\": \\"boolean\\",
},
\\"tabWidth\\": Object {
-@@ -39,17 +55,15 @@
+@@ -42,17 +58,15 @@
\\"trailingComma\\": Object {
\\"choices\\": Array [
\\"none\\",
@@ -74,6 +74,9 @@ Object {
"babylon",
"flow",
],
+ "YAML": Array [
+ "yaml",
+ ],
},
"options": Object {
"bracketSpacing": Object {
@@ -126,7 +129,7 @@ exports[`API getSupportInfo() with version 1.0.0 -> 1.4.0 1`] = `
- First value
+ Second value
-@@ -1,29 +1,56 @@
+@@ -1,32 +1,59 @@
Object {
\\"languages\\": Object {
+ \\"CSS\\": Array [
@@ -149,6 +152,9 @@ exports[`API getSupportInfo() with version 1.0.0 -> 1.4.0 1`] = `
+ \\"TypeScript\\": Array [
+ \\"typescript\\",
+ ],
+ \\"YAML\\": Array [
+ \\"yaml\\",
+ ],
},
\\"options\\": Object {
\\"bracketSpacing\\": Object {
@@ -183,7 +189,7 @@ exports[`API getSupportInfo() with version 1.0.0 -> 1.4.0 1`] = `
\\"type\\": \\"choice\\",
},
\\"printWidth\\": Object {
-@@ -33,10 +60,28 @@
+@@ -36,10 +63,28 @@
\\"start\\": 0,
\\"step\\": 1,
},
@@ -236,7 +242,7 @@ exports[`API getSupportInfo() with version 1.4.0 -> 1.5.0 1`] = `
\\"flow\\",
],
\\"JavaScript\\": Array [
-@@ -47,10 +53,12 @@
+@@ -50,10 +56,12 @@
\\"choices\\": Array [
\\"flow\\",
\\"babylon\\",
@@ -283,8 +289,8 @@ exports[`API getSupportInfo() with version 1.5.0 -> 1.7.1 1`] = `
\\"TypeScript\\": Array [
\\"typescript\\",
],
- },
-@@ -52,11 +52,13 @@
+ \\"YAML\\": Array [
+@@ -55,11 +55,13 @@
\\"parser\\": Object {
\\"choices\\": Array [
\\"flow\\",
@@ -299,7 +305,7 @@ exports[`API getSupportInfo() with version 1.5.0 -> 1.7.1 1`] = `
],
\\"default\\": \\"babylon\\",
\\"type\\": \\"choice\\",
-@@ -86,10 +88,14 @@
+@@ -89,10 +91,14 @@
\\"start\\": 0,
\\"step\\": 1,
},
@@ -335,7 +341,7 @@ exports[`API getSupportInfo() with version 1.7.1 -> 1.8.0 1`] = `
],
\\"TypeScript\\": Array [
\\"typescript\\",
-@@ -43,10 +46,14 @@
+@@ -46,10 +49,14 @@
},
\\"filepath\\": Object {
\\"default\\": undefined,
@@ -350,7 +356,7 @@ exports[`API getSupportInfo() with version 1.7.1 -> 1.8.0 1`] = `
\\"type\\": \\"boolean\\",
},
\\"parser\\": Object {
-@@ -57,10 +64,11 @@
+@@ -60,10 +67,11 @@
\\"css\\",
\\"less\\",
\\"scss\\",
@@ -369,7 +375,7 @@ exports[`API getSupportInfo() with version 1.8.0 -> 1.8.2 1`] = `
- First value
+ Second value
-@@ -78,10 +78,18 @@
+@@ -81,10 +81,18 @@
\\"start\\": 0,
\\"step\\": 1,
},
@@ -412,7 +418,7 @@ exports[`API getSupportInfo() with version 1.8.2 -> undefined 1`] = `
\\"flow\\",
],
\\"JavaScript\\": Array [
-@@ -27,12 +33,23 @@
+@@ -27,15 +33,26 @@
\\"scss\\",
],
\\"TypeScript\\": Array [
@@ -421,6 +427,9 @@ exports[`API getSupportInfo() with version 1.8.2 -> undefined 1`] = `
+ \\"Vue\\": Array [
+ \\"vue\\",
+ ],
+ \\"YAML\\": Array [
+ \\"yaml\\",
+ ],
},
\\"options\\": Object {
+ \\"arrowParens\\": Object {
@@ -436,7 +445,7 @@ exports[`API getSupportInfo() with version 1.8.2 -> undefined 1`] = `
\\"type\\": \\"boolean\\",
},
\\"cursorOffset\\": Object {
-@@ -63,16 +80,27 @@
+@@ -66,16 +83,27 @@
\\"typescript\\",
\\"css\\",
\\"less\\",
@@ -465,7 +474,7 @@ exports[`API getSupportInfo() with version 1.8.2 -> undefined 1`] = `
\\"range\\": Object {
\\"end\\": Infinity,
\\"start\\": 0,
-@@ -80,14 +108,15 @@
+@@ -83,14 +111,15 @@
},
\\"type\\": \\"int\\",
},
@@ -689,6 +698,28 @@ exports[`CLI --support-info (stdout) 1`] = `
\\"since\\": \\"1.10.0\\",
\\"tmScope\\": \\"text.html.vue\\",
\\"vscodeLanguageIds\\": [\\"vue\\"]
+ },
+ {
+ \\"aceMode\\": \\"yaml\\",
+ \\"aliases\\": [\\"yml\\"],
+ \\"codemirrorMimeType\\": \\"text/x-yaml\\",
+ \\"codemirrorMode\\": \\"yaml\\",
+ \\"extensions\\": [
+ \\".yml\\",
+ \\".reek\\",
+ \\".rviz\\",
+ \\".sublime-syntax\\",
+ \\".syntax\\",
+ \\".yaml\\",
+ \\".yaml-tmlanguage\\",
+ \\".yml.mysql\\"
+ ],
+ \\"filenames\\": [\\".clang-format\\", \\".clang-tidy\\", \\".gemrc\\"],
+ \\"linguistLanguageId\\": 407,
+ \\"name\\": \\"YAML\\",
+ \\"parsers\\": [\\"yaml\\"],
+ \\"tmScope\\": \\"source.yaml\\",
+ \\"vscodeLanguageIds\\": [\\"yaml\\"]
}
],
\\"options\\": [
diff --git a/website/data/languages.yml b/website/data/languages.yml
index 0a06f94f7..c06b1ad2b 100644
--- a/website/data/languages.yml
+++ b/website/data/languages.yml
@@ -29,6 +29,11 @@
variants:
- "[CommonMark](http://commonmark.org/)"
- "[GitHub Flavored Markdown](https://github.github.com/gfm/)"
+- name: YAML
+ showName: false
+ image: /images/languages/tools_yaml.svg
+ variants:
+ - "[YAML](http://yaml.org/)"
- name: Work in Progress
showName: true
image: /images/languages/tools_wip.svg
diff --git a/website/playground/codeSamples.js b/website/playground/codeSamples.js
index 37f267073..ffa95c9ed 100644
--- a/website/playground/codeSamples.js
+++ b/website/playground/codeSamples.js
@@ -184,6 +184,49 @@ export default function(parser) {
".and { css: too! important }",
""
].join("\n");
+ case "yaml":
+ // modified from http://yaml.org/start.html
+ return [
+ "---",
+ "invoice : 34843",
+ "date : 2001-01-23",
+ "bill-to: &id001",
+ " given : Chris",
+ " family : Dumars",
+ " address:",
+ " lines: |",
+ " 458 Walkman Dr.",
+ " Suite #292",
+ " city : Royal Oak",
+ " state : MI",
+ " postal : 48046",
+ "ship-to: *id001",
+ "product:",
+ " - ",
+ " ",
+ " sku : BL394D",
+ " ? quantity ",
+ " : 4",
+ " description : Basketball",
+ " ? price ",
+ " : 450.00",
+ " ",
+ " ",
+ " - ",
+ " sku : BL4438H",
+ " quantity : 1",
+ " description: Super Hoop",
+ " price : 2392.00",
+ " ",
+ " ",
+ "tax : 251.42",
+ "total : 4443.52",
+ "comments: >",
+ " Late afternoon is best.",
+ " Backup contact is Nancy",
+ " Billsmer @ 338-4338.",
+ ""
+ ].join("\n");
default:
return "";
}
diff --git a/website/static/images/languages/tools_yaml.svg b/website/static/images/languages/tools_yaml.svg
new file mode 100644
index 000000000..a56e91182
--- /dev/null
+++ b/website/static/images/languages/tools_yaml.svg
@@ -0,0 +1,20 @@
+
+
\ No newline at end of file
diff --git a/website/static/service-worker.js b/website/static/service-worker.js
index bfebf132a..88c9f1590 100644
--- a/website/static/service-worker.js
+++ b/website/static/service-worker.js
@@ -16,6 +16,7 @@ toolbox.precache([
"lib/parser-glimmer.js",
"lib/parser-graphql.js",
"lib/parser-markdown.js",
+ "lib/parser-yaml.js",
"playground.js",
"https://unpkg.com/sw-toolbox@3.6.0/sw-toolbox.js",
diff --git a/website/static/worker.js b/website/static/worker.js
index 7e97b331b..ed0d4e2f7 100644
--- a/website/static/worker.js
+++ b/website/static/worker.js
@@ -70,6 +70,12 @@ var parsers = {
get vue() {
importScriptOnce("lib/parser-vue.js");
return prettierPlugins.vue.parsers.vue;
+ },
+
+ // YAML
+ get yaml() {
+ importScriptOnce("lib/parser-yaml.js");
+ return prettierPlugins.yaml.parsers.yaml;
}
};
diff --git a/yarn.lock b/yarn.lock
index 3cd2c4a0a..fc0b2cc3c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5026,6 +5026,12 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
hash-base "^2.0.0"
inherits "^2.0.1"
+rollup-plugin-alias@1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/rollup-plugin-alias/-/rollup-plugin-alias-1.4.0.tgz#120cba7c46621c03138f0ca6fd5dd2ade9872db9"
+ dependencies:
+ slash "^1.0.0"
+
rollup-plugin-babel@4.0.0-beta.4:
version "4.0.0-beta.4"
resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-4.0.0-beta.4.tgz#d869646885d6ad73dd10791a261fb92674a80410"
@@ -5688,6 +5694,10 @@ tslib@^1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.8.0.tgz#dc604ebad64bcbf696d613da6c954aa0e7ea1eb6"
+tslib@^1.9.1:
+ version "1.9.1"
+ resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.1.tgz#a5d1f0532a49221c87755cfcc89ca37197242ba7"
+
tty-browserify@0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
@@ -6100,6 +6110,17 @@ yallist@^3.0.0, yallist@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9"
+yaml-unist-parser@1.0.0-beta.4:
+ version "1.0.0-beta.4"
+ resolved "https://registry.yarnpkg.com/yaml-unist-parser/-/yaml-unist-parser-1.0.0-beta.4.tgz#6603d017ec1396466825a141de33637bf2e9e0c2"
+ dependencies:
+ lines-and-columns "^1.1.6"
+ tslib "^1.9.1"
+
+yaml@1.0.0-beta.7:
+ version "1.0.0-beta.7"
+ resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.0.0-beta.7.tgz#681937c5b2d85b6eb474d47e877f5e63a7efe20c"
+
yargs-parser@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9"