persist LCD too

This commit is contained in:
Gwenhael Le Moine 2023-07-20 16:51:09 +02:00
parent 0da1ab8590
commit 7773007fc3
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
2 changed files with 8 additions and 1 deletions

View file

@ -37,7 +37,7 @@ class Rpl < Interpreter
def persist_state
return if @persistence_filename.nil?
File.write(@persistence_filename, "#{export_vars}\n#{export_stack}")
File.write(@persistence_filename, "#{export_lcd}\n#{export_vars}\n#{export_stack}")
end
def run!( input )

View file

@ -77,6 +77,13 @@ class Interpreter
args
end
def export_lcd
lcd_as_string = "@ LCD:\n"
lcd_as_string += "#{@lcd_grob} →lcd\n"
lcd_as_string
end
def export_vars
vars_as_string = "@ variables:\n"
vars_as_string += @dictionary.vars