aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-08-31 16:46:07 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-08-31 16:46:07 -0300
commite1d072571ec6f9d830e575a2ecdc95fd43428e53 (patch)
tree830fab7f2acb9adaee2d63073d339cc9557a5437 /lparser.c
parent7651a5c6b2ee6ec59cadec6199319d482071f176 (diff)
downloadlua-e1d072571ec6f9d830e575a2ecdc95fd43428e53.tar.gz
lua-e1d072571ec6f9d830e575a2ecdc95fd43428e53.tar.bz2
lua-e1d072571ec6f9d830e575a2ecdc95fd43428e53.zip
better syntax for type casts
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lparser.c b/lparser.c
index 58b3bcba..aa79a86a 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 1.153 2001/08/10 20:53:03 roberto Exp roberto $ 2** $Id: lparser.c,v 1.154 2001/08/27 15:16:28 roberto Exp $
3** Lua Parser 3** Lua Parser
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -266,7 +266,7 @@ static void code_params (LexState *ls, int nparams, short dots) {
266 FuncState *fs = ls->fs; 266 FuncState *fs = ls->fs;
267 adjustlocalvars(ls, nparams); 267 adjustlocalvars(ls, nparams);
268 luaX_checklimit(ls, fs->nactloc, MAXPARAMS, l_s("parameters")); 268 luaX_checklimit(ls, fs->nactloc, MAXPARAMS, l_s("parameters"));
269 fs->f->numparams = (short)fs->nactloc; /* `self' could be there already */ 269 fs->f->numparams = cast(short, fs->nactloc); /* `self' could be there already */
270 fs->f->is_vararg = dots; 270 fs->f->is_vararg = dots;
271 if (dots) { 271 if (dots) {
272 new_localvarstr(ls, l_s("arg"), 0); 272 new_localvarstr(ls, l_s("arg"), 0);
@@ -758,13 +758,13 @@ static BinOpr subexpr (LexState *ls, expdesc *v, int limit) {
758 else simpleexp(ls, v); 758 else simpleexp(ls, v);
759 /* expand while operators have priorities higher than `limit' */ 759 /* expand while operators have priorities higher than `limit' */
760 op = getbinopr(ls->t.token); 760 op = getbinopr(ls->t.token);
761 while (op != OPR_NOBINOPR && (int)priority[op].left > limit) { 761 while (op != OPR_NOBINOPR && cast(int, priority[op].left) > limit) {
762 expdesc v2; 762 expdesc v2;
763 BinOpr nextop; 763 BinOpr nextop;
764 next(ls); 764 next(ls);
765 luaK_infix(ls->fs, op, v); 765 luaK_infix(ls->fs, op, v);
766 /* read sub-expression with higher priority */ 766 /* read sub-expression with higher priority */
767 nextop = subexpr(ls, &v2, (int)priority[op].right); 767 nextop = subexpr(ls, &v2, cast(int, priority[op].right));
768 luaK_posfix(ls->fs, op, v, &v2); 768 luaK_posfix(ls->fs, op, v, &v2);
769 op = nextop; 769 op = nextop;
770 } 770 }