LibCST icon indicating copy to clipboard operation
LibCST copied to clipboard

Parse error when keyword adjacent to parenthesis

Open zsol opened this issue 1 year ago • 0 comments

handcrafted = [
    # various ways to look like you're calling a keyword
    '(_ if _ else _)in _',
    '_ if _ else(lambda:_)',
    '_ if(_ if _ else _) else _',
    '_ if _ else(_ if _ else _)',
    'def _(): return(lambda:_)',
    'def _(): return(_ if _ else _)',
]
for s in handcrafted:
    assert compiles(s), repr(s)
    assert not libcst_native_parses(s), repr(s)

Originally posted by @Zac-HD in https://github.com/Instagram/LibCST/issues/930#issuecomment-1581965630

zsol avatar Jun 08 '23 11:06 zsol