unescape backslash-doublequote for DSL string literals

This commit is contained in:
John Kerl 2016-03-08 10:10:45 -08:00
parent f05bbee932
commit 2e3d844a9f
3 changed files with 4 additions and 2 deletions

View file

@ -5,6 +5,7 @@
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "../lib/mlrutil.h"
#include "../containers/mlr_dsl_ast.h"
#include "../containers/sllv.h"
@ -800,7 +801,7 @@ md_string(A) ::= MD_TOKEN_STRING(B). {
char* stripped = &input[1];
int len = strlen(input);
stripped[len-2] = 0;
A = mlr_dsl_ast_node_alloc(stripped, B->type);
A = mlr_dsl_ast_node_alloc(mlr_unbackslash(stripped), B->type);
}
md_regexi(A) ::= MD_TOKEN_REGEXI(B). {
char* input = B->text;

View file

@ -11019,7 +11019,7 @@ AST BEGIN STATEMENTS (0):
AST MAIN STATEMENTS (1):
=~ (operator):
y (field_name).
\".. (strnum_literal).
".. (strnum_literal).
AST END STATEMENTS (0):
x=ABCDE,y="GHI"

View file

@ -10,6 +10,7 @@ TOP-OF-LIST SUMMARY
* rh/fedora/centos mlr-3.4.0
* \" in string-literal reader ... fix up in the parser or in rval_expr.
* basenaming syntax for subselector emits
~ oosvar-to-oosvar assignments with treecopy
~ subselector emits
~ horizontality of emits