return term;
}
+ function Fset (domain, vari, args)
+ {
+ if (! vari)
+ throw new Xex.ErrTerm (Xex.Error.NoVariableName,
+ 'No variable name to set');
+ vari.SetValue (args[0]);
+ return args[0];
+ }
+
function Fadd (domain, vari, args)
{
var n = vari ? vari.val.val : 0;
var result = args[i].Eval (domain);
if (domain.Thrown ())
return result;
- if (result.IsTrue)
+ if (result.IsTrue ())
return Xex.One;
}
return Xex.Zero;
}
+ function Feq (domain, vari, args)
+ {
+ for (var i = 1; i < args.length; i++)
+ if (! args[i - 1].Equals (args[i]))
+ return Xex.Zero;
+ return Xex.One;
+ }
+
function Fprogn (domain, vari, args)
{
var result = Xex.One;
if (domain.Thrown ())
return result;
- if (result.IsTrue)
+ if (result.IsTrue ())
return args[1].Eval (domain);
if (args.length == 2)
return Zero;
return args[2].Eval (domain);
}
+ function Fcond (domain, vari, args)
+ {
+ for (var i = 0; i < args.length; i++)
+ {
+ var list = args[i].val;
+ var result = list.val[0].Eval (doamin);
+ if (result.isTrue ())
+ {
+ for (var j = 1; j < list.val.length; j++)
+ {
+ domain.depth++;
+ result = list.val[j].Eval (domain);
+ domain.depth--;
+ if (domain.Thrown ())
+ return result;
+ }
+ return result;
+ }
+ }
+ return Xex.Zero;
+ }
+
function eval_terms (domain, terms, idx)
{
var result = Xex.Zero;
obj.open ('GET', url, false);
obj.overrideMimeType ('text/xml');
obj.send ('');
+ alert (file);
return obj.responseXML.firstChild;
}
return args[0];
}
+ function Fmove (domain, vari, args)
+ {
+ var ic = domain.context;
+ var pos = args[0].IsInt ? args[0].val : args[0].Position (ic);
+ ic.move (pos);
+ return args[0];
+ }
+
+ function Fmark (domain, vari, args)
+ {
+ args[0].Mark (domain.context);
+ return args[0];
+ }
+
im_domain.DefSubr (Finsert, "insert", false, 1, 1);
im_domain.DefSubr (Finsert_candidates, "insert-candidates", false, 1, 1);
+ im_domain.DefSubr (Fmove, "move", false, 1, 1);
+ im_domain.DefSubr (Fmark, "mark", false, 1, 1);
}) ();
+
(function () {
function get_global_var (vname)
{
for (var macro in im.domain.functions)
im.domain.CopyFunc (this.domain, macro);
}
+ else
+ Xex.Term.Parse (node);
}
}
parsers['title'] = function (node)
MIM.debug_nodes['status' + index].innerHTML = ic.im.load_status;
else
MIM.debug_nodes['status' + index].innerHTML = 'no IM';
- MIM.debug_nodes['keymap' + index].innerHTML = ic.keymap.name;
+ MIM.debug_nodes['keymap' + index].innerHTML = ic.state.name;
MIM.debug_nodes['preedit' + index].innerHTML = ic.preedit;
};