jinja : support dot property integer literals (#28817)

This commit is contained in:
Sigbjørn Skjæret
2026-09-12 22:49:53 +02:00
committed by GitHub
parent 737e0980fe
commit ae9afff8d2
2 changed files with 18 additions and 0 deletions
+6
View File
@@ -842,6 +842,12 @@ value member_expression::execute_impl(context & ctx) {
} else {
property = this->property->execute(ctx);
}
} else if (is_stmt<integer_literal>(this->property)) {
// syntax: obj.index
property = mk_val<value_int>(cast_stmt<integer_literal>(this->property)->val);
if (property->as_int() < 0) {
throw std::runtime_error("Static member property cannot be negative");
}
} else {
// syntax: obj.prop
if (!is_stmt<identifier>(this->property)) {