Commit Graph
5 Commits
Author SHA1 Message Date
doyaGu 23f7806e2d fix(search): cap an expression at 256 atoms
The compiled SQL chains every atom into one expression, and SQLite rejects
expressions deeper than 1000 levels. A query of about 1000 words parsed but
then failed in SQL, outside the syntax-error handling, and crashed the app.
The parser now rejects more than 256 atoms as a syntax error.
2026-10-03 08:49:57 -04:00
doyaGu 1d744ba504 fix(search): reject empty phrases and phrases glued to other text
The lexer now keeps token offsets and rejects what the grammar never allowed
but the token rules accepted:
- an empty phrase: "" (matched every card), tag:""
- a phrase touching a word or another phrase: a"b", "a"b, "a""b"
- whitespace between a qualifier and its phrase value: tag: "x"

key:"value" stays the only legal contact; parentheses still delimit phrases.
Listed in PLAN 6.1/6.2 and USAGE.
2026-10-03 08:20:30 -04:00
doyaGu d2a5d36bd2 fix(search): reject parentheses nested deeper than 64 levels
Deep nesting overflowed the stack of the recursive Pidgin parser (around
400-700 levels), an uncatchable crash. The depth is now checked on the token
stream before parsing and reported as a syntax error. Listed in PLAN 6.2 and
USAGE.
2026-10-03 08:12:34 -04:00
doyaGu 27b507e439 feat: tighten search grammar and use unicode case folding 2026-10-03 02:50:52 -04:00
yyc12345 22a0f61cb5 feat: add search parser, sql compiler and markdown export 2026-10-02 22:32:33 +08:00