Support the "alternative quoting mechanism" for PL/SQL #14

Merged
stefandobre merged 1 commit from main into main 2023-08-05 10:54:15 +02:00
stefandobre commented 2023-08-04 22:19:55 +02:00 (Migrated from github.com)

In Oracle's (PL/)SQL, the "alternative quoting mechanism" is a very popular way to enquote strings, without having to worry about escaping single quotes. See the official docs.

Instead of having to write things like this:

select 'what''s up'

we can just do:

select q'[what's up]'

Currently, CodeMirror's PLSQL dialect does not understand this syntax, and stops highlighting the string after the first single quote. This PR fixes it.

In Oracle's (PL/)SQL, the "alternative quoting mechanism" is a very popular way to enquote strings, without having to worry about escaping single quotes. See the [official docs](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Literals.html#GUID-1824CBAA-6E16-4921-B2A6-112FB02248DA). Instead of having to write things like this: ``` select 'what''s up' ``` we can just do: ``` select q'[what's up]' ``` Currently, CodeMirror's PLSQL dialect does not understand this syntax, and stops highlighting the string after the first single quote. This PR fixes it.
marijnh commented 2023-08-05 10:54:55 +02:00 (Migrated from github.com)

Thanks! Followed this up with 6aac598, which renames the option and adjusts the code style a bit. Do those changes work for you?

Thanks! Followed this up with 6aac598, which renames the option and adjusts the code style a bit. Do those changes work for you?
stefandobre commented 2023-08-05 12:09:21 +02:00 (Migrated from github.com)

Sure thing. Much appreciated!

Sure thing. Much appreciated!
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/lang-sql!14
No description provided.