LLscan either macro or function

This commit is contained in:
ceriel 1988-06-24 14:55:27 +00:00
parent 1c801f86eb
commit e67a70cbea
2 changed files with 8 additions and 1 deletions

View file

@ -10,7 +10,10 @@ extern int LLsymb;
#define LL_SAFE(x) /* Nothing */ #define LL_SAFE(x) /* Nothing */
#define LL_SSCANDONE(x) if (LLsymb != x) LLerror(x); else #define LL_SSCANDONE(x) if (LLsymb != x) LLerror(x); else
#define LL_SCANDONE(x) if (LLsymb != x) LLerror(x); else #define LL_SCANDONE(x) if (LLsymb != x) LLerror(x); else
#define LL_NOSCANDONE(x) if ((LLsymb = LL_LEXI()) != x) LLerror(x); else #define LL_NOSCANDONE(x) LLscan(x)
#ifdef LL_FASTER
#define LLscan(x) if ((LLsymb = LL_LEXI()) != x) LLerror(x); else
#endif
# include "Lpars.h" # include "Lpars.h"

View file

@ -20,7 +20,9 @@ static int LLlevel;
extern LLread(); extern LLread();
extern int LLskip(); extern int LLskip();
extern int LLnext(); extern int LLnext();
#ifndef LLscan
extern LLscan(); extern LLscan();
#endif
extern LLerror(); extern LLerror();
# ifndef LLNOFIRSTS # ifndef LLNOFIRSTS
extern int LLfirst(); extern int LLfirst();
@ -28,6 +30,7 @@ extern int LLfirst();
extern LLnewlevel(); extern LLnewlevel();
extern LLoldlevel(); extern LLoldlevel();
#ifndef LLscan
LLscan(t) { LLscan(t) {
/* /*
* Check if the next symbol is equal to the parameter * Check if the next symbol is equal to the parameter
@ -40,6 +43,7 @@ LLscan(t) {
*/ */
LLerror(t); LLerror(t);
} }
#endif
LLread() { LLread() {
for (;;) { for (;;) {