{"version":3,"file":"ast.cjs","sources":["../../../src/fql/ast.ts"],"sourcesContent":["/**\n * FQL Abstract Syntax Tree (AST) Node Types\n */\n\nexport type FQLNode = TermNode | PhraseNode | AndNode | OrNode | NotNode | FilterNode | FieldNode | ScoreNode | LangNode;\n\n/**\n * Simple term node\n */\nexport interface TermNode {\n  type: \"term\";\n  value: string;\n}\n\n/**\n * Quoted phrase node\n */\nexport interface PhraseNode {\n  type: \"phrase\";\n  value: string;\n}\n\n/**\n * AND operator node (intersection)\n */\nexport interface AndNode {\n  type: \"and\";\n  left: FQLNode;\n  right: FQLNode;\n}\n\n/**\n * OR operator node (union)\n */\nexport interface OrNode {\n  type: \"or\";\n  left: FQLNode;\n  right: FQLNode;\n}\n\n/**\n * NOT operator node (exclusion)\n */\nexport interface NotNode {\n  type: \"not\";\n  child: FQLNode;\n}\n\n/**\n * Match type filter node\n */\nexport interface FilterNode {\n  type: \"filter\";\n  filterType: \"exact\" | \"fuzzy\" | \"phonetic\" | \"prefix\" | \"regex\" | \"compound\";\n  value: string;\n}\n\n/**\n * Field selector node\n */\nexport interface FieldNode {\n  type: \"field\";\n  field: string;\n  child: FQLNode;\n}\n\n/**\n * Score filter node\n */\nexport interface ScoreNode {\n  type: \"score\";\n  operator: \">\" | \"<\" | \">=\" | \"<=\";\n  threshold: number;\n  child: FQLNode;\n}\n\n/**\n * Language filter node\n */\nexport interface LangNode {\n  type: \"lang\";\n  language: string;\n  child: FQLNode;\n}\n\n/**\n * Helper to check node type\n */\nexport function isTermNode(node: FQLNode): node is TermNode {\n  return node.type === \"term\";\n}\n\nexport function isPhraseNode(node: FQLNode): node is PhraseNode {\n  return node.type === \"phrase\";\n}\n\nexport function isAndNode(node: FQLNode): node is AndNode {\n  return node.type === \"and\";\n}\n\nexport function isOrNode(node: FQLNode): node is OrNode {\n  return node.type === \"or\";\n}\n\nexport function isNotNode(node: FQLNode): node is NotNode {\n  return node.type === \"not\";\n}\n\nexport function isFilterNode(node: FQLNode): node is FilterNode {\n  return node.type === \"filter\";\n}\n\nexport function isFieldNode(node: FQLNode): node is FieldNode {\n  return node.type === \"field\";\n}\n\nexport function isScoreNode(node: FQLNode): node is ScoreNode {\n  return node.type === \"score\";\n}\n\nexport function isLangNode(node: FQLNode): node is LangNode {\n  return node.type === \"lang\";\n}\n"],"names":[],"mappings":";;AAwFO,SAAS,WAAW,MAAiC;AAC1D,SAAO,KAAK,SAAS;AACvB;AAEO,SAAS,aAAa,MAAmC;AAC9D,SAAO,KAAK,SAAS;AACvB;AAEO,SAAS,UAAU,MAAgC;AACxD,SAAO,KAAK,SAAS;AACvB;AAEO,SAAS,SAAS,MAA+B;AACtD,SAAO,KAAK,SAAS;AACvB;AAEO,SAAS,UAAU,MAAgC;AACxD,SAAO,KAAK,SAAS;AACvB;AAEO,SAAS,aAAa,MAAmC;AAC9D,SAAO,KAAK,SAAS;AACvB;AAEO,SAAS,YAAY,MAAkC;AAC5D,SAAO,KAAK,SAAS;AACvB;AAEO,SAAS,YAAY,MAAkC;AAC5D,SAAO,KAAK,SAAS;AACvB;AAEO,SAAS,WAAW,MAAiC;AAC1D,SAAO,KAAK,SAAS;AACvB;;;;;;;;;;"}