#define VECTOR_MAKE(T,N) \
VECTOR_TYPE(T,N); \
VECTOR_CORE(T,N)
-/* Builds a vector add function pointer for inside structures */
-#define VECTOR_IMPL(T,N) int (*N##_add)(T)
//===================================================================
//=========================== code.c ================================
static int lex_getch(lex_file *file) {
int ch = lex_inget(file);
-
- static int str = 0;
- switch (ch) {
- case '?' :
- return lex_trigraph(file);
- case '<' :
- case ':' :
- case '%' :
- case '"' : str = !str; if (str) { file->line ++; }
- return lex_digraph(file, ch);
-
- case '\n':
- if (!str)
- file->line++;
- }
-
+ if (ch == '?')
+ return lex_trigraph(file);
+ if (ch == '<' || ch == ':' || ch == '%')
+ return lex_digraph(file, ch);
return ch;
}
if (ch > 0 && (ch == '_' || isalpha(ch))) {
lex_clear(file);
- /*
- * Yes this is dirty, but there is no other _sane_ easy
- * way to do it, this is what I call defensive programming
- * if something breaks, add more defense :-)
- */
- while (ch > 0 && ch != ' ' && ch != '(' &&
- ch != '\n' && ch != ';' && ch != ')') {
+ while (ch > 0 && (ch == '_' || isalpha(ch))) {
lex_addch(ch, file);
ch = lex_getsource(file);
}