From 24d8bf5fc95172dab81811d182fae011be49731d Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 30 Sep 2024 12:28:58 +0200 Subject: [PATCH] feat: adding the partentheses treatment (just the start) --- parser/src/parentheses.c | 29 +++++++++++++++++++++++++++++ parser/src/quotes.c | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 parser/src/parentheses.c diff --git a/parser/src/parentheses.c b/parser/src/parentheses.c new file mode 100644 index 00000000..5856d61d --- /dev/null +++ b/parser/src/parentheses.c @@ -0,0 +1,29 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* parentheses.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/09/30 12:25:22 by rparodi #+# #+# */ +/* Updated: 2024/09/30 12:28:26 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "me/vec/vec_token.h" +#include "parser/token.h" +#include "me/string/string.h" +#include "me/types.h" +#include + +char is_parentheses(char c, char next) +{ + if (c == '(') + { + if (next == '(') + return (2); + else + return (1); + } + return (0); +} diff --git a/parser/src/quotes.c b/parser/src/quotes.c index 146bb24b..6c38a94a 100644 --- a/parser/src/quotes.c +++ b/parser/src/quotes.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/09/27 11:46:45 by rparodi #+# #+# */ -/* Updated: 2024/09/29 13:28:31 by rparodi ### ########.fr */ +/* Updated: 2024/09/30 12:28:26 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */