Avoid warnings about repeated typedefs

This commit is contained in:
Max Brunsfeld 2018-05-17 17:59:50 -07:00
parent 5ec3769cb4
commit 3c01382b95
5 changed files with 12 additions and 9 deletions

View file

@ -13,7 +13,10 @@ extern "C" {
#define ts_builtin_sym_end 0
#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024
#ifndef TREE_SITTER_RUNTIME_H_
typedef uint16_t TSSymbol;
typedef struct TSLanguage TSLanguage;
#endif
typedef uint16_t TSStateId;
@ -67,7 +70,7 @@ typedef union {
};
} TSParseActionEntry;
typedef struct TSLanguage {
struct TSLanguage {
uint32_t version;
uint32_t symbol_count;
uint32_t alias_count;
@ -92,7 +95,7 @@ typedef struct TSLanguage {
unsigned (*serialize)(void *, char *);
void (*deserialize)(void *, const char *, unsigned);
} external_scanner;
} TSLanguage;
};
/*
* Lexer Macros

View file

@ -12,7 +12,7 @@ extern "C" {
#define TREE_SITTER_LANGUAGE_VERSION 8
typedef unsigned short TSSymbol;
typedef uint16_t TSSymbol;
typedef struct TSLanguage TSLanguage;
typedef struct TSParser TSParser;
typedef struct TSTree TSTree;

View file

@ -5,8 +5,8 @@
extern "C" {
#endif
#include "tree_sitter/parser.h"
#include "runtime/subtree.h"
#include "tree_sitter/parser.h"
#define ts_builtin_sym_error_repeat (ts_builtin_sym_error - 1)

View file

@ -5,10 +5,10 @@
extern "C" {
#endif
#include "tree_sitter/parser.h"
#include "tree_sitter/runtime.h"
#include "runtime/length.h"
#include "runtime/subtree.h"
#include "tree_sitter/runtime.h"
#include "tree_sitter/parser.h"
typedef struct {
TSLexer data;

View file

@ -6,11 +6,11 @@ extern "C" {
#endif
#include <stdbool.h>
#include "tree_sitter/parser.h"
#include "tree_sitter/runtime.h"
#include <stdio.h>
#include "runtime/length.h"
#include "runtime/array.h"
#include <stdio.h>
#include "tree_sitter/runtime.h"
#include "tree_sitter/parser.h"
extern TSStateId TS_TREE_STATE_NONE;