X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=lexer.c;h=5ad0a90a537f558e2ba0512e79a771f8181426a6;hp=d153459ebc8fe87318e05dcddbf35306b84edd97;hb=a934e0fe4b4fd4b79350eb8c7f39b83f86514d3a;hpb=2024b3bd7179b3b5a3033c9f485e9fa88e3086dc diff --git a/lexer.c b/lexer.c index d153459..5ad0a90 100644 --- a/lexer.c +++ b/lexer.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012, 2013 + * Copyright (C) 2012, 2013, 2014 * Wolfgang Bumiller * * Permission is hereby granted, free of charge, to any person obtaining a copy of @@ -1233,12 +1233,16 @@ int lex_do(lex_file *lex) ch == '~' || ch == '^' /* ~=, ~, ^ */ ) { lex_tokench(lex, ch); - nextch = lex_getch(lex); - if ((nextch == '=' && ch != '<') || - (nextch == ch && ch != '!') || - (nextch == '<' && ch == '>')) { + + if ((nextch == '=' && ch != '<') || (nextch == '<' && ch == '>')) + lex_tokench(lex, nextch); + else if (nextch == ch && ch != '!') { lex_tokench(lex, nextch); + if ((thirdch = lex_getch(lex)) == '=') + lex_tokench(lex, thirdch); + else + lex_ungetch(lex, thirdch); } else if (ch == '<' && nextch == '=') { lex_tokench(lex, nextch); if ((thirdch = lex_getch(lex)) == '>')