aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-07-16 12:21:27 +0300
committerSergey Poznyakoff <gray@gnu.org>2016-07-16 12:21:27 +0300
commit529fed25f92e04d694c30b3fc6bc8645e2703f4e (patch)
treec575001b35a43ba8f325bf7af60d7b9fb8b8b32a /doc
parent6201e61fb932dbe6153f92ede836e07247d04b7c (diff)
downloadgrecs-529fed25f92e04d694c30b3fc6bc8645e2703f4e.tar.gz
grecs-529fed25f92e04d694c30b3fc6bc8645e2703f4e.tar.bz2
Disable adjacent string concatenation.
The adjacent string concatenation feature doesn't work well with multiple-argument statements. The common example (found in GNU pies) is the "env" statement: env "PATH=/sbin:$PATH" "PRELOAD=true" The intent was to pass it two arguments, but in fact they get concatenated into one. To control this, the grecs_parser_options variable is introduced. If it has the GRECS_OPTION_QUOTED_STRING_CONCAT bit set, adjacent string concatenation is enabled. By default it is disabled. The GRECS_OPTION_ADJUST_STRING_LOCATIONS bit controls the way the quoted sring locations are computed. If it is set, the beginning of the string is counted at the first character after the opening double quote, and its end at the character immediately preceding the closing double quote. Otherwise, both double-quote characters are included in the location (the default). The change is backward incompatible. * doc/grecs-syntax.texi: Update. * include/grecs/parser.h (grecs_adjust_string_locations): Remove. (grecs_parser_options): New extern. * src/grecs-lex.l: QSTRING is returned only if GRECS_OPTION_QUOTED_STRING_CONCAT option is set. The GRECS_OPTION_ADJUST_STRING_LOCATIONS option controls string locus adjustment. * src/parser.c (grecs_adjust_string_locations): Remove. (grecs_parser_options): New variable. * tests/Makefile.am: Add strcat.at, stradj.at * tests/testsuite.at: Likewise. * tests/gcffmt.c: New options -strcat and -stradj * tests/stradj.at: New test case. * tests/strcat.at: New test case.
Diffstat (limited to 'doc')
-rw-r--r--doc/grecs-syntax.texi15
1 files changed, 12 insertions, 3 deletions
diff --git a/doc/grecs-syntax.texi b/doc/grecs-syntax.texi
index a7738d6..2ddedea 100644
--- a/doc/grecs-syntax.texi
+++ b/doc/grecs-syntax.texi
@@ -111,9 +111,12 @@ The default include search path is:
where @var{prefix} is the installation prefix.
@c FIXME: Uncomment this, if necessary:
-@c FIXME: New directories can be appended in front of it using @option{-I}
-@c FIXME: (@option{--include-directory}) command line option
-@c FIXME: (@pxref{Preprocessor, include-directory}).
+@ignore
+New directories can be appended in front of it using @option{-I}
+(@option{--include-directory}) command line option
+(@pxref{Preprocessor, include-directory}).
+}
+@end ignore
@kwindex #include_once
@item #include_once <@var{file}>
@@ -216,6 +219,11 @@ physical lines, e.g.:
If the character following a backslash is not one of those specified
above, the backslash is ignored and a warning is issued.
+@c FIXME: If grecs_parser_options variable has
+@c FIXME: GRECS_OPTION_QUOTED_STRING_CONCAT bit set, then the
+@c FIXME: following holds:
+
+@ignore
Two or more adjacent quoted strings are concatenated, which gives
another way to split long strings over several lines to improve
readability. The following fragment produces the same result as the
@@ -227,6 +235,7 @@ example above:
" split over several lines"
@end group
@end smallexample
+@end ignore
@anchor{here-document}
@item Here-document

Return to:

Send suggestions and report system problems to the System administrator.