Ed Davis

Joined 31 August 2022
no edit summary
No edit summary
No edit summary
Line 196:
=={{header|C}}==
<lang C>
 
#include <stdlib.h>
#include <stdio.h>
Line 204 ⟶ 203:
#include <errno.h>
#include <stdbool.h>
#include <limits.h>
 
#define NELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
Line 308:
 
static int kwd_cmp(const void *p1, const void *p2) {
return stricmpstrcmp(*(char **)p1, *(char **)p2);
}
 
Line 430:
=={{header|Python}}==
<lang Python>
 
import sys
 
Line 454 ⟶ 453:
#*** show error and exit
def error(line, col, msg):
print (line, col, msg)
exit(1)
 
Line 582 ⟶ 581:
 
if tok == Integerk:
print ("line %5d col %5d %-8s %8d" % (line, col, all_syms[tok], t[3]))
elif tok == Ident:
print ("line %5d col %5d %-8s %s" % (line, col, all_syms[tok], t[3]))
elif tok == Stringk:
print ('line %5d col %5d %-8s "%s"' % (line, col, all_syms[tok], t[3]))
else:
print ("line %5d col %5d %-8s" % (line, col, all_syms[tok]))
 
if tok == EOI:
155

edits