mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-23 16:08:43 +00:00
neaten
This commit is contained in:
parent
078b412aff
commit
c2fb8ea339
4 changed files with 550 additions and 542 deletions
|
|
@ -92,11 +92,11 @@ void mlr_dsl_ast_print(mlr_dsl_ast_t* past) {
|
|||
for (sllve_t* pe = past->pbegin_statements->phead; pe != NULL; pe = pe->pnext)
|
||||
mlr_dsl_ast_node_print(pe->pvvalue);
|
||||
|
||||
printf("AST MAIN STATEMENTS (%d):\n", past->pmain_statements->length);
|
||||
printf("AST MAIN STATEMENTS (%d):\n", past->pmain_statements->length);
|
||||
for (sllve_t* pe = past->pmain_statements->phead; pe != NULL; pe = pe->pnext)
|
||||
mlr_dsl_ast_node_print(pe->pvvalue);
|
||||
|
||||
printf("AST END STATEMENTS (%d):\n", past->pend_statements->length);
|
||||
printf("AST END STATEMENTS (%d):\n", past->pend_statements->length);
|
||||
for (sllve_t* pe = past->pend_statements->phead; pe != NULL; pe = pe->pnext)
|
||||
mlr_dsl_ast_node_print(pe->pvvalue);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@
|
|||
// Note: the parser depends on the dollar sign being here. If this is changed,
|
||||
// that needs to be changed as well.
|
||||
*yyextra = mlr_dsl_ast_node_alloc(yytext, MLR_DSL_AST_NODE_TYPE_FIELD_NAME);
|
||||
return MLR_DSL_BRACKETED_FIELD_NAME;
|
||||
return MLR_DSL_BRACED_FIELD_NAME;
|
||||
}
|
||||
|
||||
@[a-zA-Z_0-9]+ {
|
||||
|
|
@ -199,7 +199,7 @@
|
|||
// Note: the parser depends on the at-sign being here. If this is changed,
|
||||
// that needs to be changed as well.
|
||||
*yyextra = mlr_dsl_ast_node_alloc(yytext, MLR_DSL_AST_NODE_TYPE_OOSVAR_NAME);
|
||||
return MLR_DSL_BRACKETED_OOSVAR_NAME;
|
||||
return MLR_DSL_BRACED_OOSVAR_NAME;
|
||||
}
|
||||
|
||||
@@[a-zA-Z_0-9]+ {
|
||||
|
|
@ -214,7 +214,15 @@
|
|||
// Note: the parser depends on the percent-sign being here. If this is changed,
|
||||
// that needs to be changed as well.
|
||||
*yyextra = mlr_dsl_ast_node_alloc(yytext, MLR_DSL_AST_NODE_TYPE_MOOSVAR_NAME);
|
||||
return MLR_DSL_BRACKETED_MOOSVAR_NAME;
|
||||
return MLR_DSL_BRACED_MOOSVAR_NAME;
|
||||
//"\[" {
|
||||
// *yyextra = mlr_dsl_ast_node_alloc(yytext, MLR_DSL_AST_NODE_TYPE_STRIPPED_AWAY);
|
||||
// return MLR_DSL_LEFT_BRACKET;
|
||||
//}
|
||||
//"\]" {
|
||||
// *yyextra = mlr_dsl_ast_node_alloc(yytext, MLR_DSL_AST_NODE_TYPE_STRIPPED_AWAY);
|
||||
// return MLR_DSL_RIGHT_BRACKET;
|
||||
//}
|
||||
}
|
||||
|
||||
[0-9]+|[0-9]+\.[0-9]*|[0-9]*\.[0-9]+|[0-9]+[eE][0-9]+|[0-9]+[eE]-[0-9]+|[0-9]+\.[0-9]*[eE][0-9]+|[0-9]+\.[0-9]*[eE]-[0-9]+|[0-9]*\.[0-9]+[eE][0-9]+|[0-9]*\.[0-9]+[eE]-[0-9]+ {
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ mlr_dsl_field_name(A) ::= MLR_DSL_FIELD_NAME(B). {
|
|||
char* no_dollar_name = &dollar_name[1];
|
||||
A = mlr_dsl_ast_node_alloc(no_dollar_name, B->type);
|
||||
}
|
||||
mlr_dsl_field_name(A) ::= MLR_DSL_BRACKETED_FIELD_NAME(B). {
|
||||
mlr_dsl_field_name(A) ::= MLR_DSL_BRACED_FIELD_NAME(B). {
|
||||
// Replace "${field.name}" with just "field.name"
|
||||
char* dollar_name = B->text;
|
||||
char* no_dollar_name = &dollar_name[2];
|
||||
|
|
@ -447,7 +447,7 @@ mlr_dsl_oosvar_name(A) ::= MLR_DSL_OOSVAR_NAME(B). {
|
|||
char* no_at_name = &at_name[1];
|
||||
A = mlr_dsl_ast_node_alloc(no_at_name, B->type);
|
||||
}
|
||||
mlr_dsl_oosvar_name(A) ::= MLR_DSL_BRACKETED_OOSVAR_NAME(B). {
|
||||
mlr_dsl_oosvar_name(A) ::= MLR_DSL_BRACED_OOSVAR_NAME(B). {
|
||||
// Replace "@{field.name}" with just "field.name"
|
||||
char* at_name = B->text;
|
||||
char* no_at_name = &at_name[2];
|
||||
|
|
@ -465,7 +465,7 @@ mlr_dsl_moosvar_name(A) ::= MLR_DSL_MOOSVAR_NAME(B). {
|
|||
char* no_at_name = &at_name[2];
|
||||
A = mlr_dsl_ast_node_alloc(no_at_name, B->type);
|
||||
}
|
||||
mlr_dsl_moosvar_name(A) ::= MLR_DSL_BRACKETED_MOOSVAR_NAME(B). {
|
||||
mlr_dsl_moosvar_name(A) ::= MLR_DSL_BRACED_MOOSVAR_NAME(B). {
|
||||
// Replace "@%{field.name}" with just "field.name"
|
||||
char* at_name = B->text;
|
||||
char* no_at_name = &at_name[3];
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue