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

Re: End-of-line



=>From: Vincent Prunet <Vincent.Prunet@sophia.inria.fr>
=>(...)
=>
=>>    Within Centaur, does it exist a way to handle atomic values 
=>> inside of which
=>> there is an end-of-line character?
=>
=>(...)
=>
=>You may also try the following hack, which won't work in
=>incremental mode. 


   Thank you for your answer. I tried your hack, or more exactly, the following
revision in the ".ppml" file:

*x where *x in {string *string_atom} ->
    [<v> if resetcounter(*string_atom) = 0
            then printsubstring(*string_atom) tail::*x
         end if] ;
tail::*x where *x in {string *value} ->
    [<h> if tail(*value) > 0 then [<v> printsubstring(*value) tail::*x]
            end if] ;

with the following functions, in the ".at" file:

(defvar #:ppGlider:atm:counter 0)

(de #:ppGliderstd:int:resetcounter (value)
  ;;  not necessary in normal mode, but may help in incremental mode
  (setq #:ppGliderstd:atm:counter 0))

(de #:ppGliderstd:atm:printsubstring (value)
 (let ((old :counter))
   (setq :counter (#:ppGliderstd:atm:get-next-new-line-index value :counter))
   (substring value old :counter)))

(de #:ppGliderstd:int:tail (value)
  (- (plength value) #:ppGliderstd:atm:counter))

(de #:ppGliderstd:atm:get-next-new-line-index (value x)
 (let ((index (index "
" value x)))
   (if (null index) (plength value) index)))


   Unfortunately, my problem with an end-of-line character inside of a string
subsists. More precisely, if I activate the Le_Lisp trace, I obtain:

? (trace #:ppGliderstd:atm:printsubstring)
(#:ppGliderstd:atm:printsubstring)
? #:ppGliderstd:atm:printsubstring ---> value=You're afraid,
#:ppGliderstd:atm:printsubstring <--- You're afraid,

   The string I wanted to parse was: 

"You're afraid,
ain't you?"

   As you can see, this string is already truncated when the function
"printsubstring" is called at the first time. Consequently, where does
truncating occur?


   On the other hand, I am not sure to understand what you mean by "incremental
mode".


   Yours faithfully,

				 J.-M. Hufflen