private static TreeNode CreateNodeForScalar(Scalar scalar) { return new TreeNode(scalar.Text); }
private Scalar ParseBlockScalar(out bool success) { int errorCount = Errors.Count; Scalar scalar = new Scalar(); scalar.Text = ParseLiteralText(out success); if (success) { ClearError(errorCount); return scalar; } scalar.Text = ParseFoldedText(out success); if (success) { ClearError(errorCount); return scalar; } return scalar; }
private Scalar ParseFlowScalarInFlow(out bool success) { int errorCount = Errors.Count; Scalar scalar = new Scalar(); scalar.Text = ParsePlainTextInFlow(out success); if (success) { ClearError(errorCount); return scalar; } scalar.Text = ParseSingleQuotedText(out success); if (success) { ClearError(errorCount); return scalar; } scalar.Text = ParseDoubleQuotedText(out success); if (success) { ClearError(errorCount); return scalar; } return scalar; }
private Scalar ParseBlockKey(out bool success) { int errorCount = Errors.Count; Scalar scalar = new Scalar(); scalar.Text = ParsePlainTextSingleLine(out success); if (success) { ClearError(errorCount); return scalar; } scalar.Text = ParseDoubleQuotedSingleLine(out success); if (success) { ClearError(errorCount); return scalar; } scalar.Text = ParseSingleQuotedSingleLine(out success); if (success) { ClearError(errorCount); return scalar; } return scalar; }
private DataItem ParseFlowNodeInFlow(out bool success) { int errorCount = Errors.Count; DataItem dataItem = null; dataItem = ParseAliasNode(out success); if (success) { ClearError(errorCount); return dataItem; } dataItem = ParseFlowContentInFlow(out success); if (success) { ClearError(errorCount); return dataItem; } while (true) { int seq_start_position1 = position; NodeProperty property = ParseNodeProperty(out success); if (success) { dataItem = new Scalar(); } else { Error("Failed to parse property of FlowNodeInFlow."); break; } while (true) { int seq_start_position2 = position; ParseSeparationLinesInFlow(out success); if (!success) { Error("Failed to parse SeparationLinesInFlow of FlowNodeInFlow."); break; } dataItem = ParseFlowContentInFlow(out success); if (!success) { Error("Failed to parse FlowContentInFlow of FlowNodeInFlow."); position = seq_start_position2; } break; } if (success) { SetDataItemProperty(dataItem, property); } success = true; break; } if (success) { ClearError(errorCount); return dataItem; } return dataItem; }