Move some general code generation helpers into their own file
This commit is contained in:
parent
63718d5bad
commit
7251456cd2
4 changed files with 69 additions and 38 deletions
19
src/compiler/generate_code/helpers.h
Normal file
19
src/compiler/generate_code/helpers.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __tree_sitter__helpers__
|
||||
#define __tree_sitter__helpers__
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace tree_sitter {
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
namespace generate_code {
|
||||
string indent(string input);
|
||||
string join(vector<string> lines, string separator);
|
||||
string join(vector<string> lines);
|
||||
string escape_string(string input);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue