Skip to content

Commit 2fe15fe

Browse files
authored
Merge pull request #44 from lf-lang/add-python
Enable `lingo init -l python`
2 parents 2ed7d50 + a51108c commit 2fe15fe

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

defaults/HelloPy.lf

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

defaults/HelloRust.lf

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

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)