feat: optimise flag, minor changes
This commit is contained in:
parent
ef9e1f0731
commit
a2795b5242
|
|
@ -33,7 +33,7 @@ void printNothing(T _ign1) { ; }
|
||||||
float [+-]?[0-9]*[.][0-9]+([eE][+-][0-9]+)?
|
float [+-]?[0-9]*[.][0-9]+([eE][+-][0-9]+)?
|
||||||
int [+-]?(0[xX][0-9A-Fa-f]*|0[0-7]*|[1-9][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]*
|
id [a-zA-Z_][a-zA-Z_0-9]*
|
||||||
blank [ \t\v\r]
|
blank [ \t\v\r]+
|
||||||
comment ;[^\n\r]*
|
comment ;[^\n\r]*
|
||||||
string \"(?:[^\"\\]|\\.)*\"
|
string \"(?:[^\"\\]|\\.)*\"
|
||||||
|
|
||||||
|
|
@ -78,17 +78,16 @@ defconstant [dD][eE][fF][cC][oO][nN][sS][tT][aA][nN][tT]
|
||||||
|
|
||||||
%{
|
%{
|
||||||
yylval = lval;
|
yylval = lval;
|
||||||
|
loc->step();
|
||||||
%}
|
%}
|
||||||
|
|
||||||
{blank}+ {
|
{blank}+ {
|
||||||
loc->step();
|
|
||||||
// PRINT_FUNC("Skipping blank\n");
|
// PRINT_FUNC("Skipping blank\n");
|
||||||
// return token::TOKEN_SPACE;
|
// return token::TOKEN_SPACE;
|
||||||
};
|
};
|
||||||
|
|
||||||
\n+ {
|
\n+ {
|
||||||
loc->lines(yyleng);
|
loc->lines(yyleng);
|
||||||
loc->step();
|
|
||||||
// PRINT_FUNC("Skipping newline\n");
|
// PRINT_FUNC("Skipping newline\n");
|
||||||
// return token::TOKEN_SPACE;
|
// return token::TOKEN_SPACE;
|
||||||
}
|
}
|
||||||
|
|
@ -360,7 +359,6 @@ defconstant [dD][eE][fF][cC][oO][nN][sS][tT][aA][nN][tT]
|
||||||
};
|
};
|
||||||
|
|
||||||
{string} {
|
{string} {
|
||||||
loc->step();
|
|
||||||
PRINT_FUNC("Scanned string: %s\n", yytext);
|
PRINT_FUNC("Scanned string: %s\n", yytext);
|
||||||
yylval->emplace<std::string>(std::string(yytext + 1, yyleng - 2));
|
yylval->emplace<std::string>(std::string(yytext + 1, yyleng - 2));
|
||||||
return token::TOKEN_STRING;
|
return token::TOKEN_STRING;
|
||||||
|
|
@ -368,7 +366,6 @@ defconstant [dD][eE][fF][cC][oO][nN][sS][tT][aA][nN][tT]
|
||||||
|
|
||||||
{comment} {
|
{comment} {
|
||||||
PRINT_FUNC("Scanned comment: %s\n", yytext);
|
PRINT_FUNC("Scanned comment: %s\n", yytext);
|
||||||
loc->step();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{id} {
|
{id} {
|
||||||
|
|
|
||||||
2
Makefile
2
Makefile
|
|
@ -18,7 +18,7 @@ CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
OUTPUT ?= $(PROJ).exe
|
OUTPUT ?= $(PROJ).exe
|
||||||
|
|
||||||
COMMONFLAGS ?= -g -Wall
|
COMMONFLAGS ?= -O2 -Wall -ffast-math -fomit-frame-pointer
|
||||||
CFLAGS ?= $(COMMONFLAGS) -std=c18
|
CFLAGS ?= $(COMMONFLAGS) -std=c18
|
||||||
CXXFLAGS ?= $(COMMONFLAGS) -std=c++20
|
CXXFLAGS ?= $(COMMONFLAGS) -std=c++20
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue