         tokens = [new Token(value: line[start...end], scopes: scopes)]
     if @pushRule
       ruleToPush = @pushRule.getRuleToPush(line, captureIndices)
-      ruleToPush.anchor = captureIndices[2]
+      ruleToPush.anchorPosition = captureIndices[2]
       stack.push(ruleToPush)
     else if @popRule
       stack.pop()

  patterns: null
  allPatterns: null
  createEndPattern: null
  anchor: -1

  constructor: (@grammar, {@scopeName, patterns, @endPattern}) ->
    patterns ?= []

    @getIncludedPatterns().forEach (pattern) =>
      if pattern.anchored
        anchored = true
        regex = pattern.replaceAnchor(firstLine, position, @anchorPosition)
      else
        regex = pattern.regexSource
      regexes.push regex if regex
