Freeform better.
This commit is contained in:
parent
7c2c4785e4
commit
cfa2a3e12a
@ -137,7 +137,8 @@ int main(int argc, char **argv) {
|
||||
(unsigned long)lex.line, lex_symbols[lex.symbol]);
|
||||
if(lex.symbol == TEXT || lex.symbol == ARG_KEYWORD
|
||||
|| lex.symbol == ARG_DATE
|
||||
|| lex.symbol == ARG_FREEFORM) {
|
||||
|| lex.symbol == ARG_FREEFORM
|
||||
|| lex.symbol == CAPTION) {
|
||||
if(lex.s0 + INT_MAX < lex.s1)
|
||||
{ errno = EILSEQ; goto catch; }
|
||||
printf(" <<%.*s>>", (int)(lex.s1 - lex.s0), lex.s0);
|
||||
@ -152,7 +153,6 @@ int main(int argc, char **argv) {
|
||||
|
||||
int_array_clear(&days);
|
||||
if(chdir("..") == -1) goto catch;
|
||||
break; /* fixme */
|
||||
}
|
||||
|
||||
int_array_clear(&months);
|
||||
|
@ -20,7 +20,7 @@ re2c:define:YYCTYPE = char;
|
||||
int lex_looks_like_year(const char *const a, int *const year) {
|
||||
const char *YYCURSOR = a, *YYMARKER = a, *s0;
|
||||
/*!stags:re2c format = 'const char *@@;\n'; */
|
||||
(void)yyt2, (void)yyt3;
|
||||
(void)yyt2;
|
||||
assert(a && year);
|
||||
/*!re2c
|
||||
@s0 ("-"? [1-9][0-9]* | "0") "\x00" {
|
||||
@ -41,7 +41,7 @@ int lex_looks_like_year(const char *const a, int *const year) {
|
||||
int lex_looks_like_month(const char *const a) {
|
||||
const char *YYCURSOR = a, *YYMARKER = a, *s0;
|
||||
/*!stags:re2c format = 'const char *@@;\n'; */
|
||||
(void)yyt1, (void)yyt2, (void)yyt3;
|
||||
(void)yyt1, (void)yyt2;
|
||||
assert(a);
|
||||
/*!re2c
|
||||
@s0 [0-1][0-9] "\x00" {
|
||||
@ -55,7 +55,7 @@ int lex_looks_like_month(const char *const a) {
|
||||
int lex_looks_like_day(const char *const a) {
|
||||
const char *YYCURSOR = a, *YYMARKER = a, *s0;
|
||||
/*!stags:re2c format = 'const char *@@;\n'; */
|
||||
(void)yyt1, (void)yyt2, (void)yyt3;
|
||||
(void)yyt1, (void)yyt2;
|
||||
assert(a);
|
||||
/*!re2c
|
||||
@s0 [0-3][0-9] ".txt\x00" {
|
||||
@ -219,8 +219,9 @@ scan:
|
||||
return x->symbol = ARG_NATURAL, 1; }
|
||||
// fixme!
|
||||
<edict_freeform> ws* @s0
|
||||
[^ \t\n\r\v\f;[\]\x00][^\t\n\r\v\f;[\]\x00]*[^ \t\n\r\v\f;[\]\x00]*
|
||||
@s1 ws* ";"? / "]"?
|
||||
([^] \ (sentinel | illegal | newline | ws | [;[\]]))
|
||||
([^] \ (sentinel | illegal | newline | [;[\]]))*
|
||||
@s1 ws* ";"?
|
||||
{ x->s0 = s0, x->s1 = s1; expect_pop();
|
||||
return x->symbol = ARG_FREEFORM, 1; }
|
||||
<edict, edict_end> "]" => text
|
||||
|
Loading…
Reference in New Issue
Block a user