syntax error in fireplace_connection.vim

84 views
Skip to first unread message

Brian Craft

unread,
Apr 16, 2013, 4:50:41 PM4/16/13
to vimcl...@googlegroups.com
.vim/bundle/vim-fireplace/autoload/nrepl/fireplace_connection.vim:
line  251:
  File "<string>", line 41
    finally:
          ^
SyntaxError: invalid syntax


Anyone know what this is? I'm on centos. Could it be a problem with older vim?

Brian Craft

unread,
Apr 16, 2013, 4:55:53 PM4/16/13
to vimcl...@googlegroups.com
Ah. I suspect it's because vim doesn't have python compiled in. Looks like it detects the absence of python & tries to exit, but somehow still hits this error.

Brian Craft

unread,
Apr 16, 2013, 4:59:22 PM4/16/13
to vimcl...@googlegroups.com
Nope, it has python:

+python

Maybe it's due to older python??

Tim Pope

unread,
Apr 16, 2013, 5:01:59 PM4/16/13
to vimcl...@googlegroups.com
Maybe? I don't have much historical context on Python. What version?
> --
> You received this message because you are subscribed to the Google Groups
> "vimclojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vimclojure+...@googlegroups.com.
> To post to this group, send email to vimcl...@googlegroups.com.
> Visit this group at http://groups.google.com/group/vimclojure?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Brian Craft

unread,
Apr 16, 2013, 5:10:03 PM4/16/13
to vimcl...@googlegroups.com, tp...@tpope.net
2.4, apparently:

Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2    -D_REENTRANT -D_GNU_SOURCE  -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm  -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE  -I/usr/include/python2.4 -pthread   
Linking: gcc   -Wl,-E -Wl,-rpath,/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE   -L/usr/local/lib -o vim       -lncurses  -lselinux  -lacl -lgpm   -Wl,-E -Wl,-rpath,/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE  /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/DynaLoader/DynaLoader.a -L/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -lperl -lresolv -lutil -lc -L/usr/lib64/python2.4/config -lpython2.4 -lutil -lm -Xlinker -export-dynamic

Tim Pope

unread,
Apr 16, 2013, 5:11:07 PM4/16/13
to vimcl...@googlegroups.com
I dunno. Could you open a GitHub issue?

Brian Craft

unread,
Apr 16, 2013, 5:14:20 PM4/16/13
to vimcl...@googlegroups.com, tp...@tpope.net
Ah, yep, that's it.

> echo -e "try: pass\nexcept: pass\nfinally: pass" | /usr/bin/python
  File "<stdin>", line 3
    finally: pass
          ^
SyntaxError: invalid syntax


Works fine in 2.7.

Brian Craft

unread,
Apr 16, 2013, 5:18:09 PM4/16/13
to vimcl...@googlegroups.com, tp...@tpope.net
Trying this workaround:


vim comes up now. Now I just have to learn to use fireplace so I can tell if it's working. :-p

Brian Craft

unread,
Apr 16, 2013, 5:31:39 PM4/16/13
to vimcl...@googlegroups.com, tp...@tpope.net
Sadly, no:

Error detected while processing function <SNR>21_inputeval..fireplace#echo_session_eval..fireplace#session_eval..<SNR>21_eval..<SNR>21_client..fireplace#local_client..classpath#from_vim:
line    9:
E118: Too many arguments for function: glob
E116: Invalid arguments for function split(glob(substitute(elem, '\\\ze[\\ ,]', '', 'g'), 1), "\n")
E15: Invalid expression: split(glob(substitute(elem, '\\\ze[\\ ,]', '', 'g'), 1), "\n")
Error detected while processing function <SNR>21_inputeval:
line    4:
E171: Missing :endif

This looks like a vim version issue: glob() doesn't have a flag parameter in 7.0. Not sure if there's an easy workaround.

Brian Craft

unread,
Apr 16, 2013, 5:39:28 PM4/16/13
to vimcl...@googlegroups.com, tp...@tpope.net
That turned out to be in classpath.vim. I removed the flag. Also proactively removed it from plugin/fireplace.vim. I'm now at least able to use cqp. :)

Brian Craft

unread,
Apr 16, 2013, 6:18:13 PM4/16/13
to vimcl...@googlegroups.com, tp...@tpope.net
Another 2.4 incompatibility is "".format(). This works instead, in fireplace_connection.vim:

"\\%03o" % ord(c))

Brian Craft

unread,
Apr 16, 2013, 9:21:57 PM4/16/13
to vimcl...@googlegroups.com, tp...@tpope.net
Seems to be working perfectly now, and it's awesome.

The summary, for old vim and old python, as found on centos 5.5:

Replace python string.format() with % operator.
Use nested python "try" to avoid "except" and "finally" in the same block (not legal in python 2.4).
Drop 2nd parameter to vim glob() calls.
Delete catch of "REPL Connection Error" so user can see what's happening. ;)

Thanks.
Reply all
Reply to author
Forward
0 new messages