WIP - try to fix travis build
This commit is contained in:
parent
2ab9caa87c
commit
6a0a28f4b3
10 changed files with 32 additions and 23 deletions
|
|
@ -23,9 +23,8 @@ namespace tree_sitter {
|
|||
}
|
||||
case ParseActionTypeAccept:
|
||||
return "accept";
|
||||
case ParseActionTypeError:
|
||||
default:
|
||||
return "error";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -142,6 +142,8 @@ namespace tree_sitter {
|
|||
return "ACCEPT_TOKEN(" + symbol_id(action.symbol) + ");";
|
||||
case LexActionTypeError:
|
||||
return "LEX_ERROR();";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,10 @@ namespace tree_sitter {
|
|||
using rules::Symbol;
|
||||
using rules::CharacterSet;
|
||||
|
||||
LexAction::LexAction() : LexAction(LexActionTypeError, -1, Symbol("")) {}
|
||||
LexAction::LexAction() :
|
||||
type(LexActionTypeError),
|
||||
symbol(Symbol("")),
|
||||
state_index(-1) {}
|
||||
|
||||
LexAction::LexAction(LexActionType type, size_t state_index, Symbol symbol) :
|
||||
type(type),
|
||||
|
|
@ -42,6 +45,8 @@ namespace tree_sitter {
|
|||
return stream << string("#<accept ") + action.symbol.name + ">";
|
||||
case LexActionTypeAdvance:
|
||||
return stream << string("#<advance ") + to_string(action.state_index) + ">";
|
||||
default:
|
||||
return stream;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@ namespace tree_sitter {
|
|||
state_index(state_index),
|
||||
consumed_symbol_count(consumed_symbol_count) {}
|
||||
|
||||
ParseAction::ParseAction() : ParseAction(ParseActionTypeError, -1, Symbol(""), {}) {}
|
||||
ParseAction::ParseAction() :
|
||||
type(ParseActionTypeError),
|
||||
symbol(Symbol("")),
|
||||
state_index(-1),
|
||||
consumed_symbol_count(0) {}
|
||||
|
||||
ParseAction ParseAction::Error() {
|
||||
return ParseAction(ParseActionTypeError, -1, Symbol(""), {});
|
||||
|
|
@ -53,6 +57,8 @@ namespace tree_sitter {
|
|||
return stream << (string("#<shift ") + to_string(action.state_index) + ">");
|
||||
case ParseActionTypeReduce:
|
||||
return stream << (string("#<reduce ") + action.symbol.name + ">");
|
||||
default:
|
||||
return stream;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ namespace tree_sitter {
|
|||
return string("#<aux_sym '") + name + "'>";
|
||||
case SymbolTypeBuiltIn:
|
||||
return string("#<builtin_sym '") + name + "'>";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue