(it *lex.ItemIterator, val string)
| 3077 | ) |
| 3078 | |
| 3079 | func validateEmptyBlockItem(it *lex.ItemIterator, val string) error { |
| 3080 | savePos := it.Save() |
| 3081 | defer func() { |
| 3082 | it.Restore(savePos) |
| 3083 | }() |
| 3084 | |
| 3085 | fname := val |
| 3086 | // Could have alias so peek forward to get actual function name. |
| 3087 | skipped := trySkipItemTyp(it, itemColon) |
| 3088 | if skipped { |
| 3089 | item, ok := tryParseItemType(it, itemName) |
| 3090 | if !ok { |
| 3091 | return item.Errorf("Expected name. Got: %s", item.Val) |
| 3092 | } |
| 3093 | fname = item.Val |
| 3094 | } |
| 3095 | ok := trySkipItemTyp(it, itemLeftRound) |
| 3096 | if !ok || (!isMathBlock(fname) && !isAggregator(fname)) { |
| 3097 | return it.Errorf("Only aggregation/math functions allowed inside empty blocks."+ |
| 3098 | " Got: %v", fname) |
| 3099 | } |
| 3100 | return nil |
| 3101 | } |
| 3102 | |
| 3103 | // godeep constructs the subgraph from the lexed items and a GraphQuery node. |
| 3104 | func godeep(it *lex.ItemIterator, gq *GraphQuery) error { |
no test coverage detected