jed-users mailing list

[2003 Date Index] [2003 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: Re: request for define_syntax ()


On Thu, 10 Apr 2003 11:46:39 -0400 wrote "John E. Davis" <davis@xxxxxxxxxxxxx>:

> Guido Gonzato <ggonza@xxxxxx> wrote:
> >I often find myself wondering whether the define_syntax () function could
> >take four parameters. It would be useful to write something like
> >
> >  define_syntax ("``", "''", '"', mode); % e.g. for LaTeX strings
> 
> I will look into it but I make no promises.

There is one more problem: String definitions is currently based on just one
character, i.e. define_syntax('"', '"', mode), not a string. 

An ugly workaround would be to (mis)use the comment type, as this does
exactly match the requirements. (Maybe the comment type could also be a
model for the proposed extension for string-type definitions.)

i.e. my wish would be

   If `type' is `'"'' or `'\''', a string or character delimiter syntax is
   defined. If there are three parameters, the first parameter is an integer
   that represents the string-delimiter (usually '"')

   If there are four parameters, the first two parameters are strings that
   represent the begin and end string delimiters.  If the string syntax is
   such that the string ends at the end of a line, the second string must
   either be the empty string, `""', or a newline `"\n"'.  
   
   The current implementation supports at most two types of strings.
   (I would prefer at least 3, better 5)


> >Since I am unable to write regular expression rules that span multiple
> >lines (Heavens knows why), this syntax would make life easier.
> 
> Jed uses a linked-list to represent the lines in a buffer.  The slang
> regular expression code (as well as other regular expression
> libraries) take a single string and apply patterns to it.  For this
> reason, it is not possible to use a regular expression across multiple
> lines.

There could be a workaround for regexp search using bufsubstring() and
string_match(...), however this will naturally not be that easy for DFA
syntax highlight.

Günter

--
Milde at ife.et.tu-dresden.de



--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2003 date index] [2003 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]