module forth
-import Base.REPLCompletions, Base.invokelatest
+import REPL.REPLCompletions, Base.invokelatest
# VM mem size
size_mem = 1000000 # 1 mega-int
DICT = mem[H] # Save bottom of dictionary as constant
# VM registers
-type Reg
+mutable struct Reg
RSP::Int64 # Return stack pointer
PSP::Int64 # Parameter/data stack pointer
IP::Int64 # Instruction pointer
function defPrim(f::Function; name="nameless")
push!(primitives, f)
- push!(primNames, replace(name, "\004", "EOF"))
+ push!(primNames, replace(name, "\004" => "EOF"))
return -length(primitives)
end
end)
function raw_mode!(mode::Bool)
- if ccall(:jl_tty_set_mode, Int32, (Ptr{Void}, Int32), STDIN.handle, mode) != 0
+ if ccall(:jl_tty_set_mode, Int32, (Ptr{Nothing}, Int32), STDIN.handle, mode) != 0
throw("FATAL: Terminal unable to enter raw mode.")
end
end
catch ex
println(string("Error in primitive '", getPrimName(jmp), "' at address ", jmp))
- showerror(STDOUT, ex)
+ showerror(stdout, ex)
println()
# QUIT