Class: Frepl::ReplCommand
- Inherits:
-
SinglelineStatement
- Object
- Statement
- SinglelineStatement
- Frepl::ReplCommand
- Defined in:
- lib/frepl/statements/repl_command.rb
Constant Summary collapse
- COMMANDS =
{ 'run' => { info: 'Run the current set of Fortran code', l: lambda { |file| file.run }, }, 'toggle_debug' => { info: 'Toggle debug mode on/off', l: lambda { |file| Frepl.debug = !Frepl.debug }, }, 'help' => { info: 'View this hopefully helpful help', l: lambda do |file| puts "Available Frepl commands:\n" COMMANDS.each do |k, v| puts "f:#{k} -- #{v[:info]}" end end }, 'z' => { info: 'Undo last statement', l: lambda do |file| file.undo_last! end } }
Instance Attribute Summary
Attributes inherited from SinglelineStatement
Instance Method Summary collapse
Methods inherited from SinglelineStatement
#incomplete?, #initialize, #output
Methods inherited from Statement
Constructor Details
This class inherits a constructor from Frepl::SinglelineStatement
Instance Method Details
#accept(visitor) ⇒ Object
29 30 31 |
# File 'lib/frepl/statements/repl_command.rb', line 29 def accept(visitor) visitor.visit_repl_command(self) end |
#cmd ⇒ Object
42 43 44 |
# File 'lib/frepl/statements/repl_command.rb', line 42 def cmd @cmd ||= line.match(/f:(.+)/)[1] end |