(tableRegister, a, h, pending int, e exprDesc)
| 58 | } |
| 59 | |
| 60 | func (p *parser) field(tableRegister, a, h, pending int, e exprDesc) (int, int, int, exprDesc) { |
| 61 | freeRegisterCount := p.function.freeRegisterCount |
| 62 | hashField := func(k exprDesc) { |
| 63 | h++ |
| 64 | p.checkNext('=') |
| 65 | p.function.FlushFieldToConstructor(tableRegister, freeRegisterCount, k, p.expression) |
| 66 | } |
| 67 | switch { |
| 68 | case p.t == tkName && p.lookAhead() == '=': |
| 69 | p.checkLimit(h, maxInt, "items in a constructor") |
| 70 | hashField(p.checkNameAsExpression()) |
| 71 | case p.t == '[': |
| 72 | hashField(p.index()) |
| 73 | default: |
| 74 | e = p.expression() |
| 75 | p.checkLimit(a, maxInt, "items in a constructor") |
| 76 | a++ |
| 77 | pending++ |
| 78 | } |
| 79 | return a, h, pending, e |
| 80 | } |
| 81 | |
| 82 | func (p *parser) constructor() exprDesc { |
| 83 | pc, t := p.function.OpenConstructor() |
no test coverage detected