Skip to content

Commit c139ae3

Browse files
haskell like short operator
1 parent d08a6b4 commit c139ae3

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

john.blaze

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import net/http!
22
import io!
33

44

5-
url $= "http://letsgosky.social"!
5+
url <- "http://letsgosky.social"!
66
try [
77
// this is a commment, this gets sent to the transpiled version too
8-
response $= http::Get(url)!
9-
body := io::ReadAll(response.Body)!
8+
response <- http::Get(url)!
9+
body <- io::ReadAll(response.Body)!
1010
print("Response Status: " + response.Status)!
1111
print("Response Body: " + string(body))!
1212
] catch err [

transpiler.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ func NewTranspiler(source string) *Transpiler {
1818
}
1919
}
2020

21-
/*
22-
func (t *Transpiler) generateHeader() {
23-
t.output.WriteString("// Generated by Blaze Transpiler\n")
24-
t.output.WriteString(fmt.Sprintf("// Current Date and Time (UTC): %s\n", time.Now().UTC().Format("2006-01-02 15:04:05")))
25-
t.output.WriteString("package main\n\n")
26-
27-
}
28-
*/
2921
func (t *Transpiler) processLine(line string) string {
3022

3123
if strings.HasPrefix(line, "print(") {
@@ -52,7 +44,7 @@ func (t *Transpiler) processLine(line string) string {
5244
line = strings.ReplaceAll(line, ";", "!")
5345
line = strings.ReplaceAll(line, "[", "{")
5446
line = strings.ReplaceAll(line, "]", "}")
55-
line = strings.ReplaceAll(line, "$=", ":=")
47+
line = strings.ReplaceAll(line, "<-", ":=")
5648

5749
// Handle imports
5850
if strings.HasPrefix(line, "import ") {

0 commit comments

Comments
 (0)