| 228 | Consider the following input: |
| 229 | |
| 230 | {{{ |
| 231 | |
| 232 | .sub main |
| 233 | foo(<<'A', 42, <<'B', <<C') |
| 234 | heredoc text a |
| 235 | A |
| 236 | heredoc text b |
| 237 | B |
| 238 | heredoc text c |
| 239 | C |
| 240 | |
| 241 | .end |
| 242 | |
| 243 | }}} |
| 244 | |
| 245 | Now, scanning up to and including the first heredoc marker: |
| 246 | |
| 247 | {{{ |
| 248 | foo(<<'A' |
| 249 | }}} |
| 250 | |
| 251 | is done exactly the same as described in Scenario 1. Assume that the lexer just found the heredoc delimiter for heredoc string A. The lexer's current state is HEREDOC_STRING, but as can be seen in [source:/trunk/compilers/pirc/src/hdocprep.l#L404 line 404], the lexer will now switch to SCAN_STRING state in order to scan the "rest of the line". The rest of the line buffer contains: |
| 252 | |
| 253 | {{{ |
| 254 | , 42, <<'B', <<'C') |
| 255 | }}} |
| 256 | |
| 257 | |