53 |
|
|
54 |
my $class = qq[level-$error_level layer-$error_layer]; |
my $class = qq[level-$error_level layer-$error_layer]; |
55 |
|
|
56 |
$out->start_tag ('dt', class => $class); |
## Line & column numbers (prepare values) |
|
my $has_location; |
|
|
|
|
|
## URL |
|
|
|
|
|
if (defined $opt{url}) { |
|
|
$out->url ($opt{url}); |
|
|
$has_location = 1; |
|
|
} |
|
|
|
|
|
## Line & column number |
|
57 |
|
|
58 |
my $line; |
my $line; |
59 |
my $column; |
my $column; |
62 |
$line = $opt{node}->get_user_data ('manakai_source_line'); |
$line = $opt{node}->get_user_data ('manakai_source_line'); |
63 |
if (defined $line) { |
if (defined $line) { |
64 |
$column = $opt{node}->get_user_data ('manakai_source_column'); |
$column = $opt{node}->get_user_data ('manakai_source_column'); |
65 |
} else { |
} elsif ($opt{node}->isa ('Message::IF::Node')) { |
66 |
if ($opt{node}->node_type == $opt{node}->ATTRIBUTE_NODE) { |
if ($opt{node}->node_type == $opt{node}->ATTRIBUTE_NODE) { |
67 |
my $owner = $opt{node}->owner_element; |
my $owner = $opt{node}->owner_element; |
68 |
if ($owner) { |
if ($owner) { |
87 |
$column = $opt{column}; |
$column = $opt{column}; |
88 |
} |
} |
89 |
} |
} |
90 |
|
$line = $line - 1 || 1 |
91 |
|
if defined $line and not (defined $column and $column > 0); |
92 |
|
|
93 |
|
$out->start_tag ('dt', class => $class, |
94 |
|
'data-type' => $opt{type}, |
95 |
|
'data-level' => $error_level, |
96 |
|
'data-layer' => $error_layer, |
97 |
|
($line ? ('data-line' => $line) : ()), |
98 |
|
($column ? ('data-column' => $column) : ())); |
99 |
|
my $has_location; |
100 |
|
|
101 |
|
## URL |
102 |
|
|
103 |
|
if (defined $opt{url}) { |
104 |
|
$out->url ($opt{url}); |
105 |
|
$has_location = 1; |
106 |
|
} |
107 |
|
|
108 |
|
## Line & column numbers (real output) |
109 |
|
|
110 |
if (defined $line) { |
if (defined $line) { |
111 |
if (defined $column and $column > 0) { |
if (defined $column and $column > 0) { |
112 |
$out->xref ('Line ' . $line, target => 'line-' . $line); |
$out->xref ('Line #', text => $line, target => 'line-' . $line); |
113 |
$out->text (' column ' . $column); |
$out->text (' '); |
114 |
|
$out->nl_text ('column #', text => $column); |
115 |
} else { |
} else { |
116 |
$line = $line - 1 || 1; |
$out->xref ('Line #', text => $line, target => 'line-' . $line); |
|
$out->xref ('Line ' . $line, target => 'line-' . $line); |
|
117 |
} |
} |
118 |
$has_location = 1; |
$has_location = 1; |
119 |
} |
} |
129 |
if (defined $opt{index}) { |
if (defined $opt{index}) { |
130 |
if ($opt{index_has_link}) { |
if ($opt{index_has_link}) { |
131 |
$out->html (' '); |
$out->html (' '); |
132 |
$out->xref ('Index ' . (0+$opt{index}), |
$out->xref ('Index #', text => (0+$opt{index}), |
133 |
target => 'index-' . (0+$opt{index})); |
target => 'index-' . (0+$opt{index})); |
134 |
} else { |
} else { |
135 |
$out->text (' Index ' . (0+$opt{index})); |
$out->html (' '); |
136 |
|
$out->nl_text ('Index #', text => (0+$opt{index})); |
137 |
} |
} |
138 |
$has_location = 1; |
$has_location = 1; |
139 |
} |
} |
162 |
} |
} |
163 |
|
|
164 |
unless ($has_location) { |
unless ($has_location) { |
165 |
$out->text ('No location information available'); |
$out->text ('Unknown location'); |
166 |
} |
} |
167 |
} |
} |
168 |
|
|
187 |
|
|
188 |
## Error message |
## Error message |
189 |
|
|
190 |
$out->text ($error_type_text); |
$out->nl_text ($error_type_text, node => $opt{node}, text => $opt{text}); |
191 |
|
|
192 |
## Additional error description |
## Additional error description |
193 |
|
|
280 |
my $score_base = 20; |
my $score_base = 20; |
281 |
my $score_unit = $score_base / 100; |
my $score_unit = $score_base / 100; |
282 |
for ( |
for ( |
283 |
[Transfer => 'transfer', ''], |
[Transfer => 'transfer', '#transfer-errors'], |
284 |
[Character => 'char', ''], |
[Character => 'char', ''], |
285 |
[Syntax => 'syntax', '#parse-errors'], |
[Syntax => 'syntax', '#parse-errors'], |
286 |
[Structure => 'structure', '#document-errors'], |
[Structure => 'structure', '#document-errors'], |