(source: &str)
| 54 | } |
| 55 | |
| 56 | pub fn parse_program(source: &str) -> ParseOutput { |
| 57 | let mut state = context::State::new(); |
| 58 | let (program, errors) = program() |
| 59 | .parse_with_state(source, &mut state) |
| 60 | .into_output_errors(); |
| 61 | |
| 62 | let errors = errors |
| 63 | .into_iter() |
| 64 | .map(error::ParseError::from_rich) |
| 65 | .collect(); |
| 66 | |
| 67 | ParseOutput { |
| 68 | program, |
| 69 | errors, |
| 70 | extra: state.0, |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | fn recursives<'a>() -> ( |
| 75 | impl Parser<'a, &'a str, Statement, Extra<'a>> + Clone, |