 
           tokens = lines[0]
           expect(tokens.length).toBe 14
-          expect(tokens[0]).toEqual value: 'opcode', scopes: ['source.csound', 'meta.opcode-definition.csound', 'meta.opcode-declaration.csound', 'keyword.function.csound']
-          expect(tokens[1]).toEqual value: '/*', scopes: ['source.csound', 'meta.opcode-definition.csound', 'meta.opcode-declaration.csound', 'comment.block.csound', 'punctuation.definition.comment.begin.csound']
-          expect(tokens[2]).toEqual value: '*/', scopes: ['source.csound', 'meta.opcode-definition.csound', 'meta.opcode-declaration.csound', 'comment.block.csound', 'punctuation.definition.comment.end.csound']
-          expect(tokens[3]).toEqual value: 'aUDO', scopes: ['source.csound', 'meta.opcode-definition.csound', 'meta.opcode-declaration.csound', 'meta.opcode-details.csound', 'entity.name.function.opcode.csound']
-          expect(tokens[4]).toEqual value: ',', scopes: ['source.csound', 'meta.opcode-definition.csound', 'meta.opcode-declaration.csound', 'meta.opcode-details.csound']
-          expect(tokens[5]).toEqual value: '/*', scopes: ['source.csound', 'meta.opcode-definition.csound', 'meta.opcode-declaration.csound', 'meta.opcode-details.csound', 'comment.block.csound', 'punctuation.definition.comment.begin.csound']
-          expect(tokens[6]).toEqual value: '*/', scopes: ['source.csound', 'meta.opcode-definition.csound', 'meta.opcode-declaration.csound', 'meta.opcode-details.csound', 'comment.block.csound', 'punctuation.definition.comment.end.csound']
-          expect(tokens[7]).toEqual value: '0', scopes: ['source.csound', 'meta.opcode-definition.csound', 'meta.opcode-declaration.csound', 'meta.opcode-details.csound', 'meta.opcode-argument-types.csound', 'storage.type.csound']
-          expect(tokens[8]).toEqual value: ',', scopes: ['source.csound', 'meta.opcode-definition.csound', 'meta.opcode-declaration.csound', 'meta.opcode-details.csound', 'meta.opcode-argument-types.csound']
-          expect(tokens[9]).toEqual value: '/*', scopes: ['source.csound', 'meta.opcode-definition.csound', 'meta.opcode-declaration.csound', 'meta.opcode-details.csound', 'comment.block.csound', 'punctuation.definition.comment.begin.csound']
-          expect(tokens[10]).toEqual value: '*/', scopes: ['source.csound', 'meta.opcode-definition.csound', 'meta.opcode-declaration.csound', 'meta.opcode-details.csound', 'comment.block.csound', 'punctuation.definition.comment.end.csound']
-          expect(tokens[11]).toEqual value: '0', scopes: ['source.csound', 'meta.opcode-definition.csound', 'meta.opcode-declaration.csound', 'meta.opcode-details.csound', 'meta.opcode-argument-types.csound', 'storage.type.csound']
-          expect(tokens[12]).toEqual value: '//', scopes: ['source.csound', 'meta.opcode-definition.csound', 'meta.opcode-declaration.csound', 'meta.opcode-details.csound', 'meta.opcode-argument-types.csound', 'comment.line.csound', 'punctuation.definition.comment.line.csound']
-          expect(tokens[13]).toEqual value: '', scopes: ['source.csound', 'meta.opcode-definition.csound', 'meta.opcode-declaration.csound']
+          expect(tokens[0]).toEqual value: 'opcode', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'meta.opcode-declaration.csound'
+            'keyword.function.csound'
+          ]
+          expect(tokens[1]).toEqual value: '/*', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'meta.opcode-declaration.csound'
+            'comment.block.csound'
+            'punctuation.definition.comment.begin.csound'
+          ]
+          expect(tokens[2]).toEqual value: '*/', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'meta.opcode-declaration.csound'
+            'comment.block.csound'
+            'punctuation.definition.comment.end.csound'
+          ]
+          expect(tokens[3]).toEqual value: 'aUDO', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'meta.opcode-declaration.csound'
+            'meta.opcode-details.csound'
+            'entity.name.function.opcode.csound'
+          ]
+          expect(tokens[4]).toEqual value: ',', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'meta.opcode-declaration.csound'
+            'meta.opcode-details.csound'
+          ]
+          expect(tokens[5]).toEqual value: '/*', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'meta.opcode-declaration.csound'
+            'meta.opcode-details.csound'
+            'comment.block.csound'
+            'punctuation.definition.comment.begin.csound'
+          ]
+          expect(tokens[6]).toEqual value: '*/', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'meta.opcode-declaration.csound'
+            'meta.opcode-details.csound'
+            'comment.block.csound'
+            'punctuation.definition.comment.end.csound'
+          ]
+          expect(tokens[7]).toEqual value: '0', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'meta.opcode-declaration.csound'
+            'meta.opcode-details.csound'
+            'meta.opcode-argument-types.csound'
+            'storage.type.csound'
+          ]
+          expect(tokens[8]).toEqual value: ',', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'meta.opcode-declaration.csound'
+            'meta.opcode-details.csound'
+            'meta.opcode-argument-types.csound'
+          ]
+          expect(tokens[9]).toEqual value: '/*', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'meta.opcode-declaration.csound'
+            'meta.opcode-details.csound'
+            'comment.block.csound'
+            'punctuation.definition.comment.begin.csound'
+          ]
+          expect(tokens[10]).toEqual value: '*/', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'meta.opcode-declaration.csound'
+            'meta.opcode-details.csound'
+            'comment.block.csound'
+            'punctuation.definition.comment.end.csound'
+          ]
+          expect(tokens[11]).toEqual value: '0', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'meta.opcode-declaration.csound'
+            'meta.opcode-details.csound'
+            'meta.opcode-argument-types.csound'
+            'storage.type.csound'
+          ]
+          expect(tokens[12]).toEqual value: '//', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'meta.opcode-declaration.csound'
+            'meta.opcode-details.csound'
+            'meta.opcode-argument-types.csound'
+            'comment.line.csound'
+            'punctuation.definition.comment.line.csound'
+          ]
+          expect(tokens[13]).toEqual value: '', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'meta.opcode-declaration.csound']
 
           tokens = lines[1]
