Add option to disable parIdentifier

This commit is contained in:
augustin64 2024-01-03 11:06:15 +01:00
parent f50b87f68c
commit 68b952d105
2 changed files with 18 additions and 11 deletions

View File

@ -1,5 +1,7 @@
#ifndef DEF_CONFIG_H
#define DEF_CONFIG_H
// Parse identifiers wrapped in parentheses
//#define PAR_IDENTIFIER
#endif

View File

@ -6,6 +6,7 @@ using namespace std;
#include "include/tokenize.h"
#include "include/colors.h"
#include "include/parser.h"
#include "include/config.h"
#include "include/utils.h"
CodePosition null_pos = {
@ -997,6 +998,9 @@ ParseReturn parse_par_identifier(vector<Token> tokens) {
};
}
#ifndef PAR_IDENTIFIER
throw ParseException();
#else
if (tokens.back().type != TokenType::LParenthese)
throw ParseException();
@ -1013,4 +1017,5 @@ ParseReturn parse_par_identifier(vector<Token> tokens) {
.node=ret.node,
.tokens=tokens
};
#endif
}