File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ blocks found.
31
31
If the PGML content or a block within fails to parse, then the return hash will
32
32
contain the key C<errors > with a reference to an array of errors that occurred.
33
33
34
+ Also if there are any warnings that occur in the parsing, those will be in the
35
+ C<warnings > key of the return hash.
36
+
34
37
=head2 parseTextBlock
35
38
36
39
my $textElements = parseTextBlock(@lines);
@@ -110,9 +113,10 @@ sub parsePGMLBlock (@lines) {
110
113
111
114
PGML::ClearWarnings();
112
115
my $parser = eval { PGML::Parse-> new($source =~ s /\\\\ / \\ / gr ) };
113
- return { errors => [$@ ] } if $@ ;
116
+ return { errors => [$@ ], warnings => \ @PGML::warnings } if $@ ;
114
117
115
- return $processedBlocks {$sourceHash } = WeBWorK::PG::Critic::Utils::walkPGMLTree($parser -> {root });
118
+ return $processedBlocks {$sourceHash } =
119
+ WeBWorK::PG::Critic::Utils::walkPGMLTree($parser -> {root }, { warnings => \@PGML::warnings });
116
120
}
117
121
118
122
# For now, only contents of \{ .. \} blocks are returned. Add other text elements as needed.
You can’t perform that action at this time.
0 commit comments