static const char *bufend;
static const char *bufpos;
static strset_t stringset;
+bool allow_dollar_in_symbol = true;
/**
* Prints a parse error message at the current token.
}
#define SYMBOL_CHARS \
+ case '$': if (!allow_dollar_in_symbol) goto dollar_sign; \
case 'a': \
case 'b': \
case 'c': \
case 'X': \
case 'Y': \
case 'Z': \
- case '_': \
- case '$': // TODO add option to deactivate $ in identifers
+ case '_':
#define DIGITS \
case '0': \
break;
default:
+dollar_sign:
goto end_symbol;
}
}
return;
default:
+dollar_sign:
errorf(&lexer_token.source_position, "unknown character '%c' found", c);
next_char();
lexer_token.type = T_ERROR;
#include "token_t.h"
extern token_t lexer_token;
+extern bool allow_dollar_in_symbols;
void lexer_next_token(void);
/** use builtins for some libc functions */
bool use_builtins = false;
+/** allow dollar signs in symbols */
+extern bool allow_dollar_in_symbols;
+
/* to switch on printing of implicit casts */
extern bool print_implicit_casts;
init_types();
init_typehash();
init_basic_types();
- init_lexer();
+ init_lexer(allow_dollar_in_symbols);
init_ast();
init_parser();
init_ast2firm();