Trim whitespace

This commit is contained in:
Max Brunsfeld 2014-04-25 22:17:23 -07:00
parent 801f4bd0a8
commit 93df5579b4
15 changed files with 78 additions and 78 deletions

View file

@ -83,11 +83,11 @@ namespace tree_sitter {
}
private:
const PreparedGrammar & grammar_for_symbol(const rules::ISymbol &symbol) {
return symbol.is_token() ? lexical_grammar : syntax_grammar;
}
string symbol_id(const rules::ISymbol &symbol) {
if (symbol.is_built_in()) {
return (symbol == rules::ERROR()) ?
@ -101,7 +101,7 @@ namespace tree_sitter {
return "ts_sym_" + name;
}
}
string symbol_name(const rules::ISymbol &symbol) {
if (symbol.is_built_in()) {
return (symbol == rules::ERROR()) ? "error" : "end";

View file

@ -8,7 +8,7 @@
namespace tree_sitter {
class PreparedGrammar;
namespace generate_code {
std::string c_code(std::string name,
const ParseTable &parse_table,

View file

@ -6,18 +6,18 @@
namespace tree_sitter {
using std::string;
namespace generate_code {
class TokenDescription : public rules::RuleFn<string> {
string apply_to(const rules::Pattern *rule) {
return "/" + rule->value + "/";
}
string apply_to(const rules::String *rule) {
return "'" + rule->value + "'";
}
};
std::string token_description(const rules::rule_ptr &rule) {
return TokenDescription().apply(rule);
}