add '#caller_expression'

This commit is contained in:
Laytan Laats
2024-09-14 22:13:37 +02:00
parent 129d85fe7d
commit 603efa860a
9 changed files with 133 additions and 13 deletions
+10
View File
@@ -2277,6 +2277,16 @@ parse_operand :: proc(p: ^Parser, lhs: bool) -> ^ast.Expr {
bd.name = name.text
return bd
case "caller_expression":
bd := ast.new(ast.Basic_Directive, tok.pos, end_pos(name))
bd.tok = tok
bd.name = name.text
if peek_token_kind(p, .Open_Paren) {
return parse_call_expr(p, bd)
}
return bd
case "location", "exists", "load", "load_directory", "load_hash", "hash", "assert", "panic", "defined", "config":
bd := ast.new(ast.Basic_Directive, tok.pos, end_pos(name))
bd.tok = tok