ezno-parser 0.1.2

Parser and AST definitions for Ezno
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use ezno_parser::{ASTNode, Module, ParseOptions};
use source_map::SourceId;

fn main() -> Result<(), Box<dyn std::error::Error>> {
	const STACK_SIZE_MB: usize = 64;
	let options =
		ParseOptions { stack_size: Some(STACK_SIZE_MB * 1024 * 1024), ..ParseOptions::default() };

	for i in 0..200 {
		let mut s = "a ? b : c".to_owned();
		for _ in 0..(i * 5) {
			s = format!("a ? b : ({s})");
		}
		eprintln!("parsing at {}", i * 5);
		let _result = Module::from_string(s, options, SourceId::NULL, None)?;
	}
	Ok(())
}