@@ -15,17 +15,19 @@ can be expressed in pure PHP code, and the implementation is fast enough).
1515composer require yay/yay:dev-master
1616```
1717
18- ## Command Line
18+ ## Usage
19+
20+ ### Command Line
1921
2022```
2123yay some/file/with/macros.php >> target/file.php
2224```
2325
24- ## Real Time Mode
26+ ### Runtime Mode
2527
26- Real time mode is W.I.P and will use stream wrappers along with composer integration in order
27- to preprocess every file that is included. It may have some opcache/cache support, so files are
28- only preprocessed/expanded once.
28+ The "runtime" mode is W.I.P and will use stream wrappers along with composer integration in order
29+ to preprocess every file that gets included. It may have some opcache/cache support, so files will be
30+ only preprocessed/expanded once and when needed .
2931
3032See feature progress at issue [ #11 ] ( https://github.com/marcioAlmada/yay/issues/11 ) .
3133
@@ -58,20 +60,20 @@ class Foo { | class Foo {
5860Apart from literal characher sequences, it's also possible to match specific token types using the token matcher in
5961the form of ` TOKEN_TYPE·label ` .
6062
61- The following macro matches token sequences like ` swap! ($x, $y)` or ` swap! ($foo, $bar)` :
63+ The following macro matches token sequences like ` __swap ($x, $y)` or ` __swap ($foo, $bar)` :
6264
6365``` php
6466macro {
65- swap ! ( T_VARIABLE·A , T_VARIABLE·B ) // swap values between two variables
67+ __swap ( T_VARIABLE·A , T_VARIABLE·B ) // swap values between two variables
6668} >> {
6769 (list(T_VARIABLE·A, T_VARIABLE·B) = [T_VARIABLE·B, T_VARIABLE·A])
6870}
6971```
7072
7173The expansion should be pretty obvious:
7274``` php
73- // source | // expansion
74- swap! ($foo, $bar); | (list($foo, $bar) = [$bar, $foo]);
75+ // source | // expansion
76+ __swap ($foo, $bar); | (list($foo, $bar) = [$bar, $foo]);
7577```
7678
7779### Another Simple Example
0 commit comments