Browse Source

Detail

Code for multi-character tokens can start right after maximum char.
pull/24/head
Roberto Ierusalimschy 4 years ago
parent
commit
98ec799591
  1. 1
      llex.c
  2. 8
      llex.h

1
llex.c

@ -81,7 +81,6 @@ void luaX_init (lua_State *L) {
const char *luaX_token2str (LexState *ls, int token) {
if (token < FIRST_RESERVED) { /* single-byte symbols? */
lua_assert(token == cast_uchar(token));
if (lisprint(token))
return luaO_pushfstring(ls->L, "'%c'", token);
else /* control character */

8
llex.h

@ -7,11 +7,17 @@
#ifndef llex_h
#define llex_h
#include <limits.h>
#include "lobject.h"
#include "lzio.h"
#define FIRST_RESERVED 257
/*
** Single-char tokens (terminal symbols) are represented by their own
** numeric code. Other tokens start at the following value.
*/
#define FIRST_RESERVED (UCHAR_MAX + 1)
#if !defined(LUA_ENV)

Loading…
Cancel
Save