Make include guards pass cpplint

This commit is contained in:
Max Brunsfeld 2014-03-09 22:05:17 -07:00
parent 10b1bd0f5c
commit 31a58bc7e4
33 changed files with 112 additions and 112 deletions

View file

@ -1,5 +1,5 @@
#ifndef tree_sitter_compiler_h
#define tree_sitter_compiler_h
#ifndef TREE_SITTER_COMPILER_H_
#define TREE_SITTER_COMPILER_H_
#include <vector>
#include <map>
@ -37,4 +37,4 @@ namespace tree_sitter {
std::string compile(const Grammar &grammar, std::string name);
}
#endif
#endif // TREE_SITTER_COMPILER_H_

View file

@ -1,14 +1,14 @@
#ifndef tree_sitter_parser_h
#define tree_sitter_parser_h
#ifndef TREE_SITTER_PARSER_H_
#define TREE_SITTER_PARSER_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "./runtime.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "tree_sitter/runtime.h"
//#define TS_DEBUG_PARSE
//#define TS_DEBUG_LEX
@ -310,4 +310,4 @@ return ts_parser_tree(parser);
}
#endif
#endif
#endif // TREE_SITTER_PARSER_H_

View file

@ -1,5 +1,5 @@
#ifndef tree_sitter_runtime_h
#define tree_sitter_runtime_h
#ifndef TREE_SITTER_RUNTIME_H_
#define TREE_SITTER_RUNTIME_H_
#ifdef __cplusplus
extern "C" {
@ -55,15 +55,15 @@ typedef struct {
typedef struct ts_document ts_document;
ts_document * ts_document_make();
void ts_document_free(ts_document *);
void ts_document_set_parser(ts_document *, ts_parse_config);
void ts_document_set_input(ts_document *, ts_input input);
void ts_document_set_input_string(ts_document *, const char *text);
const ts_tree * ts_document_tree(const ts_document *);
const char * ts_document_string(const ts_document *);
void ts_document_free(ts_document *doc);
void ts_document_set_parser(ts_document *doc, ts_parse_config parser);
void ts_document_set_input(ts_document *doc, ts_input input);
void ts_document_set_input_string(ts_document *doc, const char *text);
const ts_tree * ts_document_tree(const ts_document *doc);
const char * ts_document_string(const ts_document *doc);
#ifdef __cplusplus
}
#endif
#endif
#endif // TREE_SITTER_RUNTIME_H_

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash
find src -type f | xargs externals/cpplint.py \
--root=src \
--filter=-whitespace,-readability/namespace,-legal/copyright \
2>&1
filters=-whitespace,-readability/namespace,-legal/copyright
cpplint=externals/cpplint.py
find src -type f | xargs $cpplint --root=src --filter=$filters 2>&1
find include -type f | xargs $cpplint --root=include --filter=$filters 2>&1

View file

@ -1,5 +1,5 @@
#ifndef __TreeSitter__build_tables__
#define __TreeSitter__build_tables__
#ifndef COMPILER_BUILD_TABLES_BUILD_TABLES_H_
#define COMPILER_BUILD_TABLES_BUILD_TABLES_H_
#include <utility>
#include "compiler/parse_table.h"
@ -13,4 +13,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_BUILD_TABLES_BUILD_TABLES_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__first_set__
#define __tree_sitter__first_set__
#ifndef COMPILER_BUILD_TABLES_FIRST_SET_H_
#define COMPILER_BUILD_TABLES_FIRST_SET_H_
#include <set>
#include "compiler/build_tables/item.h"
@ -25,4 +25,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_BUILD_TABLES_FIRST_SET_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__follow_sets__
#define __tree_sitter__follow_sets__
#ifndef COMPILER_BUILD_TABLES_FOLLOW_SETS_H_
#define COMPILER_BUILD_TABLES_FOLLOW_SETS_H_
#include <set>
#include <map>
@ -22,4 +22,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_BUILD_TABLES_FOLLOW_SETS_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__item__
#define __tree_sitter__item__
#ifndef COMPILER_BUILD_TABLES_ITEM_H_
#define COMPILER_BUILD_TABLES_ITEM_H_
#include <set>
#include <string>
@ -76,4 +76,4 @@ namespace std {
};
}
#endif
#endif // COMPILER_BUILD_TABLES_ITEM_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__close_item_set__
#define __tree_sitter__close_item_set__
#ifndef COMPILER_BUILD_TABLES_ITEM_SET_CLOSURE_H_
#define COMPILER_BUILD_TABLES_ITEM_SET_CLOSURE_H_
#include "compiler/build_tables/item.h"
@ -11,4 +11,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_BUILD_TABLES_ITEM_SET_CLOSURE_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__item_set_transitions__
#define __tree_sitter__item_set_transitions__
#ifndef COMPILER_BUILD_TABLES_ITEM_SET_TRANSITIONS_H_
#define COMPILER_BUILD_TABLES_ITEM_SET_TRANSITIONS_H_
#include <map>
#include "compiler/build_tables/item.h"
@ -17,4 +17,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_BUILD_TABLES_ITEM_SET_TRANSITIONS_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__merge_transitions__
#define __tree_sitter__merge_transitions__
#ifndef COMPILER_BUILD_TABLES_MERGE_TRANSITIONS_H_
#define COMPILER_BUILD_TABLES_MERGE_TRANSITIONS_H_
#include <map>
#include "compiler/rules/character_set.h"
@ -68,4 +68,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_BUILD_TABLES_MERGE_TRANSITIONS_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__rule_can_be_blank__
#define __tree_sitter__rule_can_be_blank__
#ifndef COMPILER_BUILD_TABLES_RULE_CAN_BE_BLANK_H_
#define COMPILER_BUILD_TABLES_RULE_CAN_BE_BLANK_H_
#include "tree_sitter/compiler.h"
@ -12,4 +12,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_BUILD_TABLES_RULE_CAN_BE_BLANK_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__transitions__
#define __tree_sitter__transitions__
#ifndef COMPILER_BUILD_TABLES_RULE_TRANSITIONS_H_
#define COMPILER_BUILD_TABLES_RULE_TRANSITIONS_H_
#include <map>
#include "compiler/rules/character_set.h"
@ -12,4 +12,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_BUILD_TABLES_RULE_TRANSITIONS_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__code_generator__
#define __tree_sitter__code_generator__
#ifndef COMPILER_GENERATE_CODE_C_CODE_H_
#define COMPILER_GENERATE_CODE_C_CODE_H_
#include "compiler/parse_table.h"
#include "compiler/lex_table.h"
@ -10,4 +10,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_GENERATE_CODE_C_CODE_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__helpers__
#define __tree_sitter__helpers__
#ifndef COMPILER_GENERATE_CODE_HELPERS_H_
#define COMPILER_GENERATE_CODE_HELPERS_H_
#include <string>
#include <vector>
@ -16,4 +16,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_GENERATE_CODE_HELPERS_H_

