Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

annotated: quotes are not preserved #195

Description

@bzz

Discovered in bblfsh/javascript-driver#81 (comment) and as noted at bblfsh/javascript-driver#81 (comment) - 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'

Actual

//*[@role='String' and @role='Literal'] XPath query results in

"@token":"b\nc","@type":"Str"
"@token":"b\ncq","@type":"Str"

Expected

For annotated mode, @token values should be:

'b\\ncq'
\"b\\ncq\"

Activity

  1. creachadair commented on Apr 15, 2019

    @creachadair
    Contributor

    Other test cases to consider while we're looking at this code: ''' and """ and their variants (e.g., r''', u""", etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions