summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--README.md8
-rw-r--r--lr.18
-rw-r--r--lr.c8
3 files changed, 13 insertions, 11 deletions
diff --git a/README.md b/README.md
index 67f7d42..4ba11d3 100644
--- a/README.md
+++ b/README.md
@@ -136,7 +136,7 @@ Default: `n`.
 	<numprop>  ::= depth | dev | entries | gid | inode
 	             | links | mode | rdev | size | total | uid
 	
-	<numop>    ::= <= | < | >= | > | == | !=
+	<numop>    ::= <= | < | >= | > | == | = | !=
 
         <dur>      ::= "./path"          -- mtime of relative path
                      | "/path"           -- mtime of absolute path
@@ -159,7 +159,7 @@ Default: `n`.
 	
 	<strprop>  ::= fstype | group | name | path | target | user
 	
-	<strop>    ::= ==                -- string equality
+	<strop>    ::= == | =            -- string equality
 	             | ===               -- case insensitive string equality
 	             | ~~                -- glob (fnmatch)
 	             | ~~~               -- case insensitive glob (fnmatch)
@@ -168,9 +168,9 @@ Default: `n`.
 	
 	<str>      ::= " ([^"] | "")+ "  -- use "" for a single " inside "
 
-	<typetest> ::= type == ( b | c | d | p | f | l )
+	<typetest> ::= type ( == | = ) ( b | c | d | p | f | l )
 
-	<modetest> ::= mode ( ==         -- exact permissions
+	<modetest> ::= mode ( == | =     -- exact permissions
 	                    | &          -- check if all bits of <octal> set
 	                    | |          -- check if any bit of <octal> set
 	                    ) <octal>
diff --git a/lr.1 b/lr.1
index 2578b2d..880d69f 100644
--- a/lr.1
+++ b/lr.1
@@ -224,7 +224,7 @@ tests are given by the following EBNF:
 <numprop>  ::= depth | dev | entries | gid | inode
              | links | mode | rdev | size | total | uid
 
-<numop>    ::= <= | < | >= | > | == | !=
+<numop>    ::= <= | < | >= | > | == | = | !=
 
 <dur>      ::= "./path"          -- mtime of relative path
              | "/path"           -- mtime of absolute path
@@ -247,7 +247,7 @@ tests are given by the following EBNF:
 
 <strprop>  ::= fstype | group | name | path | target | user
 
-<strop>    ::= ==                -- string equality
+<strop>    ::= == | =            -- string equality
              | ===               -- case insensitive string equality
              | ~~                -- glob (fnmatch)
              | ~~~               -- case insensitive glob (fnmatch)
@@ -256,9 +256,9 @@ tests are given by the following EBNF:
 
 <str>      ::= " ([^"] | "")+ "  -- use "" for a single " inside "
 
-<typetest> ::= type == ( b | c | d | p | f | l )
+<typetest> ::= type ( == | = ) ( b | c | d | p | f | l )
 
-<modetest> ::= mode ( ==         -- exact permissions
+<modetest> ::= mode ( == | =     -- exact permissions
                     | &          -- check if all bits of <octal> set
                     | |          -- check if any bit of <octal> set
                     ) <octal>
diff --git a/lr.c b/lr.c
index 56f2d77..41054e0 100644
--- a/lr.c
+++ b/lr.c
@@ -287,7 +287,7 @@ parse_op()
 		return EXPR_GE;
 	else if (token(">"))
 		return EXPR_GT;
-	else if (token("=="))
+	else if (token("==") || token("="))
 		return EXPR_EQ;
 	else if (token("!="))
 		return EXPR_NEQ;
@@ -328,7 +328,7 @@ static struct expr *
 parse_type()
 {
 	if (token("type")) {
-		if (token("==")) {  // TODO !=
+		if (token("==") || token("=")) {  // TODO !=
 			struct expr *e = mkexpr(EXPR_TYPE);
 			if (token("b"))
 				e->a.filetype = TYPE_BLOCK;
@@ -494,6 +494,8 @@ parse_strcmp()
 		op = EXPR_STREQI;
 	else if (token("=="))
 		op = EXPR_STREQ;
+	else if (token("="))
+		op = EXPR_STREQ;
 	else if (token("~~~"))
 		op = EXPR_GLOBI;
 	else if (token("~~"))
@@ -542,7 +544,7 @@ parse_mode()
 
 	e->a.prop = PROP_MODE;
 
-	if (token("==")) {
+	if (token("==") || token("=")) {
 		e->op = EXPR_EQ;
 	} else if (token("&")) {
 		e->op = EXPR_ALLSET;