Author: gotcha
Date: Sun Dec 28 12:56:10 2008
New Revision: 60712
Modified:
kukit/kukit.js/branch/gotcha-simplify-service-layer/doc/HISTORY.txt
kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/kssparser.js
kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/kukit.js
kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js
kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/selectorreg.js
kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/tokenizer.js
kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_kssparser.js
kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_tokenizer.js
Log:
parser should not access global plugins; should be parameter
Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/doc/HISTORY.txt
==============================================================================
--- kukit/kukit.js/branch/gotcha-simplify-service-layer/doc/HISTORY.txt
(original)
+++ kukit/kukit.js/branch/gotcha-simplify-service-layer/doc/HISTORY.txt Sun Dec
28 12:56:10 2008
@@ -51,7 +51,7 @@
- Refactor the value provider registry to use
a single registry in place of 3.
This will enable to define value
- providers that recieve non-string parameters
+ providers that receive non-string parameters
like a node selection.
[ree]
Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/kssparser.js
==============================================================================
--- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/kssparser.js
(original)
+++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/kssparser.js
Sun Dec 28 12:56:10 2008
@@ -117,7 +117,7 @@
kssp.Document = kukit.tk.mkParser('document', {
"\/\*": _returnComment,
"{": function() {
- return new kssp.Block(this.cursor, kssp.openBrace);
+ return new kssp.Block(this.cursor, kssp.openBrace, false,
this.plugins);
}
},
_Document
@@ -172,7 +172,7 @@
this.parseSelectors = function(key) {
// Parse the part in an embedded parser
var cursor = new kukit.tk.Cursor(key + ' ');
- var parser = new kssp.KssSelectors(cursor, null, true);
+ var parser = new kssp.KssSelectors(cursor, null, true, this.plugins);
var results = [];
var hasFullNames = false;
for(var eventFullName in this.eventFullNames) {
@@ -249,7 +249,7 @@
;;; allowedReturnTypes = {string: true};
;;; kukit.E = 'event parameter [' + key + ']';
// global registry is used
- var registry = kukit.plugins;
+ var registry = this.plugins;
var valuesByReturnType = kukit.va.createAndCheckRuleValues(values,
allowedReturnTypes, registry, false, kukit.E, this);
var value = valuesByReturnType.string;
@@ -303,7 +303,7 @@
;;; kukit.E = 'action definition [' + key + ']';
// check the rule values
// global registry is used
- var registry = kukit.plugins;
+ var registry = this.plugins;
var valuesByReturnType = kukit.va.createAndCheckRuleValues(values,
allowedReturnTypes, registry, false, kukit.E, this);
var value = valuesByReturnType.string;
@@ -347,7 +347,7 @@
;;; allowedReturnTypes = {string: true};
;;; kukit.E = 'Wrong value in action error parameter [' + key + ']';
// global registry is used
- var registry = kukit.plugins;
+ var registry = this.plugins;
var valuesByReturnType = kukit.va.createAndCheckRuleValues(values,
allowedReturnTypes, registry, false, kukit.E, this);
var value = valuesByReturnType.string;
@@ -376,7 +376,7 @@
// (from check).
//
// global registry is used
- var registry = kukit.plugins;
+ var registry = this.plugins;
var value;
var allowedReturnTypes;
var noStringRequired = false;
@@ -925,7 +925,7 @@
// for MethodArgs, for example, does not produce useful txt.
// Instead we take a slice of the original text.
var cursor = new kukit.tk.Cursor(context.txt + ' ');
- var parser = new kssp.KssSelector(cursor, null, true);
+ var parser = new kssp.KssSelector(cursor, null, true, this.plugins);
this.selectors.push(parser.kssSelector);
if (context.nextTokenIndex == this.result.length) break;
this.expectToken(context, kssp.comma);
@@ -1034,7 +1034,7 @@
css = singleword;
}
// global registry is used
- var registry = kukit.plugins;
+ var registry = this.plugins;
// create the selector.
var id = null;
var ppid = null;
@@ -1128,9 +1128,10 @@
*
* Rule processor that interfaces with kukit core
*/
-kssp.KssRuleProcessor = function(href) {
+kssp.KssRuleProcessor = function(href, plugins) {
this.initialize = function() {
+ this.plugins = plugins;
this.href = href;
this.loaded = false;
this.rules = [];
@@ -1149,7 +1150,7 @@
;;; try {
//Build a parser and parse the text into it
var cursor = new kukit.tk.Cursor(this.txt);
- var parser = new kssp.Document(cursor, null, true);
+ var parser = new kssp.Document(cursor, null, true, this.plugins);
// Store event rules in the common list
for (var i=0; i<parser.eventRules.length; i++) {
var rule = parser.eventRules[i];
Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/kukit.js
==============================================================================
--- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/kukit.js
(original)
+++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/kukit.js Sun Dec
28 12:56:10 2008
@@ -118,7 +118,7 @@
;;; msg = "Start loading and processing " + rulelink.href;
;;; msg = msg + " of type " + rulelink.res_type;
;;; kukit.log(msg);
- var ruleprocessor = new _RuleProcessorClass(rulelink.href);
+ var ruleprocessor = new _RuleProcessorClass(rulelink.href,
kukit.plugins);
this._ruleProcessors[this._ruleProcessors.length] = ruleprocessor;
return ruleprocessor;
;;; } else {
Modified:
kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js
==============================================================================
--- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js
(original)
+++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/registries.js
Sun Dec 28 12:56:10 2008
@@ -428,7 +428,6 @@
reg.setupGlobalRegistries = function() {
// instantiate registries
kukit.registrars = {};
- kukit.plugins = {};
kukit.registrars.events = new reg.Registrar('events', this.PluginFactory)
kukit.registrars.bindsequences = new reg.Registrar('bindsequences',
this.BindSequenceFactory)
kukit.registrars.actions = new reg.Registrar('actions',
this.PluginFactory)
@@ -439,6 +438,7 @@
// Finalize global registries
reg.finalizeGlobalRegistries = function() {
var registrars = kukit.registrars;
+ kukit.plugins = {};
registrars.events.bindItems(kukit.plugins, {});
registrars.bindsequences.bindItems(kukit.plugins, {});
registrars.actions.bindItems(kukit.plugins, {});
Modified:
kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/selectorreg.js
==============================================================================
--- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/selectorreg.js
(original)
+++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/selectorreg.js
Sun Dec 28 12:56:10 2008
@@ -39,9 +39,9 @@
this.check = function(args) {
// check does not need to be used here actually.
-;;; if (args.length != 1) {
-;;; throw new Error('internal error, xxxselector() needs 1 argument');
-;;; }
+//;;; if (args.length != 1) {
+//;;; throw new Error('internal error, xxxselector() needs 1 argument');
+//;;; }
};
this.eval = function(args, node, defaultParameters) {
// We don't have orignode if we evaluate from here, consequently
Modified: kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/tokenizer.js
==============================================================================
--- kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/tokenizer.js
(original)
+++ kukit/kukit.js/branch/gotcha-simplify-service-layer/kukit/tokenizer.js
Sun Dec 28 12:56:10 2008
@@ -244,12 +244,14 @@
tk.mkParser = function(symbol, table, _class) {
// Poor man's subclassing.
- f = function(cursor, tokenClass, isTopLevelParser) {
+ f = function(cursor, tokenClass, isTopLevelParser, plugins) {
this.table = table;
this.cursor = cursor;
this.startpos = cursor.pos;
this.finished = false;
this.isTopLevelParser = isTopLevelParser;
+ // used only by Block, KssSelectors and KssSelector
+ this.plugins = plugins;
this.result = [];
if (tokenClass) {
// Reentry with starting token propagated.
@@ -273,7 +275,7 @@
// it, since it may have its own methods!
// This means: the parser class we create
// double inherits from the specified parser class
- // and the paeser base.
+ // and the parser base.
f.prototype = new tk._ParserBase();
var _prototype = new _class();
for (key in _prototype) {
@@ -300,8 +302,7 @@
this.makeMarker = function(pos) {
// create a cursor to mark this position
- var cursor = new tk.Cursor();
- cursor.text = this.text;
+ var cursor = new tk.Cursor(this.text);
cursor.pos = pos;
// Calculate the row and column information on the cursor
cursor.calcRowCol();
Modified:
kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_kssparser.js
==============================================================================
--- kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_kssparser.js
(original)
+++ kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_kssparser.js
Sun Dec 28 12:56:10 2008
@@ -65,6 +65,7 @@
//
// finalize the registries we just set up
kukit.reg.cleanRoomFinalize(this);
+ this.plugins = kukit.plugins;
};
this.tearDown = function() {
@@ -377,14 +378,14 @@
var txt= "";
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.eventRules.length, 0);
// In particular, this should not raise unexpected eof.
var txt= "/*xxx*/";
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.eventRules.length, 0);
};
@@ -462,7 +463,7 @@
// XXX TODO change comments
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.eventRules.length, 14);
var rule;
@@ -772,7 +773,7 @@
+" kukitresponse-error : errors;\n"
+"}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.eventRules.length, 1);
var rule;
@@ -806,7 +807,7 @@
+" default-error : errors;\n"
+"}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.eventRules.length, 1);
var rule;
@@ -920,7 +921,7 @@
+ " log-message: kssAttr('name');\n"
+ "}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.eventRules.length, 1);
var rule;
@@ -1000,7 +1001,7 @@
+ " setAttribute-value: value;\n"
+ "}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
};
@@ -1018,7 +1019,7 @@
+ " setAttribute-value: value;\n"
+ "}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
};
@@ -1050,7 +1051,7 @@
+ " doIt-kssSubmitForm: form('name');\n"
+ "}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
};
@@ -1066,7 +1067,7 @@
+ " doIt-kssSubmitForm: 'name';\n"
+ "}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
};
@@ -1095,7 +1096,7 @@
+ " action-client: htmlid(id) doIt;\n"
+ "}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
};
@@ -1123,7 +1124,7 @@
+ " action-server: doIt currentForm();\n"
+ "}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
};
@@ -1151,7 +1152,7 @@
+ " action-server: doIt url('http://foo.bar');\n"
+ "}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
};
@@ -1165,7 +1166,7 @@
+ " action-server: doIt url('http://foo.bar');\n"
+ "}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
};
@@ -1179,7 +1180,7 @@
+ " action-server: doIt currentForm()
url('http://foo.bar');\n"
+ "}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
};
@@ -1303,7 +1304,7 @@
+ " doAlias-foo: bar;\n"
+ "}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
};
@@ -1349,7 +1350,7 @@
// Parsing event selector params
var txt= "a:dnd-drag(hello)";
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.KssSelector(cursor, null, true);
+ var parser = new kukit.kssp.KssSelector(cursor, null, true,
this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css, 'a');
@@ -1360,7 +1361,7 @@
this.testKssSelector = function() {
var txt= "a:dnd-drag(hello)";
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.KssSelector(cursor, null, true);
+ var parser = new kukit.kssp.KssSelector(cursor, null, true,
this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css, 'a');
@@ -1377,7 +1378,7 @@
// but we tolerate it
txt= " a div#id:dnd-drag( hello)";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css, ' a div#id');
this.assertEquals(parser.kssSelector.name, 'dnd-drag');
@@ -1397,14 +1398,14 @@
txt= "a div#id:click ";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css, 'a div#id');
this.assertEquals(parser.kssSelector.name, 'click');
txt= "a div.class:click ";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css, 'a div.class');
@@ -1412,7 +1413,7 @@
txt= "a:click ";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css, 'a');
@@ -1454,14 +1455,14 @@
// A valid attr selector in the css selector part.
txt= "a[href=hello].class:lang(hu) div#id:click ";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css,
"a[href=hello].class:lang(hu) div#id");
this.assertEquals(parser.kssSelector.name, 'click');
txt= "a[href=hello].class:lang(hu) div#id:click(hello) ";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css,
"a[href=hello].class:lang(hu) div#id");
@@ -1477,7 +1478,7 @@
// txt= " a:lang(hu, uh) b:click "; // XXX not supported
txt= " a:lang(hu-uh) b:click ";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css, " a:lang(hu-uh) b");
@@ -1486,7 +1487,7 @@
// Comment in the end
txt= " a:lang(hu-uh) b:click/*comment here*/";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css, " a:lang(hu-uh) b");
@@ -1495,7 +1496,7 @@
// Should be ok.
txt= "a:lang(hu)/*comment here*/b:click ";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css, "a:lang(hu)/*comment
here*/b");
this.assertEquals(parser.kssSelector.name, 'click');
@@ -1503,7 +1504,7 @@
// Should be ok.
txt= "a:lang(hu) click/*comment here*/b:load ";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css, "a:lang(hu) click/*comment
here*/b");
@@ -1531,11 +1532,11 @@
txt= "/*comment here*/div:click ";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
txt= " no-document:click(hello)";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css, " no-document");
@@ -1547,7 +1548,7 @@
txt= " document:click(hello) ";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.kssSelector.isMethodSelector, true);
this.assertEquals(parser.kssSelector.css, 'document');
@@ -1556,7 +1557,7 @@
txt= " document:dnd-drag(hello) ";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.kssSelector.isMethodSelector, true);
this.assertEquals(parser.kssSelector.css, 'document');
@@ -1576,7 +1577,7 @@
// also, "behaviour:" works
txt= " behaviour:click(hello) ";
cursor = new kukit.tk.Cursor(txt);
- parser = new kukit.kssp.KssSelector(cursor, null, true);
+ parser = new kukit.kssp.KssSelector(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.kssSelector.isMethodSelector, true);
this.assertEquals(parser.kssSelector.css, 'behaviour');
@@ -1643,7 +1644,7 @@
this.testSingleSelector = function() {
var txt= "a:dnd-drag(hello)";
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.KssSelectors(cursor, null, true);
+ var parser = new kukit.kssp.KssSelectors(cursor, null, true,
this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.selectors.length, 1);
var kssSelector = parser.selectors[0];
@@ -1656,7 +1657,7 @@
this.testMultipleSelectors = function() {
var txt= "a:dnd-drag(hello), div a:click";
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.KssSelectors(cursor, null, true);
+ var parser = new kukit.kssp.KssSelectors(cursor, null, true,
this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.selectors.length, 2);
var kssSelector = parser.selectors[0];
@@ -1674,7 +1675,7 @@
this.testMultipleSelectorsWithComment = function() {
var txt= "a:dnd-drag(hello), /* a comment */ div a:click";
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.KssSelectors(cursor, null, true);
+ var parser = new kukit.kssp.KssSelectors(cursor, null, true,
this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.selectors.length, 2);
var kssSelector = parser.selectors[0];
@@ -1691,7 +1692,7 @@
this.testSingleSelectorWithCommaInDoubleQuoteStringInSelector = function()
{
var txt = 'a[value="Hi, I am a comma"]:dnd-drag(hello)';
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.KssSelectors(cursor, null, true);
+ var parser = new kukit.kssp.KssSelectors(cursor, null, true,
this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.selectors.length, 1);
var kssSelector = parser.selectors[0];
@@ -1704,7 +1705,7 @@
this.testSingleSelectorWithCommaInSingleQuoteStringInSelector = function()
{
var txt = "a[value='Hi, I am a comma']:dnd-drag(hello)";
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.KssSelectors(cursor, null, true);
+ var parser = new kukit.kssp.KssSelectors(cursor, null, true,
this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.selectors.length, 1);
var kssSelector = parser.selectors[0];
@@ -1717,7 +1718,7 @@
this.testMultipleSelectorsWithCommaInDoubleQuoteStringInSelector =
function() {
var txt = 'a[value="Hi, I am a comma"]:dnd-drag(hello), div a:click';
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.KssSelectors(cursor, null, true);
+ var parser = new kukit.kssp.KssSelectors(cursor, null, true,
this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.selectors.length, 2);
var kssSelector = parser.selectors[0];
@@ -1734,7 +1735,7 @@
this.testMultipleSelectorsWithCommaInSingleQuoteStringInSelector =
function() {
var txt = "a[value='Hi, I am a comma']:dnd-drag(hello), div a:click";
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.KssSelectors(cursor, null, true);
+ var parser = new kukit.kssp.KssSelectors(cursor, null, true,
this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.selectors.length, 2);
var kssSelector = parser.selectors[0];
@@ -1751,7 +1752,7 @@
this.testMultipleSelectorsWithCommentAndNewline = function() {
var txt= "a:dnd-drag(hello), /* a comment */ \n div a:click";
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.KssSelectors(cursor, null, true);
+ var parser = new kukit.kssp.KssSelectors(cursor, null, true,
this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.selectors.length, 2);
var kssSelector = parser.selectors[0];
@@ -1768,7 +1769,7 @@
this.testMultipleSelectorsWithNewline = function() {
var txt= "a:dnd-drag(hello), \n div a:click";
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.KssSelectors(cursor, null, true);
+ var parser = new kukit.kssp.KssSelectors(cursor, null, true,
this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.selectors.length, 2);
var kssSelector = parser.selectors[0];
@@ -1822,7 +1823,7 @@
+" action-server : kukitresponse/kukitGetPreviousMonth;\n"
+"}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.eventRules.length, 2);
var rule;
@@ -1864,7 +1865,7 @@
+" action-server : kukitresponse/kukitGetPreviousMonth;\n"
+"}\n"
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.eventRules.length, 2);
var rule;
@@ -1951,7 +1952,7 @@
var txt= "a:click(kssAttr(hello))";
var src = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.KssSelector(src, null, true);
+ var parser = new kukit.kssp.KssSelector(src, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css, 'a');
@@ -1965,7 +1966,7 @@
this.testValueProvidersInEventIdentification2 = function() {
var txt= "a:click(kssAttr(hello, true ))";
var src = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.KssSelector(src, null, true);
+ var parser = new kukit.kssp.KssSelector(src, null, true, this.plugins);
this.assertEquals(parser.finished, true);
this.assertEquals(parser.kssSelector.isEventSelector, true);
this.assertEquals(parser.kssSelector.css, 'a');
@@ -1981,7 +1982,7 @@
var txt= "a:click(kssAttr(hello, true))";
var src = new kukit.tk.Cursor(txt);
var src = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.KssSelector(src, null, true);
+ var parser = new kukit.kssp.KssSelector(src, null, true, this.plugins);
};
this.testValueProvidersInEventIdentificationRejectsMoreParameters =
function() {
@@ -2011,7 +2012,7 @@
+" getCurrentTime-effect: klah; \n"
+"}\n";
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
};
@@ -2024,7 +2025,7 @@
+" getCurrentTime-effect: blah; \n"
+"}\n";
var cursor = new kukit.tk.Cursor(txt);
- var parser = new kukit.kssp.Document(cursor, null, true);
+ var parser = new kukit.kssp.Document(cursor, null, true, this.plugins);
this.assertEquals(parser.finished, true);
};
Modified:
kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_tokenizer.js
==============================================================================
--- kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_tokenizer.js
(original)
+++ kukit/kukit.js/branch/gotcha-simplify-service-layer/tests/test_tokenizer.js
Sun Dec 28 12:56:10 2008
@@ -50,7 +50,9 @@
return; }
var exc = null;
try {
- new pclass(cursor, tokenClass, eofOk);
+ // this.plugins is setup and used only by tests on Document, Block,
+ // KssSelectors and KssSelector
+ new pclass(cursor, tokenClass, eofOk, this.plugins);
} catch(e) {
exc = e;
// We have two errors we have to look for. ParsingError is raised
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins