(pos Pos, allowMultiValues bool)
| 1101 | } |
| 1102 | |
| 1103 | func (p *Parser) tryParseTTLClause(pos Pos, allowMultiValues bool) (*TTLClause, error) { |
| 1104 | if !p.tryConsumeKeywords(KeywordTtl) { |
| 1105 | return nil, nil // nolint |
| 1106 | } |
| 1107 | ttlExprList := &TTLClause{TTLPos: pos, ListEnd: pos} |
| 1108 | // accept the TTL keyword |
| 1109 | items, err := p.parseTTLClause(pos, allowMultiValues) |
| 1110 | if err != nil { |
| 1111 | return nil, err |
| 1112 | } |
| 1113 | if len(items) > 0 { |
| 1114 | ttlExprList.ListEnd = items[len(items)-1].End() |
| 1115 | } |
| 1116 | ttlExprList.Items = items |
| 1117 | return ttlExprList, nil |
| 1118 | } |
| 1119 | |
| 1120 | // parseTTLClause parses the TTL clause. |
| 1121 | // allowMultiValues is used to determine whether to allow multiple TTL values. |
no test coverage detected