From: handa Date: Thu, 25 Feb 2010 23:57:29 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: ALPHA~45 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=83a13979d1689d61fab99bc59e65948ae5a9b186;p=m17n%2Fm17n-lib-js.git *** empty log message *** --- diff --git a/xex.js b/xex.js index a86a5b2..632733e 100644 --- a/xex.js +++ b/xex.js @@ -352,7 +352,7 @@ Xex.Domain.prototype = { }, Defvar: function (name, desc, val, range) { - var vari = new Xex.Variable (name, desc, val, range); + var vari = new Xex.Variable (this, name, desc, val, range); this.variables[name] = vari; return vari; }, @@ -389,9 +389,9 @@ Xex.Domain.prototype = { values = {}; for (var elt in this.variables) { - if (! this.variables[elt].val) - alert ('unknown value of ' + elt); - else + //if (! this.variables[elt].val) + //alert ('unknown value of ' + elt); + //else values[elt] = this.variables[elt].val.Clone (); } return values; @@ -453,7 +453,7 @@ Node.prototype.nextElement = function () var name = node.attributes['vname'].nodeValue; if (! name) throw new Xex.ErrTerm (Xex.Error.NoVariableName, node, ''); - var vari = domain.variables['name']; + var vari = domain.variables[name]; var desc, val, range; if (vari) { @@ -570,26 +570,19 @@ Node.prototype.nextElement = function () if (name == 'defun' || name == 'defmacro') { name = parse_defun_head (domain, node); - MIM.log ('defmacro:' + name); parse_defun_body (domain, node); return new Xex.StrTerm (name); } if (name == 'defvar') { name = parse_defvar (domain, node); - MIM.log ('defvar:' + name); return new Xex.StrTerm (name); } return new Xex.Funcall.prototype.Parser (domain, node); } for (var n = node; n && n != stop; n = n.nextElement ()) - { - if (n.nodeName == 'defun' || n.nodeName == 'defmacro') - { - var name = parse_defun_head (domain, n); - MIM.log ('defmacro:' + name); - } - } + if (n.nodeName == 'defun' || n.nodeName == 'defmacro') + parse_defun_head (domain, n); var terms = null; for (var n = node; n && n != stop; n = n.nextElement ()) { @@ -1754,7 +1747,7 @@ MIM.im_domain.DefType (MIM.State.prototype); function Finsert_candidates (domain, vari, args) { var ic = domain.context; - var candidates = new Candidates (args, column); + var candidates = new MIM.Candidates (args, column); ic.insert (candidates.Current (), candidates); return args[0]; } @@ -1931,7 +1924,8 @@ MIM.im_domain.DefType (MIM.State.prototype); if (vari != null) this.domain.Defvar (vname); } - Xex.Term.Parse (this.domain, node); + vname = Xex.Term.Parse (this.domain, node) + MIM.log ('var:' + this.domain.variables[vname.val].name); } } parsers['command-list'] = function (node) @@ -2034,7 +2028,6 @@ MIM.im_domain.DefType (MIM.State.prototype); parser.call (this, node); } this.load_status = MIM.LoadStatus.Loaded; - MIM.log ('loading done: ' + this.lang + '-' + this.name + '-' + this.extra_id); return true; } }