Importing

This commit is contained in:
2026-05-04 19:29:10 +02:00
parent 544074c26e
commit c717a57f99
4 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -123,10 +123,10 @@ impl TryFrom<pest::iterators::Pair<'_, Rule>> for TopLevel {
type Error = ();
fn try_from(pair: pest::iterators::Pair<Rule>) -> Result<Self, ()> {
match pair.as_rule() {
Rule::import => {
let path = pair.into_inner().next().unwrap().as_str().to_string();
Ok(TopLevel::Import(path))
}
Rule::import => Ok(TopLevel::Include(StaticPath::from(
pair.into_inner().next().unwrap(),
))),
Rule::function_decl => {
let mut inner = pair.into_inner();