Skip to content

Commit 2935970

Browse files
committed
UIMacros: added /* line */ comment
1 parent 2edcd5c commit 2935970

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/Bridges/ApplicationLatte/UIMacros.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ public function macroLink(MacroNode $node, PhpWriter $writer)
136136
'echo %escape(%modify('
137137
. ($node->name === 'plink' ? '$this->global->uiPresenter' : '$this->global->uiControl')
138138
. '->link(%node.word, %node.array?)))'
139+
. ($node->startLine ? " /* line $node->startLine */;" : ';')
139140
);
140141
}
141142

tests/Bridges.Latte/UIMacros.link.phpt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ $compiler->setContentType($compiler::CONTENT_TEXT);
1818
UIMacros::install($compiler);
1919

2020
// {link ...}
21-
Assert::same('<?php echo $this->global->uiControl->link("p") ?>', $compiler->expandMacro('link', 'p', '')->openingCode);
22-
Assert::same('<?php echo ($this->filters->filter)($this->global->uiControl->link("p")) ?>', $compiler->expandMacro('link', 'p', 'filter')->openingCode);
23-
Assert::same('<?php echo $this->global->uiControl->link("p:a") ?>', $compiler->expandMacro('link', 'p:a', '')->openingCode);
24-
Assert::same('<?php echo $this->global->uiControl->link($dest) ?>', $compiler->expandMacro('link', '$dest', '')->openingCode);
25-
Assert::same('<?php echo $this->global->uiControl->link($p:$a) ?>', $compiler->expandMacro('link', '$p:$a', '')->openingCode);
26-
Assert::same('<?php echo $this->global->uiControl->link("$p:$a") ?>', $compiler->expandMacro('link', '"$p:$a"', '')->openingCode);
27-
Assert::same('<?php echo $this->global->uiControl->link("p:a") ?>', $compiler->expandMacro('link', '"p:a"', '')->openingCode);
28-
Assert::same('<?php echo $this->global->uiControl->link(\'p:a\') ?>', $compiler->expandMacro('link', "'p:a'", '')->openingCode);
29-
30-
Assert::same('<?php echo $this->global->uiControl->link("p", [\'param\']) ?>', $compiler->expandMacro('link', 'p param', '')->openingCode);
31-
Assert::same('<?php echo $this->global->uiControl->link("p", [\'param\' => 123]) ?>', $compiler->expandMacro('link', 'p param => 123', '')->openingCode);
32-
Assert::same('<?php echo $this->global->uiControl->link("p", [\'param\' => 123]) ?>', $compiler->expandMacro('link', 'p, param => 123', '')->openingCode);
21+
Assert::same('<?php echo $this->global->uiControl->link("p"); ?>', $compiler->expandMacro('link', 'p', '')->openingCode);
22+
Assert::same('<?php echo ($this->filters->filter)($this->global->uiControl->link("p")); ?>', $compiler->expandMacro('link', 'p', 'filter')->openingCode);
23+
Assert::same('<?php echo $this->global->uiControl->link("p:a"); ?>', $compiler->expandMacro('link', 'p:a', '')->openingCode);
24+
Assert::same('<?php echo $this->global->uiControl->link($dest); ?>', $compiler->expandMacro('link', '$dest', '')->openingCode);
25+
Assert::same('<?php echo $this->global->uiControl->link($p:$a); ?>', $compiler->expandMacro('link', '$p:$a', '')->openingCode);
26+
Assert::same('<?php echo $this->global->uiControl->link("$p:$a"); ?>', $compiler->expandMacro('link', '"$p:$a"', '')->openingCode);
27+
Assert::same('<?php echo $this->global->uiControl->link("p:a"); ?>', $compiler->expandMacro('link', '"p:a"', '')->openingCode);
28+
Assert::same('<?php echo $this->global->uiControl->link(\'p:a\'); ?>', $compiler->expandMacro('link', "'p:a'", '')->openingCode);
29+
30+
Assert::same('<?php echo $this->global->uiControl->link("p", [\'param\']); ?>', $compiler->expandMacro('link', 'p param', '')->openingCode);
31+
Assert::same('<?php echo $this->global->uiControl->link("p", [\'param\' => 123]); ?>', $compiler->expandMacro('link', 'p param => 123', '')->openingCode);
32+
Assert::same('<?php echo $this->global->uiControl->link("p", [\'param\' => 123]); ?>', $compiler->expandMacro('link', 'p, param => 123', '')->openingCode);

0 commit comments

Comments
 (0)