help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: use Elisp to improve your Elisp - some code issues


From: Robert Thorpe
Subject: Re: use Elisp to improve your Elisp - some code issues
Date: Sun, 02 Aug 2015 16:36:21 +0100

Emanuel Berg <address@hidden> writes:

> "Pascal J. Bourguignon" <address@hidden>
> writes:
>
>> No.
>>
>> I said that if you went beyond those simple case,
>> your regexp solution would break lamentably.
>
> This is an interface to regexps so it sure doesn't go
> anywhere beyond what can be expressed by regexps.

I agree with Pascal & Marcin.

Why not use the "read" function to read in the code of the file.  Then
you have everything as a tree.  You can use car and cdr to walk the tree
and find the relevant function calls.  Then you're in the right place in
the Chomsky heirachy.

> (if a a b)

Suppose "a" and "b" are expressions rather than variables.  Suppose
that the two instances of "a" have different whitespace and comments
between them.  In that case they can't be differentiated by regex.
Regex can't count parenthesis either.

Another possibility is editing the byte-compiler source to provide more 
warnings.

BR,
Robert Thorpe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]