parsav  Diff

Differences From Artifact [dd405c9e82]:

To Artifact [1d36a792dc]:


    13     13   			for m in l:gmatch('([^:]+)') do path[#path+1]=m end
    14     14   			local tgt = lib
    15     15   			for i=1,#path-1 do
    16     16   				if tgt[path[i]] == nil then tgt[path[i]] = {} end
    17     17   				tgt = tgt[path[i]]
    18     18   			end
    19     19   			local chunk = terralib.loadfile(l:gsub(':','/') .. '.t')
    20         -			if chunk ~= nil then
           20  +			if chunk ~= nil then 
    21     21   				tgt[path[#path]:gsub('-','_')] = chunk()
    22     22   				print(' \27[1m[ \27[32mok\27[;1m ]\27[m')
    23     23   			else
    24     24   				print(' \27[1m[\27[31mfail\27[;1m]\27[m')
    25     25   				os.exit(2)
    26     26   			end
    27     27   		end
................................................................................
   106    106   	trn = macro(function(cond, i, e)
   107    107   		return quote
   108    108   			var c: bool = [cond]
   109    109   			var r: i.tree.type
   110    110   			if c == true then r = i else r = e end
   111    111   		in r end
   112    112   	end);
          113  +	typeof = macro(function(exp) return exp.tree.type end);
   113    114   	coalesce = macro(function(...)
   114    115   		local args = {...}
   115    116   		local ty = args[1].tree.type
   116    117   		local val = symbol(ty)
   117    118   		local empty
   118    119   		if ty.ptr_basetype then empty = `[ty]{ptr=nil,ct=0}
   119    120   		elseif ty.type == 'integer' then empty = `0
................................................................................
   496    497   
   497    498   	'render:conf:profile';
   498    499   	'render:conf:circles';
   499    500   	'render:conf:sec';
   500    501   	'render:conf:users';
   501    502   	'render:conf:avi';
   502    503   	'render:conf';
          504  +
          505  +	'api:lp:actor';
          506  +	'api:lp:tweet';
          507  +	'api:lp:outbox';
          508  +	'api:webfinger';
   503    509   	'route';
   504    510   }
   505    511   
   506    512   do
   507    513   	local p = string.format('parsav: %s\nbuilt on %s\n', config.build.str, config.build.when)
   508    514   	terra version() lib.io.send(1, p, [#p]) end
   509    515   end