feat: optimise flag, minor changes

This commit is contained in:
Eatswap 2022-12-14 11:43:33 +08:00
parent ef9e1f0731
commit a2795b5242
Signed by: Eatswap
GPG Key ID: BE661106A1F3FA0B
2 changed files with 3 additions and 6 deletions

View File

@ -33,7 +33,7 @@ void printNothing(T _ign1) { ; }
float [+-]?[0-9]*[.][0-9]+([eE][+-][0-9]+)?
int [+-]?(0[xX][0-9A-Fa-f]*|0[0-7]*|[1-9][0-9]*)
id [a-zA-Z_][a-zA-Z_0-9]*
blank [ \t\v\r]
blank [ \t\v\r]+
comment ;[^\n\r]*
string \"(?:[^\"\\]|\\.)*\"
@ -78,17 +78,16 @@ defconstant [dD][eE][fF][cC][oO][nN][sS][tT][aA][nN][tT]
%{
yylval = lval;
loc->step();
%}
{blank}+ {
loc->step();
// PRINT_FUNC("Skipping blank\n");
// return token::TOKEN_SPACE;
};
\n+ {
loc->lines(yyleng);
loc->step();
// PRINT_FUNC("Skipping newline\n");
// return token::TOKEN_SPACE;
}
@ -360,7 +359,6 @@ defconstant [dD][eE][fF][cC][oO][nN][sS][tT][aA][nN][tT]
};
{string} {
loc->step();
PRINT_FUNC("Scanned string: %s\n", yytext);
yylval->emplace<std::string>(std::string(yytext + 1, yyleng - 2));
return token::TOKEN_STRING;
@ -368,7 +366,6 @@ defconstant [dD][eE][fF][cC][oO][nN][sS][tT][aA][nN][tT]
{comment} {
PRINT_FUNC("Scanned comment: %s\n", yytext);
loc->step();
}
{id} {

View File

@ -18,7 +18,7 @@ CC = gcc
CXX = g++
OUTPUT ?= $(PROJ).exe
COMMONFLAGS ?= -g -Wall
COMMONFLAGS ?= -O2 -Wall -ffast-math -fomit-frame-pointer
CFLAGS ?= $(COMMONFLAGS) -std=c18
CXXFLAGS ?= $(COMMONFLAGS) -std=c++20