unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 788f0075826a35a082481d42031bb78f4bccd0fe 3148 bytes (raw)
name: test/qparser.expected-output/operators 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
 
# Boolean operators

x and y
[lex]    "x" AND "y"
[parse]  (AND "x" "y")
[gen]    (x:(pos=1) AND y:(pos=2))

x or y
[lex]    "x" OR "y"
[parse]  (OR "x" "y")
[gen]    (x:(pos=1) OR y:(pos=2))

x xor y
[lex]    "x" XOR "y"
[parse]  (XOR "x" "y")
[gen]    (x:(pos=1) XOR y:(pos=2))

x and y or x and w
[lex]    "x" AND "y" OR "x" AND "w"
[parse]  (OR (AND "x" "y") (AND "x" "w"))
[gen]    ((x:(pos=1) AND y:(pos=2)) OR (x:(pos=3) AND w:(pos=4)))

x and -y
[lex]    "x" AND HATE "y"
[parse]  (AND "x" (NOT "y"))
[gen]    (x:(pos=1) AND_NOT y:(pos=2))

x or not y
[lex]    "x" OR NOT "y"
[parse]  (OR "x" (NOT "y"))
[gen]    (x:(pos=1) OR (<alldocuments> AND_NOT y:(pos=2)))

# The following three are Xapian-incompatible because they're syntax errors.
x and
[lex]    "x" AND
[parse]  "x"
[gen]    x:(pos=1)
[xapian] error Syntax: <expression> AND <expression>

and x
[lex]    AND "x"
[parse]  "x"
[gen]    x:(pos=1)
[xapian] error Syntax: <expression> AND <expression>

and
[lex]    AND
[parse]  <nil>
[gen]    <alldocuments>
[xapian] error Syntax: <expression> AND <expression>

# Unary NOT

x not y
[lex]    "x" NOT "y"
[parse]  (AND "x" (NOT "y"))
[gen]    (x:(pos=1) AND_NOT y:(pos=2))

x not y or z
[lex]    "x" NOT "y" OR "z"
[parse]  (OR (AND "x" (NOT "y")) "z")
[gen]    ((x:(pos=1) AND_NOT y:(pos=2)) OR z:(pos=3))

x not y and z
[lex]    "x" NOT "y" AND "z"
[parse]  (AND (AND "x" (NOT "y")) "z")
[gen]    ((x:(pos=1) AND_NOT y:(pos=2)) AND z:(pos=3))

not not x
[lex]    NOT NOT "x"
[parse]  (NOT (NOT "x"))
[gen]    (<alldocuments> AND_NOT (<alldocuments> AND_NOT x:(pos=1)))
[xapian] error Syntax: <expression> NOT <expression>

# Empty subexpressions
# These are all Xapian-incompatible because they're syntax errors.

x and ()
[lex]    "x" AND BRA KET
[parse]  "x"
[gen]    x:(pos=1)
[xapian] error Syntax: <expression> AND <expression>

() and x
[lex]    BRA KET AND "x"
[parse]  "x"
[gen]    x:(pos=1)
[xapian] error Syntax: <expression> AND <expression>

# NULL phrases
# These are all Xapian-incompatible because they're syntax errors.

and
[lex]    AND
[parse]  <nil>
[gen]    <alldocuments>
[xapian] error Syntax: <expression> AND <expression>

@
[lex]    "@"
[parse]  "@"
[gen]    <alldocuments>
[xapian] 

@ AND x
[lex]    "@" AND "x"
[parse]  (AND "@" "x")
[gen]    x:(pos=1)
[xapian] error Syntax: <expression> AND <expression>

x AND @
[lex]    "x" AND "@"
[parse]  (AND "x" "@")
[gen]    x:(pos=1)
[xapian] error Syntax: <expression> AND <expression>

@ AND NOT x
[lex]    "@" AND NOT "x"
[parse]  (AND "@" (NOT "x"))
[gen]    (<alldocuments> AND_NOT x:(pos=1))
[xapian] error Syntax: <expression> AND NOT <expression>

x AND NOT @
[lex]    "x" AND NOT "@"
[parse]  (AND "x" (NOT "@"))
[gen]    x:(pos=1)
[xapian] error Syntax: <expression> AND NOT <expression>

NOT @
[lex]    NOT "@"
[parse]  (NOT "@")
[gen]    <alldocuments>
[xapian] error Syntax: <expression> NOT <expression>

@ OR x
[lex]    "@" OR "x"
[parse]  (OR "@" "x")
[gen]    x:(pos=1)
[xapian] error Syntax: <expression> OR <expression>

x OR @
[lex]    "x" OR "@"
[parse]  (OR "x" "@")
[gen]    x:(pos=1)
[xapian] error Syntax: <expression> OR <expression>

debug log:

solving 788f007 ...
found 788f007 in https://yhetil.org/notmuch/20110121063714.GI13226@mit.edu/

applying [1/1] https://yhetil.org/notmuch/20110121063714.GI13226@mit.edu/
diff --git a/test/qparser.expected-output/operators b/test/qparser.expected-output/operators
new file mode 100644
index 0000000..788f007

1:109: trailing whitespace.
[xapian] 
Checking patch test/qparser.expected-output/operators...
Applied patch test/qparser.expected-output/operators cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 788f0075826a35a082481d42031bb78f4bccd0fe	test/qparser.expected-output/operators

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).