Skip to content

Commit a5bd0b5

Browse files
committed
Add HelloPy and HelloRust. Rust support not functional yet.
1 parent 2ed7d50 commit a5bd0b5

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

defaults/HelloPy.lf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
target Python;
2+
3+
main reactor {
4+
reaction (startup) {=
5+
print("Hello World!")
6+
=}
7+
}
8+

defaults/HelloRust.lf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
target Rust;
2+
3+
main reactor {
4+
reaction (startup) {=
5+
println!("Hello World!");
6+
=}
7+
}
8+

src/package/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,9 @@ impl ConfigFile {
216216
let hello_world_code: &'static str = match self.apps[0].target {
217217
TargetLanguage::Cpp => include_str!("../../defaults/HelloCpp.lf"),
218218
TargetLanguage::C => include_str!("../../defaults/HelloC.lf"),
219+
TargetLanguage::Python => include_str!("../../defaults/HelloPy.lf"),
219220
TargetLanguage::TypeScript => include_str!("../../defaults/HelloTS.lf"),
220-
_ => panic!("Target langauge not supported yet"), // FIXME: Add examples for other programs
221+
_ => panic!("Target langauge not supported yet"), //FIXME: Add support for Rust.
221222
};
222223

223224
write(Path::new("./src/Main.lf"), hello_world_code)?;

0 commit comments

Comments
 (0)