| 31 | } |
| 32 | |
| 33 | static std::string get_line_col(const std::string & source, size_t pos) { |
| 34 | size_t line = 1; |
| 35 | size_t col = 1; |
| 36 | for (size_t i = 0; i < pos && i < source.size(); i++) { |
| 37 | if (source[i] == '\n') { |
| 38 | line++; |
| 39 | col = 1; |
| 40 | } else { |
| 41 | col++; |
| 42 | } |
| 43 | } |
| 44 | return "line " + std::to_string(line) + ", column " + std::to_string(col); |
| 45 | } |
| 46 | |
| 47 | static void ensure_key_type_allowed(const value & val) { |
| 48 | if (!val->is_hashable()) { |