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
9 changes: 8 additions & 1 deletion src/sail_json_backend/json.ml
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,14 @@ let parse_funcl fcl =

let map_arg_to_mnemonic arg id = None

let map_param_to_arg id param args_list = None
let get_index elem lst = None

let map_param_to_arg id param args_list =
match Hashtbl.find_opt inputs id with
| Some inputl -> (
match get_index param inputl with Some index -> List.nth_opt args_list index | None -> None
Copy link
Owner

Choose a reason for hiding this comment

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

Does dune fmt leave this on a single line? If possible, I'd prefer multiple lines here.
Nice use of List.nth_opt! 🙂

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, that's dune fmt
Thanks : )

)
| None -> None

let get_mnemonic id args_list =
match Hashtbl.find_opt assembly id with
Expand Down