Checks that a base term is a string constant.
(baseTerm ast.BaseTerm)
| 116 | |
| 117 | // Checks that a base term is a string constant. |
| 118 | func (c *declChecker) checkStringConstant(baseTerm ast.BaseTerm) { |
| 119 | con, ok := baseTerm.(ast.Constant) |
| 120 | if !ok { |
| 121 | c.errs = append(c.errs, fmt.Errorf("expected string constant, got %v", baseTerm)) |
| 122 | return |
| 123 | } |
| 124 | if con.Type != ast.StringType { |
| 125 | c.errs = append(c.errs, fmt.Errorf("expected string constant, got %v", c)) |
| 126 | } |
| 127 | } |