#-*- Mode: Shell-Script; coding: utf-8; -*-
#
# File: t/parseme.dat
# Description: query-parsing test data
# Format:
#  + comment lines begin with "#"
#  + data lines are TAB-separated with 2 or 3 fields: QUERY1 "\t" QUERY2 ("\t" COMMENT)?
#  + QUERY1->toJson() should be identical to QUERY2->toJson()
#  + by convention, QUERY1 are "naive" or "bareword" queries, and QUERY2 are explicitly constructed and/or quoted

#-- basic
foo	'foo'
etc.	'etc.'
etc.	etc\.

##-- match-ids
foo=1	'foo' =1
$l=foo=1	$l='foo' =1

##-- mantis #17708: implicit conjunction regexes
/foo/ /bar/	((/foo/) (/bar/))

#-- mantis #14812: numeric prefixes
19*	'19'*

#-- mantis #19051: hyphenated symbols
80er	'80er'
6-er	'6-er'
1-2-3	'1-2-3'
2+4-Vertrag	'2+4-Vertrag'

#-- mantis #19051: count-by
count(x) #by[$w=1+1]	count(x) #by[$w =1 +1]
count(x) #by[$w=1-1]	count(x) #by[$w =1 -1]
count(x) #by[$w+1]	count(x) #by[$w +1]
count(x) #by[$w-1]	count(x) #by[$w -1]

#-- lexer block-comments
 #[comment] foo && bar=2	foo && bar=2
 foo #[comment] && bar=2	foo && bar=2
 foo && #[comment] bar=2	foo && bar=2
 foo && bar #[comment]=2	foo && bar=2
 foo && bar=2 #[comment]	foo && bar=2

#-- lexer line-comments
foo #:comment	foo
foo #:comment bar	foo
foo #:comment\nbar	foo bar
#:comment\nfoo	foo

#-- parsed comments
 foo #cmt bar	foo #cmt 'bar'
 foo #cmt[bar]	foo #cmt 'bar'
##NO #cmt bar foo	foo #cmt 'bar'
 count(x) #cmt bar #by[y]	count(x) #by[y] #cmt 'bar'
 count(x #cmt bar) #by[y]	count(x) #by[y] #cmt 'bar'

##-- subcorpora (v2.2.0)
 x :	x
 x :foo,bar	x :'foo','bar'
# x :foo:bar	x :'foo','bar' #: <= ddc-v2.2.7
 x :foo:bar	x :'bar' #: >= ddc-v2.2.8
 x :foo/bar,baz	x :'foo/bar','baz'
 x :*/foo,bar/*	x :'*/foo','bar/*'
 x :	x
 x :*	x :'*'
 x :**/foo,**/bar	x :'**/foo','**/bar' #: >= ddc-v2.2.8
 x :foo #: uhoh :bar	x :'foo' #: >= ddc-v2.2.8

##-- negative dates (v2.2.4)
Plato #has_date[-427]	Plato #has_date['-427']
Plato #asc_date[-427,-347]	Plato #asc_date['-427','-347']
Plato #asc_date[-0427-01-01,-0347-12-31]	Plato #asc_date['-0427-01-01','-0347-12-31']

# bareword dates need at least 4 digits of year
#Plato #asc_date[-427-01-01,-347-12-31] #: -> parse error

1066	'1066'
-424	'-424'

##-- prune filters (v2.2.8)
Haus #prune[42,author]	'Haus' #prune_asc[42,'author'] #: don't segfault on toHash