Compare commits
2 commits
ef266f3811
...
f9a7b4d2de
Author | SHA1 | Date | |
---|---|---|---|
f9a7b4d2de | |||
1fd2647688 |
5 changed files with 10 additions and 7 deletions
2
repl.spl
2
repl.spl
|
@ -8,7 +8,7 @@ func main { mega | with args ;
|
||||||
catch {
|
catch {
|
||||||
" > " print readln dyn-read exec2 "\n" print
|
" > " print readln dyn-read exec2 "\n" print
|
||||||
}
|
}
|
||||||
with { with err ;
|
{ with err ;
|
||||||
err:message dup null eq if {
|
err:message dup null eq if {
|
||||||
pop
|
pop
|
||||||
"Uncaught error."
|
"Uncaught error."
|
||||||
|
|
|
@ -179,8 +179,10 @@ fn read_block(str_words: &[String], isfn: bool) -> Result<(Option<u32>, Words, u
|
||||||
types.push(str_words[i].to_owned());
|
types.push(str_words[i].to_owned());
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
|
println!("{} {}", str_words[i], str_words[i+1]);
|
||||||
let blk = read_block(&str_words[i + 1..], false)?;
|
let blk = read_block(&str_words[i + 1..], false)?;
|
||||||
i += 1 + blk.2;
|
i += 2 + blk.2;
|
||||||
|
println!("{} {}", str_words[i], str_words[i+1]);
|
||||||
let ctch = read_block(&str_words[i + 1..], false)?;
|
let ctch = read_block(&str_words[i + 1..], false)?;
|
||||||
i += 1 + ctch.2;
|
i += 1 + ctch.2;
|
||||||
words.push(Word::Key(Keyword::Catch(types, blk.1, ctch.1)))
|
words.push(Word::Key(Keyword::Catch(types, blk.1, ctch.1)))
|
||||||
|
|
|
@ -22,6 +22,9 @@ fn main() {
|
||||||
}
|
}
|
||||||
println!("Embedding source...");
|
println!("Embedding source...");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
builder.set_name(file[..file.rfind('.').unwrap_or(file.len())].to_owned());
|
||||||
|
}
|
||||||
builder.add_source(file.to_owned(), data.to_owned());
|
builder.add_source(file.to_owned(), data.to_owned());
|
||||||
if build_only {
|
if build_only {
|
||||||
println!("Preparing rust code...");
|
println!("Preparing rust code...");
|
||||||
|
|
3
std.spl
3
std.spl
|
@ -472,8 +472,7 @@ func call-main-on-file { | with file ;
|
||||||
"@" file concat import
|
"@" file concat import
|
||||||
update-types
|
update-types
|
||||||
argv main exit
|
argv main exit
|
||||||
}
|
} { with err ;
|
||||||
with { with err ;
|
|
||||||
err:message dup null eq if {
|
err:message dup null eq if {
|
||||||
pop
|
pop
|
||||||
"Uncaught error."
|
"Uncaught error."
|
||||||
|
|
5
test.spl
5
test.spl
|
@ -120,8 +120,7 @@ func main { int | with args ;
|
||||||
"testing http" println
|
"testing http" println
|
||||||
def req "tudbut.de" 81 "GET" "/spltest" Request:new =req
|
def req "tudbut.de" 81 "GET" "/spltest" Request:new =req
|
||||||
req:send:body _str println
|
req:send:body _str println
|
||||||
}
|
} { with e ;
|
||||||
with { with e ;
|
|
||||||
e:message println
|
e:message println
|
||||||
"it seems the internet is not available" println
|
"it seems the internet is not available" println
|
||||||
}
|
}
|
||||||
|
@ -136,7 +135,7 @@ func main { int | with args ;
|
||||||
|
|
||||||
catch {
|
catch {
|
||||||
"heya" throw
|
"heya" throw
|
||||||
} with { with e ;
|
} { with e ;
|
||||||
e:message println
|
e:message println
|
||||||
}
|
}
|
||||||
"" println
|
"" println
|
||||||
|
|
Loading…
Reference in a new issue