[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 5556 - (download) (as text) (annotate)
Thu Oct 4 16:40:49 2007 UTC (12 years, 3 months ago) by sh002i
File size: 1773 byte(s)
added standard copyright/license header

    1 ################################################################################
    2 # WeBWorK Online Homework Delivery System
    3 # Copyright  2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
    4 # $CVSHeader: webwork2/lib/WeBWorK.pm,v 1.100 2007/08/13 22:59:53 sh002i Exp $
    5 #
    6 # This program is free software; you can redistribute it and/or modify it under
    7 # the terms of either: (a) the GNU General Public License as published by the
    8 # Free Software Foundation; either version 2, or (at your option) any later
    9 # version, or (b) the "Artistic License" which comes with this package.
   10 #
   11 # This program is distributed in the hope that it will be useful, but WITHOUT
   12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   13 # FOR A PARTICULAR PURPOSE.  See either the GNU General Public License or the
   14 # Artistic License for more details.
   15 ################################################################################
   16 
   17 =head1 NAME
   18 
   19 contextLimitedNumeric.pl - Allows numeric entry but no operations.
   20 
   21 =head1 DESCRIPTION
   22 
   23 Implements a context in which numbers can be entered,
   24 but no operations are permitted between them.
   25 
   26 There are two versions:  one for lists of numbers
   27 and one for a single number.  Select them using
   28 one of the following commands:
   29 
   30   Context("LimitedNumeric-List");
   31   Context("LimiteNumeric");
   32 
   33 (Now uses Parcer::Legacy::LimitedNumeric to implement
   34 these contexts.)
   35 
   36 =cut
   37 
   38 loadMacros("MathObjects.pl");
   39 
   40 sub _contextLimitedNumeric_init {
   41 
   42   my $context = $main::context{"LimitedNumeric-List"} = Parser::Context->getCopy("LimitedNumeric");
   43   $context->{name} = "LimitedNumeric-List";
   44   $context->operators->redefine(',');
   45 
   46   main::Context("LimitedNumeric");  ### FIXME:  probably should require the author to set this explicitly
   47 }
   48 
   49 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9