~ubuntu-branches/ubuntu/utopic/ctioga2/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/ctioga2/commands/interpreter.rb

  • Committer: Package Import Robot
  • Author(s): Vincent Fourmond
  • Date: 2014-03-17 22:29:58 UTC
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20140317222958-gm9buuyobrs60u6p
Tags: upstream-0.10
ImportĀ upstreamĀ versionĀ 0.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
require 'ctioga2/commands/context'
17
17
require 'ctioga2/commands/variables'
18
18
require 'ctioga2/commands/strings'
 
19
require 'ctioga2/commands/function'
 
20
require 'ctioga2/commands/general-functions'
19
21
require 'ctioga2/commands/parsers/command-line'
20
22
require 'ctioga2/commands/doc/doc'
21
23
 
192
194
        @context = ParsingContext.new
193
195
      end
194
196
 
 
197
      # Calls the given function and returns the result
 
198
      def call_function(name, args)
 
199
        func = Function.named_function(name)
 
200
        if ! func
 
201
          raise "Unkown function #{name}"
 
202
        end
 
203
        return func.expand(args, self)
 
204
      end
 
205
 
195
206
 
196
207
      # Parses and run the given command-line, sending the commands to
197
208
      # the #plotmaker_target.