mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 11:02:37 +00:00 
			
		
		
		
	docs: add comments to lua converters
This commit is contained in:
		
					parent
					
						
							
								9781a1071d
							
						
					
				
			
			
				commit
				
					
						6891c86c58
					
				
			
		
					 1 changed files with 3 additions and 0 deletions
				
			
		|  | @ -12,6 +12,7 @@ | |||
|     then "nil" | ||||
|     else "'${value}'"; | ||||
| 
 | ||||
|   # convert an expression to lua | ||||
|   expToLua = exp: | ||||
|     if builtins.isList exp | ||||
|     then listToLuaTable exp | ||||
|  | @ -19,9 +20,11 @@ | |||
|     then attrsetToLuaTable exp | ||||
|     else ("\"" + builtins.toJSON exp + "\""); | ||||
| 
 | ||||
|   # convert list to a lua table | ||||
|   listToLuaTable = list: | ||||
|     "{ " + (builtins.concatStringsSep ", " (map expToLua list)) + " }"; | ||||
| 
 | ||||
|   # convert attrset to a lua table | ||||
|   attrsetToLuaTable = attrset: | ||||
|     "{ " | ||||
|     + ( | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 NotAShelf
				NotAShelf