Re: [code] Proposal: Change to Python/Ruby syntax checking commands

From: Mitchell <m.att.foicica.com>
Date: Mon, 7 Sep 2015 13:43:38 -0400 (EDT)

Hi Arnel,

On Mon, 7 Sep 2015, jalespring.att.gmail.com wrote:

> Hi Mitchell,
>
> Attached is a change I would like to propose to the Python syntax checking
> command and the Ruby syntax error pattern. This change is done against
> revision cd5906e1c812.
>
> I noticed the syntax checking process change did not work for some reason
> with Python and Ruby files in the new TA version (v8.2 and the nightly
> version).
>
> For Python, I initially tried replacing the single quotation marks with
> doubles, which partly fixed the issue, but was giving me errors with the
> shebang line. Bringing it back to using the 'py_compile' module worked fine.
>
> For Ruby, the new pattern was not taking the source filename into account. So
> I just added it.
>
> My current workaround is to set the following in my init.lua:
>
> textadept.run.syntax_commands.python = [[python -m py_compile "%f"]]
> textadept.run.syntax_error_patterns.ruby = '.+:(%d+):
> ([^\r\n]+).-[\r\n]+(%s*)'
>
> I hope the change will be considered.

Thanks for your report. Which version of Python were you using? What was
the filename? The reason against using py_compile is that Python2 and
Python3 report different error messages, whereas Textadept's existing
command outputs the same message regardless of version.

After looking at the Ruby error message, I found that Ruby does not always
display a caret '^' at the column an error occured at. I'll have this
fixed in the next nightly. Thanks for bringing it to my attention.

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 07 Sep 2015 - 13:43:38 EDT

This archive was generated by hypermail 2.2.0 : Tue 08 Sep 2015 - 06:37:26 EDT