tree-sitter/spec/helpers/rule_helpers.h
Max Brunsfeld 686dc0997c Avoid introducing certain lexical conflicts during parse state merging
The current pretty conservative approach is to avoid merging parse states which
would cause a pair tokens to co-exist for the first time in any parse state,
where the two tokens can start with the same character and at least one of the
tokens can contain a character which is part of the grammar's separators.
2017-02-27 22:54:38 -08:00

25 lines
777 B
C++

#ifndef HELPERS_RULE_HELPERS_H_
#define HELPERS_RULE_HELPERS_H_
#include "tree_sitter/compiler.h"
#include "compiler/rules.h"
#include "compiler/rules/character_set.h"
#include "compiler/rules/metadata.h"
#include "compiler/variable.h"
namespace tree_sitter {
rule_ptr metadata(rule_ptr, rules::MetadataParams params);
rule_ptr character(const std::set<uint32_t> &);
rule_ptr character(const std::set<uint32_t> &, bool sign);
rule_ptr i_sym(size_t index);
rule_ptr i_token(size_t index);
rule_ptr active_prec(int precedence, rule_ptr);
struct Variable;
struct LexicalVariable;
bool operator==(const Variable &left, const Variable &right);
bool operator==(const LexicalVariable &left, const LexicalVariable &right);
}
#endif // HELPERS_RULE_HELPERS_H_