From d6e59241730e6f458da6e77368b8b6b4d2626150 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Thu, 24 Jan 2008 18:53:04 -0800 Subject: allow non-indented line continuation --- src/cli_def.l | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/cli_def.l b/src/cli_def.l index df768c1..8f32c51 100644 --- a/src/cli_def.l +++ b/src/cli_def.l @@ -334,14 +334,18 @@ RE_ACT_FIELD (help|syntax|commit|delete|update|activate|create|begin|end|comp_he return return_act_field(yy_cli_def_text); } -\n[^ \t] { +\n({RE_REG_FIELD}|{RE_ACT_FIELD}):.* { + int i = 0; + char *tmp = strdup(yy_cli_def_text); BEGIN(INITIAL); - unput( yy_cli_def_text[1] ); - unput( yy_cli_def_text[0] ); + for (i = yy_cli_def_leng - 1; i >= 0; --i) { + unput( tmp[i] ); + } + free(tmp); return return_action(); } -(\n[ \t]+)?.* { +\n?.* { append_action(yy_cli_def_text); } -- cgit v1.2.3