Fix: Buildable libgmr.a

This commit is contained in:
Maieul BOYER 2024-04-28 18:26:57 +02:00
parent d77d4d3063
commit c28d673db7
No known key found for this signature in database
15 changed files with 1231 additions and 16 deletions

View file

@ -6,7 +6,7 @@
# By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/04/28 17:28:30 by maiboyer #+# #+# #
# Updated: 2024/04/28 17:36:20 by maiboyer ### ########.fr #
# Updated: 2024/04/28 18:17:52 by maiboyer ### ########.fr #
# #
# **************************************************************************** #
@ -54,6 +54,8 @@ RED = \033[0;31m
GOLD = \033[38;5;220m
END = \033[0m
.PHONY: $(OBJDIRNAME)/libme.a $(OBJDIRNAME)/libgmr.a
all: $(NAME)
# Bonus (make bonus)

View file

@ -4372,4 +4372,13 @@ static/symbols_names/symbols_names_1 \
static/symbols_names/symbols_names_2 \
static/unique_symbols_map/unique_symbols_map_0 \
static/unique_symbols_map/unique_symbols_map_1 \
static/unique_symbols_map/unique_symbols_map_2
static/unique_symbols_map/unique_symbols_map_2 \
src/language \
src/lexer \
src/node \
src/parser \
src/scanner \
src/stack \
src/subtree \
src/tree \
src/tree_cursor \

View file

@ -6,7 +6,7 @@
# By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/11/03 13:20:01 by maiboyer #+# #+# #
# Updated: 2024/04/28 17:48:04 by maiboyer ### ########.fr #
# Updated: 2024/04/28 18:19:27 by maiboyer ### ########.fr #
# #
# **************************************************************************** #
@ -18,7 +18,7 @@ NAME = libgmr.a
LIB_NAME ?=
TARGET = $(BUILD_DIR)/$(NAME)
CC = clang
CFLAGS = -Wall -Wextra -Werror -g3 -MMD
CFLAGS = -Wall -Wextra -Werror -g3 -MMD -I./includes
include ./Filelist.mk

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
#include "./language.h"
#include "tree_sitter/api.h"
#include "api.h"
#include <string.h>
const TSLanguage *ts_language_copy(const TSLanguage *self) {
@ -7,6 +7,7 @@ const TSLanguage *ts_language_copy(const TSLanguage *self) {
}
void ts_language_delete(const TSLanguage *self) {
(void)(self);
}
uint32_t ts_language_symbol_count(const TSLanguage *self) {

View file

@ -4,7 +4,7 @@
#include <stdlib.h>
#include <stdbool.h>
#include "./point.h"
#include "tree_sitter/api.h"
#include "api.h"
typedef struct {
uint32_t bytes;

View file

@ -69,6 +69,7 @@ typedef uint32_t (*UnicodeDecodeFunction)(const uint8_t *chunk, uint32_t size,
uint32_t my_decode(const uint8_t *chunk, uint32_t size, int32_t *lookahead)
{
(void)(size);
*((uint32_t *)lookahead) = *chunk;
return (1);
}

View file

@ -7,7 +7,7 @@ extern "C" {
#include "./length.h"
#include "./subtree.h"
#include "tree_sitter/api.h"
#include "api.h"
#include "./parser.h"
typedef struct {

View file

@ -11,7 +11,7 @@
#include "./subtree.h"
#include "./tree.h"
#include "tree_sitter/api.h"
#include "api.h"
#include <assert.h>
#include <inttypes.h>
#include <limits.h>
@ -101,7 +101,7 @@ static const unsigned MAX_VERSION_COUNT = 6;
static const unsigned MAX_VERSION_COUNT_OVERFLOW = 4;
static const unsigned MAX_SUMMARY_DEPTH = 16;
static const unsigned MAX_COST_DIFFERENCE = 16 * ERROR_COST_PER_SKIPPED_TREE;
static const unsigned OP_COUNT_PER_TIMEOUT_CHECK = 100;
//static const unsigned OP_COUNT_PER_TIMEOUT_CHECK = 100;
typedef struct
{
@ -399,11 +399,13 @@ static bool ts_parser__better_version_exists(TSParser *self,
static bool ts_parser__call_main_lex_fn(TSParser *self, TSLexMode lex_mode)
{
(void)(lex_mode);
return self->language->lex_fn(&self->lexer.data, lex_mode.lex_state);
}
static bool ts_parser__call_keyword_lex_fn(TSParser *self, TSLexMode lex_mode)
{
(void)(lex_mode);
return self->language->keyword_lex_fn(&self->lexer.data, 0);
}
@ -2093,6 +2095,7 @@ void ts_parser_set_cancellation_flag(TSParser *self, const size_t *flag)
uint64_t ts_parser_timeout_micros(const TSParser *self)
{
(void)(self);
return 0;
}

View file

@ -1,7 +1,7 @@
#ifndef TREE_SITTER_POINT_H_
#define TREE_SITTER_POINT_H_
#include "tree_sitter/api.h"
#include "api.h"
#define POINT_ZERO ((TSPoint) {0, 0})
#define POINT_MAX ((TSPoint) {UINT32_MAX, UINT32_MAX})

View file

@ -6,7 +6,7 @@ extern "C" {
#endif
#include "./array.h"
#include "tree_sitter/api.h"
#include "api.h"
typedef struct {
uint32_t count;

View file

@ -1,5 +1,5 @@
#include "tree_sitter/array.h"
#include "tree_sitter/parser.h"
#include "array.h"
#include "parser.h"
#include <assert.h>
#include <ctype.h>
@ -425,6 +425,8 @@ static bool scan_heredoc_content(t_scanner *scanner, TSLexer *lexer,
static bool regex_scan(t_scanner *scanner, TSLexer *lexer,
const bool *valid_symbols)
{
(void)(scanner);
if ((valid_symbols[REGEX] || valid_symbols[REGEX_NO_SLASH] ||
valid_symbols[REGEX_NO_SPACE]) &&
!in_error_recovery(valid_symbols))
@ -924,6 +926,8 @@ static bool extglob_pattern_scan(t_scanner *scanner, TSLexer *lexer,
static bool expansion_word_scan(t_scanner *scanner, TSLexer *lexer,
const bool *valid_symbols)
{
(void)(scanner);
if (valid_symbols[EXPANSION_WORD])
{
bool advanced_once = false;
@ -1026,6 +1030,8 @@ static bool expansion_word_scan(t_scanner *scanner, TSLexer *lexer,
static bool brace_start_scan(t_scanner *scanner, TSLexer *lexer,
const bool *valid_symbols)
{
(void)(scanner);
if (valid_symbols[BRACE_START] && !in_error_recovery(valid_symbols))
{
while (isspace(lexer->lookahead))

View file

@ -12,7 +12,7 @@ extern "C" {
#include "./array.h"
#include "./error_costs.h"
#include "./host.h"
#include "tree_sitter/api.h"
#include "api.h"
#include "./parser.h"
#define TS_TREE_STATE_NONE USHRT_MAX

View file

@ -1,6 +1,6 @@
#define _POSIX_C_SOURCE 200112L
#include "tree_sitter/api.h"
#include "api.h"
#include "./array.h"
#include "./length.h"

View file

@ -1,4 +1,4 @@
#include "tree_sitter/api.h"
#include "api.h"
#include "./tree_cursor.h"
#include "./language.h"