summaryrefslogtreecommitdiff
path: root/src/thue
diff options
context:
space:
mode:
authorMatthew Hall <hallmatthew314@gmail.com>2022-09-04 15:55:10 +1200
committerMatthew Hall <hallmatthew314@gmail.com>2022-09-04 15:55:10 +1200
commit2fe381c9a1719718d4a4dfc662f07db47af7831f (patch)
tree9878717f235f686849e685599500394a461e9b0e /src/thue
parent70dbbd733758b61317af37af1cbbec6aa4b6e2a5 (diff)
Big refactor + Program base class
Diffstat (limited to 'src/thue')
-rw-r--r--src/thue/program.cr10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/thue/program.cr b/src/thue/program.cr
index 96e1284..c9e5f2c 100644
--- a/src/thue/program.cr
+++ b/src/thue/program.cr
@@ -1,12 +1,16 @@
require "./thue.cr"
require "./parser.cr"
require "../util.cr"
+require "../program.cr"
-class Thue::Program
- def initialize(@parser : Parser)
+struct Thue::Program < Flint::Program
+ def initialize(source_io : IO)
+ super
+
+ @parser = Parser.new(source_io)
end
- def interpret
+ def interpret : Nil
rules, state = @parser.parse
loop do