Author: reebalazs
Date: Tue Jan 29 23:20:24 2008
New Revision: 51118
Modified:
kukit/kukit.js/trunk/kukit/kssparser.js
Log:
Fix action-cancel handling (to circa back how it was before)
Modified: kukit/kukit.js/trunk/kukit/kssparser.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/kssparser.js (original)
+++ kukit/kukit.js/trunk/kukit/kssparser.js Tue Jan 29 23:20:24 2008
@@ -292,7 +292,8 @@
;;; // action-client
;;; allowedReturnTypes = {string: true, selection: true, alias: true};
;;; } else {
-;;; allowedReturnTypes = {string: true, selection: true};
+;;; // action-cancel
+;;; allowedReturnTypes = {string: true};
;;; }
;;; kukit.E = 'action definition [' + key + ']';
var valuesByReturnType = this.preprocessValues(values, allowedReturnTypes,
kukit.E);
@@ -313,15 +314,18 @@
;;; this.emitError(kukit.E);
;;; }
// set it
- if (actionType != 'X') {
- // any other qualifier then delete
- var action = this.actions.getOrCreateAction(value.txt,
valuesByReturnType);
- if (action.type == null) {
- action.setType(actionType);
- }
- } else {
- // action-cancel
+ var action = this.actions.getOrCreateAction(value.txt, valuesByReturnType);
+ if (actionType == 'X' && action.type == null) {
+ // action-cancel, and the action existed already in the same block:
+ // we delete it straight ahead
this.actions.deleteAction(value.txt);
+ } else {
+ // any other qualifier then delete,
+ // or action-cancel but there has been no action defined yet in the
block:
+ // set the action type.
+ // (Remark: in case of action-cancel we set action's type to X, and
+ // the cancellation will possibly happen later, during the merging.)
+ action.setType(actionType);
}
};
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins