Generate commands/fix detp detg command rename (#882)

* replacing detp with sls_Detector_put and detg with sls_detector_get

* sls_detector_not implemented, but extended message to ask user to use sls_detector_get or sls_detector_put

* autocompletion also for sls_detector or det
This commit is contained in:
2023-12-13 17:01:10 +01:00
committed by GitHub
parent 51412f40cf
commit 4f4125a3b2
10 changed files with 223 additions and 178 deletions

View File

@ -93,7 +93,7 @@ class CodeGenerator:
with function('int', f"InferAction::{command['function_alias']}", []) as f:
if (command_name, -1) in non_dist| type_dist:
self.write_line(
f'throw RuntimeError("sls_detector is disabled for command: {command_name}. Use detg or detp");')
f'throw RuntimeError("sls_detector is disabled for command: {command_name}. Use sls_detector_get or sls_detector_put");')
elif not command['infer_action']:
self.write_line('throw RuntimeError("infer_action is disabled");')
else:
@ -107,7 +107,7 @@ class CodeGenerator:
# check if this argc is not distinguishable
if (command_name, arg["argc"]) in non_dist | type_dist:
self.write_line(
f'throw RuntimeError("sls_detector is disabled for command: {command_name} with number of arguments {arg["argc"]}. Use detg or detp");')
f'throw RuntimeError("sls_detector is disabled for command: {command_name} with number of arguments {arg["argc"]}. Use sls_detector_get or sls_detector_put");')
else:
self.write_line(f'return {self.actions_dict[action]};')
with else_block():