From a2f5c28a802ae99f2045ab96585fade2c65b2037 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 26 Apr 2013 10:08:29 -0300 Subject: new operation '//' (integer division) --- llex.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'llex.c') diff --git a/llex.c b/llex.c index bb5f36ab..9544de4f 100644 --- a/llex.c +++ b/llex.c @@ -1,5 +1,5 @@ /* -** $Id: llex.c,v 2.63 2013/03/16 21:10:18 roberto Exp roberto $ +** $Id: llex.c,v 2.64 2013/04/16 18:46:28 roberto Exp roberto $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ @@ -38,7 +38,7 @@ static const char *const luaX_tokens [] = { "end", "false", "for", "function", "goto", "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true", "until", "while", - "..", "...", "==", ">=", "<=", "~=", "::", "", + "//", "..", "...", "==", ">=", "<=", "~=", "::", "", "", "", "", "" }; @@ -464,6 +464,11 @@ static int llex (LexState *ls, SemInfo *seminfo) { if (ls->current != '=') return '>'; else { next(ls); return TK_GE; } } + case '/': { + next(ls); + if (ls->current != '/') return '/'; + else { next(ls); return TK_IDIV; } + } case '~': { next(ls); if (ls->current != '=') return '~'; -- cgit v1.2.3-55-g6feb