@ -93,7 +93,7 @@ let stmt_checkers_list = List.map ~f:single_to_multi stmt_single_checkers_list
input the linter def files * )
let parsed_linters = ref []
let evaluate_place_holder ph an =
let evaluate_place_holder context ph an =
match ph with
| " %ivar_name% "
-> MF . monospaced_to_string ( CFrontend_checkers . ivar_name an )
@ -106,7 +106,7 @@ let evaluate_place_holder ph an =
| " %receiver_method_call% "
-> MF . monospaced_to_string ( CFrontend_checkers . receiver_method_call an )
| " %iphoneos_target_sdk_version% "
-> MF . monospaced_to_string ( CFrontend_checkers . iphoneos_target_sdk_version an)
-> MF . monospaced_to_string ( CFrontend_checkers . iphoneos_target_sdk_version context an)
| " %available_ios_sdk% "
-> MF . monospaced_to_string ( CFrontend_checkers . available_ios_sdk an )
| " %class_available_ios_sdk% "
@ -127,19 +127,19 @@ let evaluate_place_holder ph an =
other place - holders exist and repeats the process until there are
no place - holder left .
* )
let rec expand_message_string message an =
let rec expand_message_string context message an =
(* reg exp should match alphanumeric id with possibly somee _ *)
let re = Str . regexp " %[a-zA-Z0-9_]+% " in
try
let _ = Str . search_forward re message 0 in
let ms = Str . matched_string message in
let res = evaluate_place_holder ms an in
let res = evaluate_place_holder context ms an in
L . ( debug Linters Medium ) " @ \n Matched string '%s'@ \n " ms ;
let re_ms = Str . regexp_string ms in
let message' = Str . replace_first re_ms res message in
L . ( debug Linters Medium ) " Replacing %s in message: @ \n %s @ \n " ms message ;
L . ( debug Linters Medium ) " Resulting message: @ \n %s @ \n " message' ;
expand_message_string message' an
expand_message_string context message' an
with Not_found -> message
let remove_new_lines message = String . substr_replace_all ~ pattern : " \n " ~ with_ : " " message
@ -441,7 +441,7 @@ let get_current_method context (an: Ctl_parser_types.ast_node) =
-> context . CLintersContext . current_method
let fill_issue_desc_info_and_log context an key issue_desc linters_def_file loc =
let desc = remove_new_lines ( expand_message_string issue_desc. CIssue . description an ) in
let desc = remove_new_lines ( expand_message_string context issue_desc. CIssue . description an ) in
let issue_desc' = { issue_desc with CIssue . description = desc ; CIssue . loc = loc } in
log_frontend_issue context . CLintersContext . translation_unit_context
( get_current_method context an ) key issue_desc' linters_def_file