tree-sitter/spec_helper.h
2013-11-06 08:18:40 -08:00

22 lines
576 B
C++

#ifndef TreeSitter_SpecHelper_h
#define TreeSitter_SpecHelper_h
#include "igloo/igloo_alt.h"
#include "transition_map.h"
#include "rules.h"
namespace snowhouse {
template<>
std::string Stringize(const tree_sitter::TransitionMap<tree_sitter::rules::Rule> &map) {
std::string result("[");
bool started = false;
for (auto pair : map) {
if (started) result += ", ";
result += (pair.first->to_string() + " => " + pair.second->to_string());
started = true;
}
return result + "]";
}
}
#endif