View file

@ -1,5 +1,5 @@
#ifndef __TreeSitter__lex_table__
#define __TreeSitter__lex_table__
#ifndef COMPILER_LEX_TABLE_H_
#define COMPILER_LEX_TABLE_H_
#include <map>
#include <vector>
@ -65,4 +65,4 @@ namespace tree_sitter {
};
}
#endif
#endif // COMPILER_LEX_TABLE_H_

View file

@ -1,5 +1,5 @@
#ifndef __TreeSitter__parse_table__
#define __TreeSitter__parse_table__
#ifndef COMPILER_PARSE_TABLE_H_
#define COMPILER_PARSE_TABLE_H_
#include <map>
#include <vector>
@ -71,4 +71,4 @@ namespace tree_sitter {
};
}
#endif
#endif // COMPILER_PARSE_TABLE_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__expand_repeats__
#define __tree_sitter__expand_repeats__
#ifndef COMPILER_PREPARE_GRAMMAR_EXPAND_REPEATS_H_
#define COMPILER_PREPARE_GRAMMAR_EXPAND_REPEATS_H_
#include "tree_sitter/compiler.h"
@ -11,4 +11,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_PREPARE_GRAMMAR_EXPAND_REPEATS_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__extract_tokens__
#define __tree_sitter__extract_tokens__
#ifndef COMPILER_PREPARE_GRAMMAR_EXTRACT_TOKENS_H_
#define COMPILER_PREPARE_GRAMMAR_EXTRACT_TOKENS_H_
#include <utility>
@ -11,4 +11,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_PREPARE_GRAMMAR_EXTRACT_TOKENS_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__prepare_grammar__
#define __tree_sitter__prepare_grammar__
#ifndef COMPILER_PREPARE_GRAMMAR_PREPARE_GRAMMAR_H_
#define COMPILER_PREPARE_GRAMMAR_PREPARE_GRAMMAR_H_
#include <utility>
@ -12,4 +12,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_PREPARE_GRAMMAR_PREPARE_GRAMMAR_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__prepared_grammar__
#define __tree_sitter__prepared_grammar__
#ifndef COMPILER_PREPARED_GRAMMAR_H_
#define COMPILER_PREPARED_GRAMMAR_H_
#include "tree_sitter/compiler.h"
#include "compiler/rules/symbol.h"
@ -27,4 +27,4 @@ namespace tree_sitter {
std::string compile(const Grammar &grammar, std::string name);
}
#endif
#endif // COMPILER_PREPARED_GRAMMAR_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__blank__
#define __tree_sitter__blank__
#ifndef COMPILER_RULES_BLANK_H_
#define COMPILER_RULES_BLANK_H_
#include "compiler/rules/rule.h"
@ -18,4 +18,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_RULES_BLANK_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__built_in_symbols__
#define __tree_sitter__built_in_symbols__
#ifndef COMPILER_RULES_BUILT_IN_SYMBOLS_H_
#define COMPILER_RULES_BUILT_IN_SYMBOLS_H_
#include "compiler/rules/symbol.h"
@ -11,4 +11,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_RULES_BUILT_IN_SYMBOLS_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter_character_range_h__
#define __tree_sitter_character_range_h__
#ifndef COMPILER_RULES_CHARACTER_RANGE_H_
#define COMPILER_RULES_CHARACTER_RANGE_H_
#include <map>
#include <string>
@ -9,10 +9,10 @@ namespace tree_sitter {
struct CharacterRange {
char min;
char max;
CharacterRange(char);
CharacterRange(char, char);
bool operator==(const CharacterRange &) const;
bool operator<(const CharacterRange &) const;
CharacterRange(char value);
CharacterRange(char min, char max);
bool operator==(const CharacterRange &other) const;
bool operator<(const CharacterRange &others) const;
std::string to_string() const;
};
}
@ -27,4 +27,4 @@ namespace std {
};
}
#endif
#endif // COMPILER_RULES_CHARACTER_RANGE_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__character_set__
#define __tree_sitter__character_set__
#ifndef COMPILER_RULES_CHARACTER_SET_H_
#define COMPILER_RULES_CHARACTER_SET_H_
#include <initializer_list>
#include <set>
@ -42,4 +42,4 @@ namespace std {
};
}
#endif
#endif // COMPILER_RULES_CHARACTER_SET_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__choice__
#define __tree_sitter__choice__
#ifndef COMPILER_RULES_CHOICE_H_
#define COMPILER_RULES_CHOICE_H_
#include <vector>
#include "compiler/rules/rule.h"
@ -23,4 +23,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_RULES_CHOICE_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter_pattern_h_
#define __tree_sitter_pattern_h_
#ifndef COMPILER_RULES_PATTERN_H_
#define COMPILER_RULES_PATTERN_H_
#include "compiler/rules/rule.h"
@ -21,5 +21,5 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_RULES_PATTERN_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__repeat__
#define __tree_sitter__repeat__
#ifndef COMPILER_RULES_REPEAT_H_
#define COMPILER_RULES_REPEAT_H_
#include "compiler/rules/rule.h"
@ -20,4 +20,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_RULES_REPEAT_H_

