         if argument['namedArgumentsFlag'] != true
             return false
         return true
+
+
+    findFirstNonCommentLine: (src) ->
+        ###
+            Returns the line numer of the first non-comment line.
+            This is obviously not a complete parser so obscure edge cases are unsupported
+            e.g. print("/*") would be mistaken for a multiline comment.
+        ###
+        lines = src.split('\n')
+        count=0
+        inMLC = false #Multi-line comment
+        for line in src.split('\n')
+            count +=1
+            if(line.match(/^S*$/))
+                continue # Ignore empty lines
+            isSLC =  !!line.match(/^\s*\/\//)
+
+            countStartMLC = line.split('/*').length-1
+            countEndMLC = line.split('*/').length-1
+
+            if(inMLC)
+                if(!isSLC)
+                    inMLC = countStartMLC >countEndMLC
+            else
+                if( (!isSLC && !(inMLC=countStartMLC > countEndMLC)))
+                    break
+        return count

        @onStudentCodeChange()
        @moveEditorButtonDelay = 30
        setTimeout @moveEditorButtons, @moveEditorButtonDelay
        @editor.gotoLine @findFirstNonCommentLine(@codeConfig.initial)
        return

    setUpInsertButtons: ->

                return i
        return -1 # Not Found


class window.PlayerCodeEditor
    ###
        Creates and provides functionality for an Ace editor representing player's code.
    ###
    constructor: (
            @editorDivId, @commands, @initialText, @wrapCode, @codePrefix,
            @codeSuffix, @hiddenSuffix, @freeEdit, @interpreter) ->
        ###
            Sets internal variables, the default text and buttons
