Remove all uses of 'using namespace'
This commit is contained in:
parent
de5deeeb69
commit
a4120f36d4
30 changed files with 95 additions and 60 deletions
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace tree_sitter {
|
||||
using std::set;
|
||||
using namespace rules;
|
||||
using rules::Symbol;
|
||||
|
||||
namespace build_tables {
|
||||
set<Symbol> set_union(const set<Symbol> &left, const set<Symbol> &right) {
|
||||
|
|
@ -17,10 +17,10 @@ namespace tree_sitter {
|
|||
return result;
|
||||
}
|
||||
|
||||
class FirstSet : public RuleFn<set<Symbol>> {
|
||||
class FirstSet : public rules::RuleFn<set<Symbol>> {
|
||||
const PreparedGrammar grammar;
|
||||
public:
|
||||
FirstSet(const PreparedGrammar &grammar) : grammar(grammar) {}
|
||||
explicit FirstSet(const PreparedGrammar &grammar) : grammar(grammar) {}
|
||||
|
||||
void visit(const Symbol *rule) {
|
||||
if (grammar.has_definition(*rule)) {
|
||||
|
|
@ -30,11 +30,11 @@ namespace tree_sitter {
|
|||
}
|
||||
}
|
||||
|
||||
void visit(const Choice *rule) {
|
||||
void visit(const rules::Choice *rule) {
|
||||
value = set_union(apply(rule->left), apply(rule->right));
|
||||
}
|
||||
|
||||
void visit(const Seq *rule) {
|
||||
void visit(const rules::Seq *rule) {
|
||||
auto result = apply(rule->left);
|
||||
if (rule_can_be_blank(rule->left, grammar)) {
|
||||
result = set_union(result, apply(rule->right));
|
||||
|
|
@ -43,7 +43,7 @@ namespace tree_sitter {
|
|||
}
|
||||
};
|
||||
|
||||
set<Symbol> first_set(const rule_ptr &rule, const PreparedGrammar &grammar) {
|
||||
set<Symbol> first_set(const rules::rule_ptr &rule, const PreparedGrammar &grammar) {
|
||||
return FirstSet(grammar).apply(rule);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue