1#![deny(rust_2018_idioms)]
2#![deny(clippy::all)]
3#![deny(clippy::nursery)]
4
5use lmml::ast::LmmlAst;
6use nom::IResult;
7use nom_language::error::VerboseError;
8
9mod parsers;
10
11pub fn remove_comments(input: &str) -> String {
12 let mut v = Vec::new();
13 for line in input.lines() {
14 if line.trim_start().starts_with(';') {
15 v.push("");
16 continue;
17 }
18 v.push(line);
19 }
20 v.join("\n")
21}
22
23pub fn parse_lmml(input: &str) -> IResult<&str, LmmlAst, VerboseError<&str>> {
24 parsers::parse_lmml_until_eof(input)
25}