Re: Determine if a region has invalid syntax

Tu Do <[email protected]> Wed, 4 Feb 2015 20:33:15 +0700
Newsgroups gmane.emacs.cedet
Message-ID <CAOEd9jnZAYmxL8QY58d6bTiYDmpy13N+nFmz9aLypOHTZJo25A@mail.gmail.com>
I intend to do a function extraction, but want to prevent user to do so
when the selected region is not well formed. Just simple checking is enough.

Thanks for the answer.

On Wed, Feb 4, 2015 at 8:00 PM, Eric Ludlam <[email protected]> wrote:

> On 02/04/2015 06:20 AM, Tu Do wrote:
>
>> Hi Eric,
>>
>> Is there a way to determine if a selected region is syntactically
>> correct? Something that answers t or nil is good enough.
>>
>
> Hi,
>
> The answer depends on the parser, and most of the parsers only scan the
> declarations, and skip the contents of functions.  Thus, if you are looking
> for correctness of "code", you are better off with flymake and a linter, or
> something similar.
>
> If you are ok with only checking the declaration of functions, etc, there
> is a hook `semantic-unmatched-syntax-hook' that tells you when there is
> bad syntax as it is parsed.  You are probably more interested in
> `global-semantic-show-unmatched-syntax-mode'.  There are a bunch of fcns
> related to that which will probably help you with your task.
>
> Eric
>

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/

_______________________________________________
Cedet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cedet-devel