Open bzz opened 5 years ago
Discovered in https://github.com/bblfsh/javascript-driver/pull/81#issuecomment-481845021 and as noted at https://github.com/bblfsh/javascript-driver/pull/81#issuecomment-481852636 - this driver does not handle string literals in annotated mode the same way as other drivers do: it does not preserve the " and ' as part of the literal value in annotated mode.
"
'
On
bc = "b\nc" bcq = 'b\ncq'
//*[@role='String' and @role='Literal'] XPath query results in
//*[@role='String' and @role='Literal']
"@token":"b\nc","@type":"Str" "@token":"b\ncq","@type":"Str"
For annotated mode, @token values should be:
@token
'b\\ncq' \"b\\ncq\"
Other test cases to consider while we're looking at this code: ''' and """ and their variants (e.g., r''', u""", etc.)
'''
"""
r'''
u"""
Discovered in https://github.com/bblfsh/javascript-driver/pull/81#issuecomment-481845021 and as noted at https://github.com/bblfsh/javascript-driver/pull/81#issuecomment-481852636 - this driver does not handle string literals in annotated mode the same way as other drivers do: it does not preserve the
"
and'
as part of the literal value in annotated mode.On
Actual
//*[@role='String' and @role='Literal']
XPath query results inExpected
For annotated mode,
@token
values should be: