[system] / trunk / pg / macros / contextLimitedNumeric.pl Repository:
ViewVC logotype

View of /trunk/pg/macros/contextLimitedNumeric.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5392 - (download) (as text) (annotate)
Sun Aug 19 21:50:23 2007 UTC (12 years, 6 months ago) by dpvc
File size: 885 byte(s)
Move the context creation to the _init routine so that modifications
to main:: occur at initialization time, not when the file is loaded.

    1 
    2 loadMacros("MathObjects.pl");
    3 
    4 =head3 Context("LimitedNumeric")
    5 
    6  ##########################################################
    7  #
    8  #  Implements a context in which numbers can be entered,
    9  #  but no operations are permitted between them.
   10  #
   11  #  There are two versions:  one for lists of numbers
   12  #  and one for a single number.  Select them using
   13  #  one of the following commands:
   14  #
   15  #      Context("LimitedNumeric-list");
   16  #      Context("LimiteNumeric");
   17  #
   18  #  (Now uses Parcer::Legacy::LimitedNumeric to implement
   19  #  these contexts.)
   20 
   21 =cut
   22 
   23 ##################################################
   24 
   25 sub _contextLimitedNumeric_init {
   26 
   27   my $context = $main::context{"LimitedNumeric-List"} = Parser::Context->getCopy("LimitedNumeric");
   28   $context->operators->redefine(',');
   29 
   30   main::Context("LimitedNumeric");  ### FIXME:  probably should require the author to set this explicitly
   31 }
   32 
   33 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9