               match: '\\$\\w+(?:\\.|\\b)'
             }
           ]
+        quotedStrings:
+          patterns: [
+            {
+              name: 'string.quoted.csound'
+              begin: '"'
+              beginCaptures:
+                0:
+                  name: 'punctuation.definition.string.begin.csound'
+              end: '"'
+              endCaptures:
+                0:
+                  name: 'punctuation.definition.string.end.csound'
+              patterns: [
+                {
+                  include: '#macroCalls'
+                }
+                {
+                  name: 'constant.character.escape.csound'
+                  # From
+                  # https://github.com/csound/csound/blob/develop/Opcodes/fout.c#L1405
+                  match: '%\\d*(\\.\\d+)?[cdhilouxX]'
+                }
+                {
+                  name: 'constant.character.escape.csound'
+                  match: '%[!%nNrRtT]|[~^]|\\\\(?:\\\\|[aAbBnNrRtT"]|[0-7]{1,3})'
+                }
+                {
+                  name: 'invalid.illegal.unknown-escape.csound'
+                  match: '\\\\.'
+                }
+              ]
+            }
+          ]
         partialExpressions:
           patterns: [
             { # These must be kept synchronized with the Csound Score grammar.

        range = displayBuffer.bufferRangeForScopeAtPosition 'entity.name.function.opcode.csound', event.oldRange.start

        if range
          index = userDefinedOpcodes.indexOf(editor.getTextInBufferRange range)
          if index >= 0
            userDefinedOpcodes.splice index, 1
            displayBuffer.tokenizedBuffer.invalidateRow row for row in [0...editor.getLineCount()] when !editor.isBufferRowCommented row

              patterns: [
                {
                  include: 'source.lua'
                }
              ]
            }
            {
              begin: '\\blua_opdef'
              beginCaptures:
                0:
                  name: 'support.function.csound'
              end: '\\}\\}'
              endCaptures:
                0:
                  name: 'string.braced.csound'
              patterns: [
                {
                  include: '#quotedStrings'
                }
                {
                  begin: '\\{\\{'
                  beginCaptures:
                    0:
                      name: 'string.braced.csound'
                  end: '(?=\\}\\})'
                  patterns: [
                    {
                      include: 'source.lua'
                    }
                  ]
                }
              ]
            }
