[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

End-of-line




   Within Centaur, does it exist a way to handle atomic values inside of which
there is an end-of-line character?

   I explain what I am trying to do.


   I have the following Lex definitions in my file "...tokens":

String			\\"([^\\"]*|\\"\\")*\\"\

<sentences>{String}	{ shiftleft() ;\		[Remove the first "...]
			  suplast() ;\			[...and the last one.]
			  adjust_double_quotes() ;\	["" --> "]
			  return(String) ; };\

   These definitions allows me to parse strings being surrounded by the
character '"'. On the other hand, I order PPML to write them as follows:

	[<h> mystringpp(*string_atom)] ;

with:

(de :mystringpp (string_atom)
  (catenate """"
            (:readjust_double_quotes string_atom)
                ;  i.e., " --> "" within "string_atom", and returns
                ;  "string_atom".
            """"))

   For example, if I parse the string:

"You enjoy programming with Centaur,
don't you?"

   the result is displayed in an editor window as:

"You enjoy programming with Centaur,"

   In other words, the string has been truncated just before the end-of-line
character. If I replace the previous definition of the "String" atom by:

String			\\"([^\\"]*|\\"\\"|\\n)*\\"\

   the behaviour is exactly the same.


   Does someone can tell me if it exists a way to overcome this problem?


   Yours faithfully,

				 J.-M. Hufflen
				 (INRIA-CRIN)