@@ -1066,17 +1066,21 @@ private function getClangErrorFileList ($clang_output) {
1066
1066
// Get all the 'filename.extension:line' elements. Include only those followed by an 'error' statement.
1067
1067
$ tag_free_content = strip_tags ($ clang_output ); // Remove color tags (as many as possible).
1068
1068
1069
- $ clang_matches = preg_split ('/(([ !@#$%^&*()-+" \' <>?]*\w*) +\.\w+:\d+:)/ ' , $ tag_free_content , -1 , PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
1069
+ $ clang_matches = preg_split ('/([\w*\s*( !@#$%^&*()-+; \' {}\[\])*] +\.\w+:\d+:[\d+:]? )/ ' , $ tag_free_content , -1 , PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
1070
1070
1071
1071
$ elements = array ();
1072
1072
foreach ($ clang_matches as $ key => $ val ) {
1073
- if (preg_match ('/(([ !@#$%^&*()-+" \' <>?]*\w*) +\.\w+:\d+:)/ ' , $ val )
1073
+ if (preg_match ('/([\w*\s*( !@#$%^&*()-+; \' {}\[\])*] +\.\w+:\d+:[\d+:]? )/ ' , $ val )
1074
1074
&& array_key_exists ($ key + 1 , $ clang_matches )
1075
1075
&& (strpos ($ clang_matches [$ key +1 ],"error: " ) !== false
1076
1076
|| strpos ($ clang_matches [$ key +1 ],"note: " ) !== false
1077
1077
|| strpos ($ clang_matches [$ key +1 ],"in asm " ) !== false
1078
- || strpos ($ clang_matches [$ key ],"in asm " ) !== false ))
1078
+ || strpos ($ clang_matches [$ key ],"in asm " ) !== false )) {
1079
+ if (strpos ($ val , "In file included from " ) !== false )
1080
+ $ val = str_replace ("In file included from " , "" , $ val );
1081
+ $ val = str_replace ("In file included from " , "" , $ val );
1079
1082
$ elements [] = $ val ;
1083
+ }
1080
1084
}
1081
1085
1082
1086
// Split the elements from above and get an associative array structure of [filename => lines]
@@ -1103,7 +1107,7 @@ private function getGccErrorFileList ($avr_output) {
1103
1107
*/
1104
1108
// Get all 'filename.extension:line' elements.
1105
1109
// Note that avr-gcc output only includes filenames and lines in error reporting, not collumns.
1106
- preg_match_all ('/(([ !@#$%^&*()-+" \' <>?]*\w*) +\.\w+:\d+:)/ ' , $ avr_output , $ gcc_matches , PREG_PATTERN_ORDER );
1110
+ preg_match_all ('/([\w*\s*( !@#$%^&*()-+; \' {}\[\])*] +\.\w+:\d+:[\d+:]? )/ ' , $ avr_output , $ gcc_matches , PREG_PATTERN_ORDER );
1107
1111
1108
1112
$ gcc_elements = array ();
1109
1113
foreach ($ gcc_matches [0 ] as $ element ) {
@@ -1135,10 +1139,10 @@ private function cleanUpClangOutput ($clang_output, $compiler_config, $option) {
1135
1139
foreach ($ content_line_array as $ key => $ line ) {
1136
1140
1137
1141
if ((strpos ($ line , "In file included from " ) !== false
1138
- && preg_match ('/(([ !@#$%^&*()-+" \' <>?]*\w*) +\.\w+:\d+:)/ ' , $ line ))
1139
- || (preg_match ('/(([ !@#$%^&*()-+" \' <>?]*\w*) +\.\w+:\d+:)/ ' , $ line )
1142
+ && preg_match ('/([\w*\s*( !@#$%^&*()-+; \' {}\[\])*] +\.\w+:\d+:[\d+:]? )/ ' , $ line ))
1143
+ || (preg_match ('/([\w*\s*( !@#$%^&*()-+; \' {}\[\])*] +\.\w+:\d+:[\d+:]? )/ ' , $ line )
1140
1144
&& strpos ($ line , "error: " ) !== false )
1141
- || (preg_match ('/(([ !@#$%^&*()-+" \' <>?]*\w*) +\.\w+:\d+:)/ ' , $ line )
1145
+ || (preg_match ('/([\w*\s*( !@#$%^&*()-+; \' {}\[\])*] +\.\w+:\d+:[\d+:]? )/ ' , $ line )
1142
1146
&& strpos ($ line , "note: " ) !== false )) {
1143
1147
1144
1148
if ($ header_found === false ) {
0 commit comments