MCPcopy Create free account
hub / github.com/dev-formata-io/stof / document_statement

Function document_statement

src/parser/doc.rs:114–246  ·  view source on GitHub ↗

Parse a singular document statement.

(input: &'a str, context: &mut ParseContext)

Source from the content-addressed store, hash-verified

112
113/// Parse a singular document statement.
114pub fn document_statement<'a>(input: &'a str, context: &mut ParseContext) -> IResult<&'a str, (), StofParseError> {
115 // Field
116 {
117 let field_res = parse_field(input, context);
118 match field_res {
119 Ok((input, _)) => {
120 return Ok((input, ()));
121 },
122 Err(error) => {
123 match error {
124 Err::Incomplete(_) |
125 Err::Error(_) => {},
126 Err::Failure(_) => {
127 return Err(error);
128 }
129 }
130 }
131 }
132 }
133
134 // Function
135 {
136 let func_res = parse_function(input, context);
137 match func_res {
138 Ok((input, _)) => {
139 return Ok((input, ()));
140 },
141 Err(error) => {
142 match error {
143 Err::Incomplete(_) |
144 Err::Error(_) => {},
145 Err::Failure(_) => {
146 return Err(error);
147 }
148 }
149 }
150 }
151 }
152
153 // Import
154 {
155 let import_res = import(input, context);
156 match import_res {
157 Ok((input, _)) => {
158 return Ok((input, ()));
159 },
160 Err(error) => {
161 match error {
162 Err::Incomplete(_) |
163 Err::Error(_) => {},
164 Err::Failure(_) => {
165 return Err(error);
166 }
167 }
168 }
169 }
170 }
171

Callers 4

documentFunction · 0.85
root_statementsFunction · 0.85
json_statementsFunction · 0.85
object_valueFunction · 0.85

Calls 10

parse_fieldFunction · 0.85
parse_functionFunction · 0.85
importFunction · 0.85
parse_dataFunction · 0.85
root_statementsFunction · 0.85
json_statementsFunction · 0.85
parse_inner_doc_commentFunction · 0.85
whitespace_failFunction · 0.85
insert_stof_dataMethod · 0.80
self_ptrMethod · 0.45

Tested by

no test coverage detected