No subject


Fri Feb 17 02:32:51 UTC 2012


in my proposal for string syntax.

Todd has pointed out that requiring doublequotes around
all strings, even one word strings, will be cumbersome.  
In the name of clean syntax and tokenizers, I like
requiring doublequotes.  The following change makes
doublequotes optional in some strings. 

Here's the diff:
< String values (and only string values) are surrounded by 
< doublequotes.  
< 
< Within a string, the following escape sequences
< are recognized and translated:
------------------------------------
> String values which contain spaces, escape sequences, or line
> continuation must be surrounded by doublequotes. Other string values
> (and only string values) may be surrounded by doublequotes.  
>
> Within a string surrounded by doublequotes, the following escape
> sequences are recognized and translated:

The full description follows.  The code stays the same, I did not
include it this time.

I don't know if this change satisfies Todd, since he hasn't seen
it off-list.  I think it comes close, although I understand he wants the 
doublequotes completely optional.  (Not wise, in my opinion
because of how it impacts the syntax (and tokenizer) when comments 
are present.)

Forrest
*********************************************************

---------------------------
Configuration String Values
---------------------------
String values which contain spaces, escape sequences, or line
continuation must be surrounded by doublequotes. Other string values
(and only string values) may be surrounded by doublequotes.  

Within a string surrounded by doublequotes, the following escape
sequences are recognized and translated:
    \t
    \n
    \f
    \r
    \b
    \\
    \x<DD> where <DD> is two characters from the set [0-9A-Fa-f]

To embed a doublequote character in a string, use \x22.

Line Continuation
-----------------
For readability, strings may continue across more than one
text line, as long as the last non-blank character on a line
is '\'.  In the case of such continuation, the backslash and
any spaces or tabs which follow up to and including the newline
are discarded.  

To embed a newline in a string use the \n escape sequence.

Note that it is considered a syntax error to continue a string
across a linebreak unless the '\' properly appears.  The parser
will recognize this as a syntax error.



More information about the inn-workers mailing list