summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-03-31 13:55:56 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-03-31 13:55:56 +0200
commitdc61ee28d9d4eb044ebada35c248542fb1191102 (patch)
treeca0b889c37b8960bf8661c490e488d295fa97851
parentd54ba0d8cdc5bca846e547eaf01aa94f73202b67 (diff)
downloadlr-dc61ee28d9d4eb044ebada35c248542fb1191102.tar.gz
lr-dc61ee28d9d4eb044ebada35c248542fb1191102.tar.xz
lr-dc61ee28d9d4eb044ebada35c248542fb1191102.zip
parse_strcmp: rearrange to check for token =~ before =
-rw-r--r--lr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lr.c b/lr.c
index 845ca60..15f7a9c 100644
--- a/lr.c
+++ b/lr.c
@@ -594,13 +594,7 @@ parse_strcmp()
 	else
 		return parse_type();
 
-	if (token("==="))
-		op = EXPR_STREQI;
-	else if (token("=="))
-		op = EXPR_STREQ;
-	else if (token("="))
-		op = EXPR_STREQ;
-	else if (token("~~~"))
+	if (token("~~~"))
 		op = EXPR_GLOBI;
 	else if (token("~~"))
 		op = EXPR_GLOB;
@@ -608,6 +602,12 @@ parse_strcmp()
 		op = EXPR_REGEXI;
 	else if (token("=~"))
 		op = EXPR_REGEX;
+	else if (token("==="))
+		op = EXPR_STREQI;
+	else if (token("=="))
+		op = EXPR_STREQ;
+	else if (token("="))
+		op = EXPR_STREQ;
 	else
 		parse_error("invalid string operator at '%.15s'", pos);