diff options
| author | Matthew Hall <hallmatthew314@gmail.com> | 2022-09-04 15:55:10 +1200 |
|---|---|---|
| committer | Matthew Hall <hallmatthew314@gmail.com> | 2022-09-04 15:55:10 +1200 |
| commit | 2fe381c9a1719718d4a4dfc662f07db47af7831f (patch) | |
| tree | 9878717f235f686849e685599500394a461e9b0e /src/thue/program.cr | |
| parent | 70dbbd733758b61317af37af1cbbec6aa4b6e2a5 (diff) | |
Big refactor + Program base class
Diffstat (limited to 'src/thue/program.cr')
| -rw-r--r-- | src/thue/program.cr | 10 |
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 |
