MCPcopy Create free account
hub / github.com/apitable/apitable / next

Method next

packages/core/src/formula_parser/parser/parser.ts:71–89  ·  view source on GitHub ↗
(type: TokenType)

Source from the content-addressed store, hash-verified

69 }
70
71 private next(type: TokenType): Token | null {
72 if (this.currentToken == null) {
73 return null;
74 }
75 if (this.currentToken.type === type) {
76 this.currentToken = this.lexer.getNextToken();
77 } else {
78 switch (type) {
79 case TokenType.LeftParen:
80 throw new SyntaxError(t(Strings.function_err_no_left_bracket));
81 case TokenType.RightParen:
82 throw new SyntaxError(t(Strings.function_err_end_of_right_bracket));
83 }
84 throw new SyntaxError(t(Strings.function_err_unable_parse_char, {
85 value: this.currentToken.value,
86 }));
87 }
88 return this.currentToken;
89 }
90
91 private factor(): AstNode {
92 // factor : VALUE | LEFT_PAREN expr RIGHT_PAREN | NOT expr

Callers 2

factorMethod · 0.95
exprMethod · 0.95

Calls 2

tFunction · 0.90
getNextTokenMethod · 0.65

Tested by

no test coverage detected