summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuleyman Farajli <suleyman@farajli.net>2025-01-07 02:24:19 +0400
committerSuleyman Farajli <suleyman@farajli.net>2025-01-07 02:24:19 +0400
commit180b6ab7c204ddf3a8aa2b9b022085e6a96ff99a (patch)
treeafb0144af0ba75d516e100d1fc6fa0c309620c0e
parentc9090da5bd98c418f71f9110c6c3d82f2f7d37ee (diff)
program name changed to 'ash'
-rw-r--r--.gitignore5
-rw-r--r--Makefile13
-rw-r--r--examples/const.ash (renamed from examples/const.gorth)0
-rw-r--r--examples/fib.ash (renamed from examples/fib.gorth)0
-rw-r--r--examples/hello_world.ash (renamed from examples/hello_world.gorth)2
-rw-r--r--examples/seq10.ash (renamed from examples/seq10.gorth)0
-rw-r--r--examples/words.ash (renamed from examples/words.gorth)0
-rw-r--r--go.mod2
-rw-r--r--lib/std.ash (renamed from lib/stdlib.gorth)0
-rw-r--r--src/main.go10
10 files changed, 14 insertions, 18 deletions
diff --git a/.gitignore b/.gitignore
index eb0c630..b88931b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,2 @@
-test-asm
-test.gorth
-test
-gorth
+ash
GNUmakefile
diff --git a/Makefile b/Makefile
index 47a3dce..ce70bdb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,16 @@
PREFIX ?= /usr/local
+ash: src/main.go
+ go build -o ash ./src
-gorth: src/main.go
- go build -o gorth ./src
-
-install: gorth
+install: ash
mkdir -p ${DESTDIR}${PREFIX}/bin
- cp -f gorth ${DESTDIR}${PREFIX}/bin
+ cp -f ash ${DESTDIR}${PREFIX}/bin
uninstall:
- rm -f ${DESTDIR}${PREFIX}/bin/gorth
+ rm -f ${DESTDIR}${PREFIX}/bin/ash
clean:
- rm -f gorth
+ rm -f ash
.PHONY: test clean
diff --git a/examples/const.gorth b/examples/const.ash
index 421f7f5..421f7f5 100644
--- a/examples/const.gorth
+++ b/examples/const.ash
diff --git a/examples/fib.gorth b/examples/fib.ash
index bf2b90d..bf2b90d 100644
--- a/examples/fib.gorth
+++ b/examples/fib.ash
diff --git a/examples/hello_world.gorth b/examples/hello_world.ash
index 1df3bf4..a1c1d48 100644
--- a/examples/hello_world.gorth
+++ b/examples/hello_world.ash
@@ -1,5 +1,5 @@
# Prints out "Hello, World!"
-include "../lib/stdlib.gorth"
+include "../lib/std.ash"
"Hello, World!" write
diff --git a/examples/seq10.gorth b/examples/seq10.ash
index e73743e..e73743e 100644
--- a/examples/seq10.gorth
+++ b/examples/seq10.ash
diff --git a/examples/words.gorth b/examples/words.ash
index c0e1461..c0e1461 100644
--- a/examples/words.gorth
+++ b/examples/words.ash
diff --git a/go.mod b/go.mod
index 7d2336e..2484211 100644
--- a/go.mod
+++ b/go.mod
@@ -1,3 +1,3 @@
-module gorth
+module ash
go 1.23.3
diff --git a/lib/stdlib.gorth b/lib/std.ash
index d44cccb..d44cccb 100644
--- a/lib/stdlib.gorth
+++ b/lib/std.ash
diff --git a/src/main.go b/src/main.go
index cfcb27c..143b165 100644
--- a/src/main.go
+++ b/src/main.go
@@ -592,7 +592,7 @@ func main() {
argv := os.Args;
argc := len(argv);
progname = argv[0]
- suffix := ".gorth"
+ suffix := ".ash"
if argc != 2 {
fmt.Fprintf(os.Stderr, "%s: error: expected one input file.\n", progname)
@@ -600,14 +600,14 @@ func main() {
}
srcFile := argv[argc - 1]
- if !strings.HasSuffix(srcFile, suffix) || len(srcFile) < 7 {
+ if !strings.HasSuffix(srcFile, suffix) || len(srcFile) < 5 {
fmt.Fprintf(os.Stderr, "%s: error: invalid file format '%s'.\n", progname, srcFile)
os.Exit(1)
}
- assemFile := srcFile[:len(srcFile) - 6] + ".s"
- objFile := srcFile[:len(srcFile) - 6] + ".o"
- binFile := srcFile[:len(srcFile) - 6]
+ binFile := srcFile[:len(srcFile) - 4]
+ assemFile := binFile + ".s"
+ objFile := binFile + ".o"
_, err := os.Stat(srcFile)
if err != nil {
fmt.Fprintf(os.Stderr, "%s: error: %s.\n", progname, err)