   findGoals: (text) ->
 
     tokens = new Lexer text
-      .lex commentRegex, 'comment'
-      .lex goalBracketRegex, 'goal bracket'
+      .lex commentRegex, 'raw', 'comment'
+      .lex goalBracketRegex, 'raw', 'goal bracket'
       .result
 
     # for counting character position

          data = /\{!(.*)!\}/.exec(obj.content)[1].replace(/^\s\s*/, '').replace(/\s\s*$/, '')
          obj.content = "{! #{data + paddingSpaces} !}"
          return obj
        else if obj.type is 'goal QM'
          goalIndex = goalIndices[index]
          index += 1
          paddingSpaces = ' '.repeat(goalIndex.toString().length)
          switch obj.content.length
            when 3 then obj.content = "#{obj.content[0]}{! #{paddingSpaces} !}#{obj.content[2]}"
            when 2 then obj.content = "{! #{paddingSpaces} !}#{obj.content[1]}"
          return obj
        else
          return obj

    text = @agda.editor.getText()

    tokens = new Lexer text
      .lex commentRegex, 'raw', 'comment'
      .lex goalBracketRegex, 'raw', 'goal bracket'
      .lex goalQuestionMarkGroupRegex, 'raw', 'goal ?s'
      .lex goalQuestionMarkRegex, 'goal ?s', 'goal ?'
      .result

    # for counting goals
