Name can have dashes or alphanumeric characters. Lexer lexes them as separate items. We put it back together here.
(it *lex.ItemIterator, val string)
| 3520 | // Name can have dashes or alphanumeric characters. Lexer lexes them as separate items. |
| 3521 | // We put it back together here. |
| 3522 | func collectName(it *lex.ItemIterator, val string) string { |
| 3523 | var dashOrName bool // false if expecting dash, true if expecting name |
| 3524 | for { |
| 3525 | items, err := it.Peek(1) |
| 3526 | if err == nil && ((items[0].Typ == itemName && dashOrName) || |
| 3527 | (items[0].Val == "-" && !dashOrName)) { |
| 3528 | it.Next() |
| 3529 | val += it.Item().Val |
| 3530 | dashOrName = !dashOrName |
| 3531 | } else { |
| 3532 | break |
| 3533 | } |
| 3534 | } |
| 3535 | return val |
| 3536 | } |
| 3537 | |
| 3538 | // Steps the parser. |
| 3539 | func tryParseItemType(it *lex.ItemIterator, typ lex.ItemType) (lex.Item, bool) { |
no test coverage detected