 
       ix--
 
-    return null # syntax error in list (or no list)
+    return null # list not well formed, or no list
+
+  unshiftRange: (ranges, rangeStart, rangeEnd, isNested) ->
+    ranges.unshift [rangeStart,rangeEnd] if not isNested && rangeStart != rangeEnd
 
   findMatchingClosingBracket: (bufferText, startIx, isNested, openingBracket) ->
     # console.log "findMatchingClosingBracket: " + startIx + (if openingBracket? then openingBracket else "any opening bracket")


      if (closingBracket? && (currentChar == @getOpeningBracketFor closingBracket)) ||
         @isOpeningBracket currentChar
        @addRange ranges, ix, rangeEnd, isNested
        return {bracketIx: ix, ranges: ranges}

      if @isClosingBracket currentChar
        @addRange ranges, ix, rangeEnd, isNested
        res = @findMatchingOpeningBracket bufferText, ix-1, true, currentChar
        break if not res?
        ix = res.bracketIx

            # TODO: For now, disallow this, as it requires some changes to the model to accomodate the whitespace in an empty list
            []
          else
            nonNestedIxRanges = leftIxRanges.concat rightIxRanges
            elementRanges = @getElementRangesFromNonNested bufferText, listStartIx, listEndIx, nonNestedIxRanges
            # @showIxRanges bufferText, elementRanges

