Code Duplication    Length = 7-9 lines in 2 locations

src/PeacefulBit/Slate/Parser/Tokenizer.php 2 locations

@@ 134-142 (lines=9) @@
131
            return $baseIter($rest, append($acc, $symbolToken));
132
        });
133
134
        $preDotSymbolIter = tail(function ($rest, $buffer, $acc) use (&$baseIter, &$dotSymbolIter) {
135
            if (sizeof($rest) > 0) {
136
                list ($head, $tail) = toHeadTail($rest);
137
                if ($this->isSymbol($head)) {
138
                    return $dotSymbolIter($tail, $buffer . $head, $acc);
139
                }
140
            }
141
            throw new TokenizerException("Unexpected dot at the end of identifier");
142
        });
143
144
        // State when parser parses any symbol
145
        $dotSymbolIter = tail(function ($rest, $buffer, $acc) use (&$baseIter, &$dotSymbolIter) {
@@ 179-185 (lines=7) @@
176
        });
177
178
        // State when parser parses escaped symbol
179
        $escapeIter = tail(function ($rest, $buffer, $acc) use (&$stringIter) {
180
            if (sizeof($rest) == 0) {
181
                throw new TokenizerException("Unused escape character");
182
            }
183
            list ($head, $tail) = toHeadTail($rest);
184
            return $stringIter($tail, $buffer . $head, $acc);
185
        });
186
187
        // State when parser ignores comments
188
        $commentIter = function ($rest, $buffer, $acc) use (&$commentIter, &$baseIter) {