Skip to content

Leo expressions in map subscription aren't properly identified

The details of a leo expression in a map subscription (and probably in array subscriptions too) isn't properly identified: image

Here is the code snippet surrounding it:

# Find all starting points of the active model
CC "Core" GET_ALL_OBJS_OF_CLASSID modelid:(id_model) classid:(g_val_cid_start)
SETL str_ids_startobjs:(objids)
SETL id_startobj:(0)
IF ((LEN str_ids_startobjs) = 0) {
  CC "AdoScript" ERRORBOX ("The selected model doesn't contain any objects to start at.")
} ELSIF (tokcnt(str_ids_startobjs) = 1) {
  SETL id_startobj:(VAL str_ids_startobjs)
} ELSE {
  # If there is more than one start object then ask the user where to start
  SETL map_startnames:(map())
  SETL str_entries:("")
  FOR str_id_startobj in:(str_ids_startobjs) {
    CC "Core" GET_CLASS_ID objid:(VAL str_id_startobj)
    CC "Core" GET_CLASS_NAME classid:(classid)
    SETL str_cn_start:(classname)
    CC "Core" GET_OBJ_NAME objid:(VAL str_id_startobj)
    #TODO escape the @ character in object names, or find a different separator
    SETL str_label:(objname + " (" + str_cn_start + ")")
    SETL str_entries:(tokcat(str_entries, str_label, "@"))
    SETL map_startnames[str_label]:()
  }
  CC "AdoScript" LISTBOX entries:()
  #TODO when we do the paralelism --> consider allowing to select several starting points and go in parallel
}