Merge branch 'trunk' of ssh://src.le-moine.org:38172/gwh/rpl.rb into trunk
This commit is contained in:
commit
703c659f83
3 changed files with 11 additions and 2 deletions
|
@ -6,6 +6,9 @@ To run REPL locally: `rake run`
|
|||
|
||||
To run the test suite: `rake test`
|
||||
|
||||
# BUGs
|
||||
* var1 var2 +|-|*|\ ===> result in on stack (normal) AND stored in var1 (_bug_)
|
||||
|
||||
# TODO-list
|
||||
* pseudo filesystem: subdir/namespace for variables
|
||||
. 'a dir' crdir 'a dir' cd vars
|
||||
|
|
4
bin/rpl
4
bin/rpl
|
@ -84,5 +84,5 @@ end
|
|||
# third launch REPL if (explicitely or implicitely) asked
|
||||
RplRepl.new( interpreter ).run if options[:run_REPL]
|
||||
|
||||
# last print resulting stack on exit (formatted so that it can be fed back later to interpreter)
|
||||
pp interpreter.export_stack
|
||||
# last print defined vars and resulting stack on exit (formatted so that it can be fed back later to interpreter)
|
||||
pp "#{interpreter.export_vars} #{interpreter.export_stack}"
|
||||
|
|
|
@ -101,6 +101,12 @@ class Interpreter
|
|||
args
|
||||
end
|
||||
|
||||
def export_vars
|
||||
@dictionary.vars
|
||||
.map { |name, value| "#{value.to_s} '#{name}' sto" }
|
||||
.join(' ')
|
||||
end
|
||||
|
||||
def export_stack
|
||||
@stack.map(&:to_s).join(' ')
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue