MCPcopy Index your code
hub / github.com/expr-lang/expr / parseVariableDeclaration

Method parseVariableDeclaration

parser/parser.go:323–336  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

321}
322
323func (p *Parser) parseVariableDeclaration() Node {
324 p.expect(Operator, "let")
325 variableName := p.current
326 p.expect(Identifier)
327 p.expect(Operator, "=")
328 value := p.parseExpression(0)
329 p.expect(Operator, ";")
330 node := p.parseSequenceExpression()
331 return p.createNode(&VariableDeclaratorNode{
332 Name: variableName.Value,
333 Value: value,
334 Expr: node,
335 }, variableName.Location)
336}
337
338func (p *Parser) parseConditionalIf() Node {
339 p.next()

Callers 1

parseExpressionMethod · 0.95

Calls 4

expectMethod · 0.95
parseExpressionMethod · 0.95
createNodeMethod · 0.95

Tested by

no test coverage detected