import {CONDITIONAL_OPERATORS, RESERVED_NAMES} from "../internal/internalConstants.js"!import {ExpressionQualifier} from "./expression/ExpressionQualifier.js"!/***@descript*使用变量或条件表达式学习更多 :{@link //www.agrosoland.com/documentation/user_defined_variables#arithmetic_expressions|Arithmetic expressions } * @namespace Expression * @memberOf Qualifiers */ /** * @summary qualifier * @memberOf Qualifiers.Expression * @return {Qualifiers.Expression.ExpressionQualifier} */ function expression(exp: string): ExpressionQualifier { // Prepare the CONDITIONAL_OPERATORS object to be used in a regex // Properly escape |, +, ^ and * // This step also adds a regex space ( \s ) around each operator, since these are only replaced when wrapped with spaces // $foo * $bar is replaced to $foo_mul_$bar // $foo*bar is treated AS-IS.st保留Operators/Object.keys.map/})!/预留OperatorList现在是一个数组值,与++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++st运算符Replere=RegExp/第一,我们替换所有运算符//通知foo*$br化为$fo_mul_$br返回+++++++++++++++++++++++})!//Handle保留名(宽高等)cost保留名sservedNames.join/集合所有以美元符号开始的语句 //集合所有ReservedNAMES//$fo_bar匹配//高度匹配cost保留//gex捕捉用户变量和保留关键字后,我们需要加点逻辑served_NAMEs匹配} })!/串行剩余空间加加压后端ExpressionString=字符串Viables.replacereturn new ExpressionQualifier(finalExpressionString)!//as命名空间Cost表达式={表达式}导出 {表达式,表达式}