Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[sipify] support unparsed/raw code
  • Loading branch information
3nids committed May 26, 2021
1 parent bd88d6a commit 2e81f3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/sipify.pl
Expand Up @@ -184,12 +184,14 @@ sub processDoxygenLine {
my $line = $_[0];

# detect code snippet
if ( $line =~ m/\\code(\{\.(\w+)\})?/ ) {
if ( $line =~ m/\\code(\{\.?(\w+)\})?/ ) {
my $codelang = "";
$codelang = " $2" if (defined $2);
$codelang =~ m/(cpp|py|unparsed)/ or exit_with_error("invalid code snippet format: $codelang");
$COMMENT_CODE_SNIPPET = CODE_SNIPPET;
$COMMENT_CODE_SNIPPET = CODE_SNIPPET_CPP if ($codelang =~ m/cpp/ );
$codelang =~ s/py/python/;
$codelang =~ s/unparsed/raw/;
return "\n" if ( $COMMENT_CODE_SNIPPET == CODE_SNIPPET_CPP );
return "\n.. code-block::$codelang\n\n";
}
Expand Down

0 comments on commit 2e81f3b

Please sign in to comment.