X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=lexer.c;h=7cd7794bfaed056ffa72519a0bf0a39bfe0f843e;hp=862131e1162ecb764acdd3ae7e72d569b65f0e95;hb=004832f6ec167eedf346886942466a014dfe873b;hpb=9f2b9e1b46c583d12796df8741bd9b448397b8cb diff --git a/lexer.c b/lexer.c index 862131e..7cd7794 100644 --- a/lexer.c +++ b/lexer.c @@ -20,14 +20,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include -#include +#include #include -#include +#include #include "gmqcc.h" #include "lexer.h" - /* * List of Keywords */ @@ -174,7 +172,7 @@ static void lex_token_new(lex_file *lex) #else if (lex->tok.value) vec_shrinkto(lex->tok.value, 0); - + lex->tok.constval.t = 0; lex->tok.ctx.line = lex->sline; lex->tok.ctx.file = lex->name; @@ -300,7 +298,7 @@ static int lex_try_trigraph(lex_file *lex, int old) lex->line++; lex->column = 0; } - + if (c2 != '?') { lex_ungetch(lex, c2); return old; @@ -311,7 +309,7 @@ static int lex_try_trigraph(lex_file *lex, int old) lex->line++; lex->column = 0; } - + switch (c3) { case '=': return '#'; case '/': return '\\'; @@ -1311,7 +1309,7 @@ int lex_do(lex_file *lex) ch == '>' || ch == '<' || /* <<, >>, <=, >= */ ch == '=' || ch == '!' || /* <=>, ==, != */ ch == '&' || ch == '|' || /* &&, ||, &=, |= */ - ch == '~' /* ~=, ~ */ + ch == '~' || ch == '^' /* ~=, ~, ^ */ ) { lex_tokench(lex, ch);