Fix: Buildable libgmr.a
This commit is contained in:
parent
d77d4d3063
commit
c28d673db7
15 changed files with 1231 additions and 16 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
# By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ #
|
# By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2024/04/28 17:28:30 by maiboyer #+# #+# #
|
# 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
|
GOLD = \033[38;5;220m
|
||||||
END = \033[0m
|
END = \033[0m
|
||||||
|
|
||||||
|
.PHONY: $(OBJDIRNAME)/libme.a $(OBJDIRNAME)/libgmr.a
|
||||||
|
|
||||||
all: $(NAME)
|
all: $(NAME)
|
||||||
|
|
||||||
# Bonus (make bonus)
|
# Bonus (make bonus)
|
||||||
|
|
|
||||||
|
|
@ -4372,4 +4372,13 @@ static/symbols_names/symbols_names_1 \
|
||||||
static/symbols_names/symbols_names_2 \
|
static/symbols_names/symbols_names_2 \
|
||||||
static/unique_symbols_map/unique_symbols_map_0 \
|
static/unique_symbols_map/unique_symbols_map_0 \
|
||||||
static/unique_symbols_map/unique_symbols_map_1 \
|
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 \
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
# By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ #
|
# By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2023/11/03 13:20:01 by maiboyer #+# #+# #
|
# 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 ?=
|
LIB_NAME ?=
|
||||||
TARGET = $(BUILD_DIR)/$(NAME)
|
TARGET = $(BUILD_DIR)/$(NAME)
|
||||||
CC = clang
|
CC = clang
|
||||||
CFLAGS = -Wall -Wextra -Werror -g3 -MMD
|
CFLAGS = -Wall -Wextra -Werror -g3 -MMD -I./includes
|
||||||
|
|
||||||
include ./Filelist.mk
|
include ./Filelist.mk
|
||||||
|
|
||||||
|
|
|
||||||
1193
shcat_c/parser/includes/api.h
Normal file
1193
shcat_c/parser/includes/api.h
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +1,5 @@
|
||||||
#include "./language.h"
|
#include "./language.h"
|
||||||
#include "tree_sitter/api.h"
|
#include "api.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
const TSLanguage *ts_language_copy(const TSLanguage *self) {
|
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 ts_language_delete(const TSLanguage *self) {
|
||||||
|
(void)(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t ts_language_symbol_count(const TSLanguage *self) {
|
uint32_t ts_language_symbol_count(const TSLanguage *self) {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "./point.h"
|
#include "./point.h"
|
||||||
#include "tree_sitter/api.h"
|
#include "api.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t bytes;
|
uint32_t bytes;
|
||||||
|
|
|
||||||
|
|
@ -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)
|
uint32_t my_decode(const uint8_t *chunk, uint32_t size, int32_t *lookahead)
|
||||||
{
|
{
|
||||||
|
(void)(size);
|
||||||
*((uint32_t *)lookahead) = *chunk;
|
*((uint32_t *)lookahead) = *chunk;
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ extern "C" {
|
||||||
|
|
||||||
#include "./length.h"
|
#include "./length.h"
|
||||||
#include "./subtree.h"
|
#include "./subtree.h"
|
||||||
#include "tree_sitter/api.h"
|
#include "api.h"
|
||||||
#include "./parser.h"
|
#include "./parser.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
#include "./subtree.h"
|
#include "./subtree.h"
|
||||||
#include "./tree.h"
|
#include "./tree.h"
|
||||||
|
|
||||||
#include "tree_sitter/api.h"
|
#include "api.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <limits.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_VERSION_COUNT_OVERFLOW = 4;
|
||||||
static const unsigned MAX_SUMMARY_DEPTH = 16;
|
static const unsigned MAX_SUMMARY_DEPTH = 16;
|
||||||
static const unsigned MAX_COST_DIFFERENCE = 16 * ERROR_COST_PER_SKIPPED_TREE;
|
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
|
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)
|
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);
|
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)
|
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);
|
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)
|
uint64_t ts_parser_timeout_micros(const TSParser *self)
|
||||||
{
|
{
|
||||||
|
(void)(self);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef TREE_SITTER_POINT_H_
|
#ifndef TREE_SITTER_POINT_H_
|
||||||
#define 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_ZERO ((TSPoint) {0, 0})
|
||||||
#define POINT_MAX ((TSPoint) {UINT32_MAX, UINT32_MAX})
|
#define POINT_MAX ((TSPoint) {UINT32_MAX, UINT32_MAX})
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "./array.h"
|
#include "./array.h"
|
||||||
#include "tree_sitter/api.h"
|
#include "api.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t count;
|
uint32_t count;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#include "tree_sitter/array.h"
|
#include "array.h"
|
||||||
#include "tree_sitter/parser.h"
|
#include "parser.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.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,
|
static bool regex_scan(t_scanner *scanner, TSLexer *lexer,
|
||||||
const bool *valid_symbols)
|
const bool *valid_symbols)
|
||||||
{
|
{
|
||||||
|
(void)(scanner);
|
||||||
|
|
||||||
if ((valid_symbols[REGEX] || valid_symbols[REGEX_NO_SLASH] ||
|
if ((valid_symbols[REGEX] || valid_symbols[REGEX_NO_SLASH] ||
|
||||||
valid_symbols[REGEX_NO_SPACE]) &&
|
valid_symbols[REGEX_NO_SPACE]) &&
|
||||||
!in_error_recovery(valid_symbols))
|
!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,
|
static bool expansion_word_scan(t_scanner *scanner, TSLexer *lexer,
|
||||||
const bool *valid_symbols)
|
const bool *valid_symbols)
|
||||||
{
|
{
|
||||||
|
(void)(scanner);
|
||||||
|
|
||||||
if (valid_symbols[EXPANSION_WORD])
|
if (valid_symbols[EXPANSION_WORD])
|
||||||
{
|
{
|
||||||
bool advanced_once = false;
|
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,
|
static bool brace_start_scan(t_scanner *scanner, TSLexer *lexer,
|
||||||
const bool *valid_symbols)
|
const bool *valid_symbols)
|
||||||
{
|
{
|
||||||
|
(void)(scanner);
|
||||||
|
|
||||||
if (valid_symbols[BRACE_START] && !in_error_recovery(valid_symbols))
|
if (valid_symbols[BRACE_START] && !in_error_recovery(valid_symbols))
|
||||||
{
|
{
|
||||||
while (isspace(lexer->lookahead))
|
while (isspace(lexer->lookahead))
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ extern "C" {
|
||||||
#include "./array.h"
|
#include "./array.h"
|
||||||
#include "./error_costs.h"
|
#include "./error_costs.h"
|
||||||
#include "./host.h"
|
#include "./host.h"
|
||||||
#include "tree_sitter/api.h"
|
#include "api.h"
|
||||||
#include "./parser.h"
|
#include "./parser.h"
|
||||||
|
|
||||||
#define TS_TREE_STATE_NONE USHRT_MAX
|
#define TS_TREE_STATE_NONE USHRT_MAX
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#define _POSIX_C_SOURCE 200112L
|
#define _POSIX_C_SOURCE 200112L
|
||||||
|
|
||||||
#include "tree_sitter/api.h"
|
#include "api.h"
|
||||||
#include "./array.h"
|
#include "./array.h"
|
||||||
|
|
||||||
#include "./length.h"
|
#include "./length.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#include "tree_sitter/api.h"
|
#include "api.h"
|
||||||
|
|
||||||
#include "./tree_cursor.h"
|
#include "./tree_cursor.h"
|
||||||
#include "./language.h"
|
#include "./language.h"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue