function luaY.subexpr(n,Q,R,Y)n:enterlevel(Q)local x=n:getunopr(Q.t.token)if x~="\079\080\082\095\078\079\085\078\079\080\082"then luaX:next(Q)n:subexpr(Q,R,n.UNARY_PRIORITY)luaK:prefix(Q.fs,x,R)else n:simpleexp(Q,R)end local D=n:getbinopr(Q.t.token)while D~="\079\080\082\095\078\079\066\073\078\079\080\082"and n.priority[luaK.BinOpr[D]+1][1]>Y do local Y={}luaX:next(Q)luaK:infix(Q.fs,D,R)local x=n:subexpr(Q,Y,n.priority[luaK.BinOpr[D]+1][2])luaK:posfix(Q.fs,D,R,Y)D=x end n:leavelevel(Q)return D end

function luaY:subexpr(ls, v, limit)
  self:enterlevel(ls)
  local uop = self:getunopr(ls.t.token)
  if uop ~= "OPR_NOUNOPR" then
    luaX:next(ls)
    self:subexpr(ls, v, self.UNARY_PRIORITY)
    luaK:prefix(ls.fs, uop, v)
  else
    self:simpleexp(ls, v)
  end
  -- expand while operators have priorities higher than 'limit'
  local op = self:getbinopr(ls.t.token)
  while op ~= "OPR_NOBINOPR" and self.priority[luaK.BinOpr[op] + 1][1] > limit do
    local v2 = {}  -- expdesc
    luaX:next(ls)
    luaK:infix(ls.fs, op, v)
    -- read sub-expression with higher priority
    local nextop = self:subexpr(ls, v2, self.priority[luaK.BinOpr[op] + 1][2])
    luaK:posfix(ls.fs, op, v, v2)
    op = nextop
  end
  self:leavelevel(ls)
  return op  -- return first untreated operator
end
