Komodo / KomodoEdit

Komodo Edit is a fast and free multi-language code editor. Written in JS, Python, C++ and based on the Mozilla platform.
http://www.komodoide.com/komodo-edit
Other
2.16k stars 302 forks source link

Default values for RXToolkit fail for Perl and Tcl #3230

Closed sgeard closed 7 years ago

sgeard commented 7 years ago

The default RxToolkit has regex: (.+?):(\d+):(.*) text: foo.pl:25:use strict; bar.pm:42:sub bar { # womba womba womba spam.py:234:seuss = ['green', 'eggs', 'ham']

For Tcl this results in There is an error in your regular expression: missing close-brace

For Perl there is an even longer error message which I won't repeat here.

Short Summary

Rx toolkit produces incorrect error messages and the messages themselves cannot be copied

Steps to Reproduce

Open RX toolkit and set language to either Tcl or Perl

Expected results

Result of applying the Rx to the given text

Actual results

Error message as described above (which cannot be copied)

Platform Information

Komodo IDE 11.0.0 Linux x86_64

Additional Information

The reported error is incorrect. The Rx is okay the problem is how Komodo is applying it to the text because line 2 contains a '{' character. If I do this in a tcl shell then all is well: % set line "bar.pm:42:sub bar { # womba womba womba" % regexp -inline -all {(.+?):(\d+):(.*)} $line bar.pm:42: bar.pm 42 {}

Note that to consume the whole line the rx must end in $, then the result is % regexp -inline -all {(.+?):(\d+):(.*)$} $line bar.pm:42:sub\ bar\ {\ #\ womba\ womba\ womba bar.pm 42 sub\ bar\ {\ #\ womba\ womba\ womba

mitchell-as commented 7 years ago

That's odd. When I open RxToolkit, my default text is (?P<file>.+?):(?P<line>\d+):(?P<code>.*). However, it works for Perl. Tcl gives a "illegal flag character in flag group" error. When I remove the named captures, the error goes away. Only Ruby gives a long error for me because I do not have a proper library installed.

Can you reproduce the problem in Safe Mode? (Help > Troubleshooting > Restart in Safe Mode)

sgeard commented 7 years ago

No I can't. I've just tried and I now have the same rx as you. However this is not a valid rx in Tcl (it doesn't have named groups) so I suggest it's set to (.+?):(\d+?):(.*)$

Naatan commented 7 years ago

It's just an example. Also the default is to use Python. I don't see anything wrong here, we're not trying to evolve the sample as you make changes.