lib/tex/context/contextsetup.rb
# Put an array with the variants of each command (see placeregister for an example)
# in a hash (@commands) where the key is the name of the command and the value
# is the array.  cmd_elt is a REXML::Element which needs to get parsed.
# The XML can be currupt. If this is the case the command can obviously not be included
# in the list of the commands. But how should the bug report be? Perhaps there 
# should be an error string which the user can view after the library finishes.
Put an array with the variants of each command
in a hash (@commands) where the key is the name of the command and the value
is the array.  cmd_elt is a REXML::Element which needs to get parsed.
The XML can be currupt. If this is the case the command can obviously not be included
in the list of the commands. But how should the bug report be. Perhaps there
should be an error string which the user can view after the library finishes.
Put an array with the variants of each command in a hash ( @commands ) where the key is the name of the command and the value is the array . cmd_elt is a REXML :: Element which needs to get parsed . The XML can be currupt . If this is the case the command can obviously not be included in the list of the commands . But how should the bug report be . Perhaps there should be an error string which the user can view after the library finishes .
def add_command(cmd_elt)
      begin
        c=Command.parse_xml(cmd_elt,self)
         every value of the @command hash has an arry as its argument
         if there is no array yet, the following adds a default empty array to 
         the entry of the command
        ary=@commands[c.cmd_name(false)] ||= []
         the default variant is 1
        ary[c.variant - 1]=c
      rescue CommandParseException => e
        @error_messages <<  "broken command: {e} inside\n{cmd_elt}\n----------------------------\n"
      end
    end
def add_command ( cmd_elt ) begin c = Command . parse_xml ( cmd_elt , self ) ary = @commands [ c . cmd_name ( false ) ] ||= [ ] ary [ c . variant - 1 ] = c rescue CommandParseException => e @error_messages << "broken command: #{e} inside\n#{cmd_elt}\n----------------------------\n" end end
Put an array with the variants of each command (see placeregister for an example)
in a hash (@commands) where the key is the name of the command and the value
is the array.
Put an array with the variants of each command ( see placeregister for an example ) in a hash ( @commands ) where the key is the name of the command and the value is the array .
# c is now a Command. c.cmd_name(false) is the name of the command such  as # "color" or "startcolor" # # every value of the @command hash has an arry as its argument # if there is no array yet, the following adds a default empty array to  # the entry of the command # the default variant is 1
cmd_elt
<not_specific>