Nikita Konstantinov

Results 24 comments of Nikita Konstantinov

> I'm not sure how pragmatic it would be to have a separate Command for each data point in the application. I'd say "each business intention". It's perfectly fine to...

By the way, this is a common pattern for immutable objects ```php public function withRed(int $red): self { assert($red >= 0 && $red red = $red; return $color; } ```...

I'm not quite sure how to fix the tests. Command `source ./scripts/functions.sh && rsync_files` gives ``` fatal: Invalid path '/Users/unkind/www/**': No such file or directory ```

It reminds me of http://nikic.github.io/2014/02/18/Fast-request-routing-using-regular-expressions.html#combined-regular-expressions Also, try to make benchmark with `S` modifier: http://php.net/manual/en/reference.pcre.pattern.modifiers.php > S > When a pattern is going to be used several times,it is worth spending...

> Sources: FastLexer https://github.com/railt/railt/blob/8b1e327bb357a134b7ba5e52209796ba6597f3f6/src/Compiler/FastLexer.php#L82 ```php yield from $result; yield Token::eof($offset); ``` If I understand it right, it is just preparation for Generator (from interface point of view at least), but...

btw, few weeks ago I found out `(*MARK)` verb: ```regex ~ \G (?| (?:[^",\r\n]+)(*MARK:token0) | (?:"[^"\\]*(?:\\.[^"\\]*)*")(*MARK:token1) | (?:,)(*MARK:token2) | (?:\r?\n)(*MARK:token3) | [\S\s](*MARK:error) ) ~Jx ``` You can put arbitrary labels...

> it does not allow to understand in what order the tokens are located. ? `preg_match_all()` with pattern above generates array of tokens in actual order.

> > However, as I said, preg_replace_callback doesn't have offset param > > `$offset = $offset + strlen($value);` ;) I mean, in order to restart `preg_replace_callback` with different regex (after...

> For example, here are tokens of PHP language: > https://gist.github.com/SerafimArts/bb9363fbd2d5cca8693cfcdc4631c2f7#file-lexer-php-L24-L178 How does it handle case like ```php "foo" //