Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mnemonic mapping for pseudoinstructions #45

Draft
wants to merge 12 commits into
base: json
Choose a base branch
from
3 changes: 2 additions & 1 deletion src/sail_json_backend/json.ml
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ let parse_funcl fcl =

let map_arg_to_mnemonic arg id = None

let get_index elem lst = None
let get_index elem lst =
List.find_map (fun (i, x) -> if x = elem then Some i else None) (List.mapi (fun i x -> (i, x)) lst)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use List.find_index instead?


let map_param_to_arg id param args_list =
match Hashtbl.find_opt inputs id with
Expand Down