Skip to content

Commit

Permalink
#528 - Add source code as comments to compiled tag functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
maraf committed Jan 11, 2024
1 parent cf2a3fe commit 1ec22b9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/scripts/php/classes/TemplateParser.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,15 @@ private function parsefulltag($ctag) {
if ($functionName != null) {
$this->generateAttributePropertyFunctions($attributes->Attributes);
$this->propertyFunctionsToGenerate = $prevProperties;

$indexOfNewLine = strpos($ctag[0], PHP_EOL);
if ($indexOfNewLine > 0) {
$sourceLine = substr($ctag[0], 0, $indexOfNewLine);
} else {
$sourceLine = $ctag[0];
}
$code = $this->Code->addLine("// " . $sourceLine);

return $this->generateFunctionOutput($uniqueIdentifier, $object[0], $object[1], $hasBodyTemplate, $functionName, $attributes);
}
}
Expand Down

0 comments on commit 1ec22b9

Please sign in to comment.