20260920173439
This commit is contained in:
1 parent
f4bfc1ddfc
commit
6f03d92425
174 files changed
+23490
-157
No files matched your search
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* @report/expression 公共入口(对应设计文档 §4.2、§10)。
|
||||
*
|
||||
* 表达式系统使用受限语法和 AST,不执行任意 JavaScript。
|
||||
* 本包只依赖 @report/core 的类型,不依赖 DOM 或任何求值框架。
|
||||
*/
|
||||
|
||||
// 词法
|
||||
export type { Token, TokenType, TokenizeError, TokenizeResult } from "./tokenizer.js"
|
||||
export { tokenize, KEYWORDS } from "./tokenizer.js"
|
||||
|
||||
// AST
|
||||
export type {
|
||||
ExpressionNode,
|
||||
NodeType,
|
||||
SourceSpan,
|
||||
LiteralNode,
|
||||
IdentifierNode,
|
||||
MemberNode,
|
||||
IndexNode,
|
||||
CallNode,
|
||||
UnaryNode,
|
||||
BinaryNode,
|
||||
LogicalNode,
|
||||
ConditionalNode,
|
||||
ParseError,
|
||||
ParseResult,
|
||||
} from "./ast.js"
|
||||
export {
|
||||
walkNode,
|
||||
collectRootIdentifiers,
|
||||
collectFunctionNames,
|
||||
printNode,
|
||||
} from "./ast.js"
|
||||
|
||||
// 语法
|
||||
export { parse, isValidExpression, allowedFunctionNames } from "./parser.js"
|
||||
|
||||
// 作用域
|
||||
export type { EvalScope, ScopeRoot } from "./scope.js"
|
||||
export { SCOPE_ROOTS, resolveRoot, safeGet } from "./scope.js"
|
||||
|
||||
// 内置函数
|
||||
export type { BuiltinFunction } from "./builtins.js"
|
||||
export { BUILTINS, isBuiltinFunction, builtinFunctionNames } from "./builtins.js"
|
||||
|
||||
// 求值
|
||||
export type {
|
||||
EvalOptions,
|
||||
EvalResult,
|
||||
CompiledExpression,
|
||||
} from "./evaluator.js"
|
||||
export {
|
||||
evaluateAst,
|
||||
evaluateExpression,
|
||||
evaluateCompiled,
|
||||
evaluateValue,
|
||||
compile,
|
||||
} from "./evaluator.js"
|
||||
|
||||
// 绑定
|
||||
export type {
|
||||
ResolveBindingOptions,
|
||||
ResolveBindingResult,
|
||||
} from "./binding.js"
|
||||
export {
|
||||
ExpressionCache,
|
||||
resolveBinding,
|
||||
formatValue,
|
||||
fieldToExpression,
|
||||
isBindingEmpty,
|
||||
} from "./binding.js"
|
||||
Reference in new issue
Block a user