Skip to content

Add backslashed single quotes to grammar #262

@kislikjeka98

Description

@kislikjeka98

It breaks if use single quoted string with backslash escaped single quote, for example 'Author's name'.
But mysql and postgres accept it
https://dev.mysql.com/doc/refman/8.4/en/string-literals.html
https://www.postgresql.org/docs/current/sql-syntax-lexical.html

I think it can be fixed by changing single_quote grammar to this

{
	"_single_quote_string": {
		"type": "SEQ",
		"members": [
			{
				"type": "PATTERN",
				"value": "([uU]&)?'(''|[^'\\]|\\.)*'"
			},
			{
				"type": "REPEAT",
				"content": {
					"type": "PATTERN",
					"value": "'(''|[^'\\]|\\.)*'"
				}
			}
		]
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions