From 2e3d844a9fca9540fa66079c516ecee01676b697 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Tue, 8 Mar 2016 10:10:45 -0800 Subject: [PATCH] unescape backslash-doublequote for DSL string literals --- c/dsls/mlr_dsl_parse.y | 3 ++- c/reg_test/expected/out | 2 +- c/todo.txt | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/c/dsls/mlr_dsl_parse.y b/c/dsls/mlr_dsl_parse.y index 93c1297a0..2fe1fe196 100644 --- a/c/dsls/mlr_dsl_parse.y +++ b/c/dsls/mlr_dsl_parse.y @@ -5,6 +5,7 @@ #include #include #include +#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; diff --git a/c/reg_test/expected/out b/c/reg_test/expected/out index 6c8bf43d0..bdd02c6fb 100644 --- a/c/reg_test/expected/out +++ b/c/reg_test/expected/out @@ -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" diff --git a/c/todo.txt b/c/todo.txt index d527789f1..9db687d9c 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -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