View file

@ -1,5 +1,5 @@
#ifndef __TreeSitter__rule__
#define __TreeSitter__rule__
#ifndef COMPILER_RULES_RULE_H_
#define COMPILER_RULES_RULE_H_
#include <string>
#include <memory>
@ -35,4 +35,4 @@ namespace std {
};
}
#endif
#endif // COMPILER_RULES_RULE_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__seq__
#define __tree_sitter__seq__
#ifndef COMPILER_RULES_SEQ_H_
#define COMPILER_RULES_SEQ_H_
#include <vector>
#include "compiler/rules/rule.h"
@ -23,4 +23,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_RULES_SEQ_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__string__
#define __tree_sitter__string__
#ifndef COMPILER_RULES_STRING_H_
#define COMPILER_RULES_STRING_H_
#include "compiler/rules/rule.h"
@ -20,4 +20,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_RULES_STRING_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__sym__
#define __tree_sitter__sym__
#ifndef COMPILER_RULES_SYMBOL_H_
#define COMPILER_RULES_SYMBOL_H_
#include <utility>
#include "compiler/rules/rule.h"
@ -46,5 +46,4 @@ namespace std {
};
}
#endif
#endif // COMPILER_RULES_SYMBOL_H_

View file

@ -1,5 +1,5 @@
#ifndef __tree_sitter__rule_visitor__
#define __tree_sitter__rule_visitor__
#ifndef COMPILER_RULES_VISITOR_H_
#define COMPILER_RULES_VISITOR_H_
#include "compiler/rules/rule.h"
@ -41,4 +41,4 @@ namespace tree_sitter {
}
}
#endif
#endif // COMPILER_RULES_VISITOR_H_