Skip to content

Commit 9bb8abe

Browse files
committed
to lanbda: function, args, comma
1 parent 85aa30d commit 9bb8abe

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Project worldlang
2-
Language union
2+
![GitHub](https://img.shields.io/github/license/heartleth/worldlang?style=for-the-badge)
3+
![GitHub last commit](https://img.shields.io/github/last-commit/heartleth/worldlang?style=for-the-badge)
4+
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/heartleth/worldlang?style=for-the-badge)
5+
![Visual Studio Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/myjmyjmyj.wlsupport?style=for-the-badge)
6+
[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Write%20code%20once%20and%20do%20everything!&url=https://github.com/heartleth/worldlang)
37

48
<p align=center>
59
<img src="img/WL.png">

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ fn main()-> std::io::Result<()> {
4747
\\:::```|=========`````` __---``
4848
`````-----------````
4949
- Compiled to any language
50-
- enpp-every [filename without ext]
51-
- enpp-every [filename without ext] [language json]
52-
release Chin
50+
- worldlang [filename without ext] [run] [quietly]
51+
- worldlang [filename without ext] [language json] [run] [quietly]
52+
release Han
5353
");
5454
}
5555
else if args.len() == 2 {

src/transpile/blocks/parser/value.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,15 @@ pub fn value_parse(s :&String, level :usize, lang :&json::JsonValue)->Result<Str
163163
else if regi(&units[0], r"^(to)$") {
164164
do_pass = false;
165165
let func_call = parse_sentence(&format!("it {}", &s[3..]), &lang)?;
166+
let trailing_comma = if func_call.chars().nth(func_call.len()-2).unwrap() == '(' {""} else {
167+
jpath!(lang, operator.commas)?
168+
};
166169

167170
ret = render(jpath!(lang, to_lambdas)?, &json!({
168171
"call": &func_call[..func_call.len()-1],
169-
"comma": if func_call.chars().nth(func_call.len()-2).unwrap() == '(' {""} else {
170-
jpath!(lang, operator.commas)?
171-
}
172+
"comma": &trailing_comma,
173+
"function": &list[1],
174+
"args": &value_parse(&String::from(&s[5+list[1].len()+list[2].len()..]), 0, lang)?
172175
}))?;
173176
}
174177
}

0 commit comments

Comments
 (0)