Skip to content

Commit

Permalink
Add comment for operand search; rename 'operand' to 'elements'
Browse files Browse the repository at this point in the history
  • Loading branch information
Linda-Njau committed Aug 7, 2024
1 parent ed19dba commit aab5e63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sail_json_backend/json.ml
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ let rec filter_non_operands components =
| _ -> filter_non_operands (List.tl components)

let rec extract_operands k filtered_components =
(*This looks for operands embedded within functions like "funct(op1 @ op2 @ 0b00)" *)
match filtered_components with
| [] -> []
| hd :: tl ->
if Str.string_match (Str.regexp ".+(\\(.*\\))") hd 0 then (
let operand = Str.matched_group 1 hd in
let elements = Str.split (Str.regexp ",") operand in
let elements = Str.split (Str.regexp ",") (Str.matched_group 1 hd) in
let filtered_elements =
match Hashtbl.find_opt inputs k with
| None -> []
Expand Down

0 comments on commit aab5e63

Please sign in to comment.