-          expect(tokens[0]).toEqual value: 'aUDO', scopes: ['source.csound', 'meta.opcode-definition.csound', 'entity.name.function.opcode.csound']
+          expect(tokens.length).toBe 1
+          expect(tokens[0]).toEqual value: 'aUDO', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'entity.name.function.opcode.csound'
+          ]
 
           tokens = lines[2]
-          expect(tokens[0]).toEqual value: 'endop', scopes: ['source.csound', 'meta.opcode-definition.csound', 'keyword.other.csound']
+          expect(tokens.length).toBe 1
+          expect(tokens[0]).toEqual value: 'endop', scopes: [
+            'source.csound'
+            'meta.opcode-definition.csound'
+            'keyword.other.csound'
+          ]
 
     it 'tokenizes preprocessor directives', ->
       preprocessorDirectives = [

        ''
      ]
      # Putting a label after each string is enough to test the grammar, but
      # it is not always valid Csound syntax. In particular, loop_ge, loop_gt,
      # loop_le, and loop_lt all take four arguments, the last of which is a
      # label.
      lines = grammar.tokenizeLines keywordsAndOpcodes.join ' aLabel //\n'
      for i in [0...lines.length - 1]
        tokens = lines[i]
        expect(tokens[0]).toEqual value: keywordsAndOpcodes[i], scopes: ['source.csound', 'keyword.control.csound']
        expect(tokens[1]).toEqual value: ' ', scopes: ['source.csound']
        expect(tokens[2]).toEqual value: 'aLabel', scopes: ['source.csound', 'entity.name.label.csound']
        expect(tokens[3]).toEqual value: ' ', scopes: ['source.csound']
        expect(tokens[4]).toEqual value: '//', scopes: ['source.csound', 'comment.line.csound', 'punctuation.definition.comment.line.csound']

        '\\345'
        '\\67'
      ]
      lines = grammar.tokenizeLines "\"#{escapedCharacters.join ''}\""
      tokens = lines[0]
      expect(tokens[0]).toEqual value: '"', scopes: [
        'source.csound'
        'string.quoted.csound'
        'punctuation.definition.string.begin.csound'
      ]
      for i in [1...tokens.length - 1]
        expect(tokens[i]).toEqual value: escapedCharacters[i - 1], scopes: [
          'source.csound'
          'string.quoted.csound'
          'constant.character.escape.csound'
        ]
      expect(tokens[tokens.length - 1]).toEqual value: '"', scopes: [
        'source.csound'
        'string.quoted.csound'
        'punctuation.definition.string.end.csound'
      ]

    it 'tokenizes braced strings', ->
      lines = grammar.tokenizeLines '{{characters}}'
      tokens = lines[0]
      expect(tokens[0]).toEqual value: '{{', scopes: [
        'source.csound'
        'string.braced.csound'
      ]
      expect(tokens[1]).toEqual value: 'characters', scopes: [
        'source.csound'
        'string.braced.csound'
      ]
      expect(tokens[2]).toEqual value: '}}', scopes: [
        'source.csound'
        'string.braced.csound'
      ]

    it 'tokenizes keywords', ->
      keywords = [
