customDefinition returns a StatementGenerator for a custom variable definition. The variable definition should follow the same layout format as synopses.
(str string)
| 128 | // customDefinition returns a StatementGenerator for a custom variable definition. The variable definition should follow |
| 129 | // the same layout format as synopses. |
| 130 | func customDefinition(str string) utils.StatementGenerator { |
| 131 | str = strings.TrimSpace(str) |
| 132 | scanner := NewScanner(str) |
| 133 | tokens, err := scanner.Process() |
| 134 | if err != nil { |
| 135 | panic(err) |
| 136 | } |
| 137 | stmtGen, err := utils.ParseTokens(tokens, true) |
| 138 | if err != nil { |
| 139 | panic(err) |
| 140 | } |
| 141 | if stmtGen == nil { |
| 142 | panic("definition did not create a statement generator") |
| 143 | } |
| 144 | return stmtGen |
| 145 | } |
no test coverage detected