~ubuntu-branches/ubuntu/intrepid/gcalctool/intrepid

« back to all changes in this revision

Viewing changes to gcalctool/ce_parser.y

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Sauthier
  • Date: 2008-08-08 16:55:27 UTC
  • mfrom: (1.1.39 upstream)
  • Revision ID: james.westby@ubuntu.com-20080808165527-4e4ape1y0dt7wyiy
Tags: 5.23.6-0ubuntu1
* New upstream version (LP: #256083)
  - Fixes letters digits in HEX not working if caps locked(LP: #238389)
  - Fixes calculator not on the screen (LP: #235876)

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
udf:
125
125
  value '=' {
126
126
  cp($1, v->MPdisp_val);
127
 
  display_set_number(v->MPdisp_val);
 
127
  display_set_number(&v->display, v->MPdisp_val);
128
128
  }
129
129
| value '=' tSTO '(' tNUMBER ')' {
130
130
  int val = mp_cast_to_int($5);
135
135
  do_sto_reg(val, $1);
136
136
}
137
137
| tCLR {
138
 
  display_reset();
139
 
  display_set_number(v->MPdisp_val);
 
138
  display_reset(&v->display);
 
139
  display_set_number(&v->display, v->MPdisp_val);
140
140
}
141
141
;
142
142
 
199
199
| term '/' term {mpdiv($1, $3, $$);}
200
200
| term '*' term {mpmul($1, $3, $$);}
201
201
| 'e' '^' term {calc_epowy($3, $$);} 
202
 
| term '!' {do_factorial($1 ,$$);}
 
202
| term '!' {calc_factorial($1 ,$$);}
203
203
| term '%' {calc_percent($1, $$);}
204
204
| '-' term %prec NEG {mp_invert_sign($2, $$);}
205
205
| '+' term %prec POS {cp($2, $$);}
267
267
number:
268
268
  tNUMBER {cp($1, $$);}
269
269
| tANS {
270
 
  struct exprm_state *e = get_state();
271
 
  cp(e->ans, $$);
 
270
  cp(display_get_answer(&v->display), $$);
272
271
}
273
272
;
274
273