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

Diff of /trunk/pg/macros/answerVariableList.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 5054 Revision 5055
24# addVariables('x','y','z'); 24# addVariables('x','y','z');
25# ANS(variable_cmp("(x,y)")); 25# ANS(variable_cmp("(x,y)"));
26# 26#
27# addVariables('x','y','z','s','t,); 27# addVariables('x','y','z','s','t,);
28# ANS(variable_cmp("s,t")); 28# ANS(variable_cmp("s,t"));
29# 29#
30# addVariables('x','y','z'); 30# addVariables('x','y','z');
31# ANS(variable_cmp("(x)",showHints=>0,showLengthHints=>0)); 31# ANS(variable_cmp("(x)",showHints=>0,showLengthHints=>0));
32# 32#
33 33
34=cut
35
34# 36#
35# A new context for variable lists 37# A new context for variable lists
36# 38#
37
38=cut
39
40
41$context{VariableList} = Parser::Context->new( 39$context{VariableList} = Parser::Context->new(
42 operators => {',' => Context()->operators->get(',')}, 40 operators => {',' => $Parser::Context::Default::fullContext->operators->get(',')},
43 lists => {'List' => {class =>'Parser::List::List'}}, 41 lists => {'List' => {class =>'Parser::List::List'}},
44 parens => { 42 parens => {
45 '(' => {close => ')', type => 'List', formList => 1}, 43 '(' => {close => ')', type => 'List', formList => 1},
46 'start' => {close => 'start', type => 'List', formList => 1, 44 'start' => {close => 'start', type => 'List', formList => 1,
47 removable => 1, emptyOK => 1, hidden => 1}, 45 removable => 1, emptyOK => 1, hidden => 1},
57 55
58# 56#
59# A shell that calls Formula()->cmp with the right defaults 57# A shell that calls Formula()->cmp with the right defaults
60# 58#
61sub variable_cmp { 59sub variable_cmp {
62 Value::Formula->new(shift)->cmp( 60 Value->Package("Formula")->new(shift)->cmp(
63 ordered => 1, 61 ordered => 1,
64 entry_type =>'a variable', 62 entry_type =>'a variable',
65 list_type => 'a list', 63 list_type => 'a list',
66 implicitList => 0, 64 implicitList => 0,
67 @_ 65 @_

Legend:
Removed from v.5054  
changed lines
  Added in v.5055

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9