diff --git a/mps-interpreter/src/lang/vocabulary/files.rs b/mps-interpreter/src/lang/vocabulary/files.rs index 871ca44..9605c54 100644 --- a/mps-interpreter/src/lang/vocabulary/files.rs +++ b/mps-interpreter/src/lang/vocabulary/files.rs @@ -125,21 +125,21 @@ impl MpsFunctionFactory for FilesFunctionFactory { let mut root_path = None; let mut pattern = None; let mut recursive = None; - if tokens[0].is_literal() { - // folder is specified without keyword - root_path = Some(assert_token( - |t| match t { - MpsToken::Literal(s) => Some(s), - _ => None, - }, - MpsToken::Literal("/path/to/music/folder".into()), - tokens, - )?); - if tokens.len() > 1 && tokens[0].is_comma() { - assert_token_raw(MpsToken::Comma, tokens)?; - } - } if tokens.len() != 0 { + if tokens[0].is_literal() { + // folder is specified without keyword + root_path = Some(assert_token( + |t| match t { + MpsToken::Literal(s) => Some(s), + _ => None, + }, + MpsToken::Literal("/path/to/music/folder".into()), + tokens, + )?); + if tokens.len() > 1 && tokens[0].is_comma() { + assert_token_raw(MpsToken::Comma, tokens)?; + } + } // parse keyword function parameters let ingest = |tokens2: &mut VecDeque| { if tokens2.len() < 3 {