From: Richard Si <63936253+ichard26@users.noreply.github.com> Date: Fri, 12 Nov 2021 01:28:48 +0000 (-0500) Subject: Improve Python 2 only syntax detection (GH-2592) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/0753d99519b0c90f0f9f280b73783b537900dc16?hp=0753d99519b0c90f0f9f280b73783b537900dc16 Improve Python 2 only syntax detection (GH-2592) * Improve Python 2 only syntax detection First of all this fixes a mistake I made in Python 2 deprecation PR using token.* to check for print/exec statements. Turns out that for nodes with a type value higher than 256 its numeric type isn't guaranteed to be constant. Using syms.* instead fixes this. Also add support for the following cases: print "hello, world!" exec "print('hello, world!')" def set_position((x, y), value): pass try: pass except Exception, err: pass raise RuntimeError, "I feel like crashing today :p" `wow_these_really_did_exist` 10L * Add octal support, more test cases, and fixup long ints Co-authored-by: Jelle Zijlstra Co-authored-by: Jelle Zijlstra ---