[system] / trunk / webwork-modperl / doc / parser / extensions / 5-operator.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

Diff of /trunk/webwork-modperl/doc/parser/extensions/5-operator.pg

Revision 2572 Revision 2573
46\$prec = Context()->operators->get(',')->{precedence} + .25; 46\$prec = Context()->operators->get(',')->{precedence} + .25;
47 47
49 '=' => { 49 '=' => {
50 class => 'Equality', 50 class => 'Equality',
51 precedence => \$prec, # just below addition 51 precedence => \$prec, # just above comma
52 associativity => 'left', # computed left to right 52 associativity => 'left', # computed left to right
53 type => 'bin', # binary operator 53 type => 'bin', # binary operator
54 string => '=', # output string for it 54 string => '=', # output string for it
55 perl => '==', # perl string 55 perl => '==', # perl string
56 } 56 }
57); 57);
58 58
59# 59#
65# 65#
66# The problem text 66# The problem text
67# 67#
68BEGIN_TEXT 68BEGIN_TEXT
69 69
70In this problem, we have added a new operator to the Parser: \${BTT} a = b\${ETT}, 70In this problem, we have added a new operator to the Parser: \${BTT} a
71which returns \(n\choose r\). 71= b\${ETT}, for equality.
72\$PAR 72\$PAR
73 73
74\{ParserTable( 74\{ParserTable(
75 'Formula("x + y = 0")', 75 'Formula("x + y = 0")',
76 'Formula("x + y = 0")->{tree}->class', 76 'Formula("x + y = 0")->{tree}->class',

Legend:
 Removed from v.2572 changed lines Added in v.2573