diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/lua/lua.luadoc | 70 |
1 files changed, 42 insertions, 28 deletions
diff --git a/modules/lua/lua.luadoc b/modules/lua/lua.luadoc index 54316c96..f4b16f79 100644 --- a/modules/lua/lua.luadoc +++ b/modules/lua/lua.luadoc @@ -1832,6 +1832,10 @@ function lpeg.Carg(n) end -- name. A Complete capture means that the entire pattern corresponding to the -- capture has matched. An Outermost capture means that the capture is not -- inside another complete capture. +-- +-- In the same way that LPeg does not specify when it evaluates captures, it +-- does not specify whether it reuses values previously produced by the group or +-- re-evaluates them. function lpeg.Cb(name) end --- @@ -1895,17 +1899,18 @@ function lpeg.Cp() end function lpeg.Cs(patt) end --- --- Creates a table capture. This capture creates a table and puts all values --- from all anonymous captures made by `patt` inside this table in successive --- integer keys, starting at 1. Moreover, for each named capture group created --- by `patt`, the first value of the group is put into the table with the group +-- Creates a table capture. This capture returns a table with all values from +-- all anonymous captures made by `patt` inside this table in successive integer +-- keys, starting at 1. Moreover, for each named capture group created by +-- `patt`, the first value of the group is put into the table with the group -- name as its key. The captured value is only the table. function lpeg.Ct(patt) end --- -- Creates a match-time capture. Unlike all other captures, this one is --- evaluated immediately when a match occurs. It forces the immediate evaluation --- of all its nested captures and then calls `function`. +-- evaluated immediately when a match occurs (even if it is part of a larger +-- pattern that fails later). It forces the immediate evaluation of all its +-- nested captures and then calls `function`. -- -- The given function gets as arguments the entire subject, the current position -- (after the match of `patt`), plus any capture values produced by `patt`. @@ -1927,12 +1932,13 @@ function lpeg.Cmt(patt, function) end --- -- Returns a table with the file attributes corresponding to filepath (or nil -- followed by an error message in case of error). If the second optional --- argument is given, then only the value of the named attribute is returned --- (this use is equivalent to lfs.attributes(filepath).aname, but the table is --- not created and only one attribute is retrieved from the O.S.). The --- attributes are described as follows; attribute mode is a string, all the --- others are numbers, and the time related attributes use the same time --- reference of os.time: +-- argument is given and is a string, then only the value of the named attribute +-- is returned (this use is equivalent to lfs.attributes(filepath)[aname], but +-- the table is not created and only one attribute is retrieved from the O.S.). +-- If a table is passed as the second argument, it is filled with attributes and +-- returned instead of a new table. The attributes are described as follows; +-- attribute mode is a string, all the others are numbers, and the time related +-- attributes use the same time reference of os.time: -- dev: on Unix systems, this represents the device that the inode resides on. -- On Windows systems, represents the drive number of the disk containing -- the file @@ -1950,6 +1956,7 @@ function lpeg.Cmt(patt, function) end -- modification: time of last data modification -- change: time of last file status change -- size: file size, in bytes +-- permissions: file permissions string -- blocks: block allocated for file; (Unix only) -- blksize: optimal file system I/O blocksize; (Unix only) -- @@ -1957,7 +1964,7 @@ function lpeg.Cmt(patt, function) end -- link, it is followed (if it points to another link the chain is followed -- recursively) and the information is about the file it refers to. To obtain -- information about the link itself, see function lfs.symlinkattributes. -function lfs.attributes(filepath [, aname]) end +function lfs.attributes(filepath [, aname | atable]) end --- -- Changes the current working directory to the given path. @@ -1967,7 +1974,7 @@ function lfs.chdir(path) end --- -- Creates a lockfile (called lockfile.lfs) in path if it does not exist and --- returns the lock. If the lock already exists checks it it's stale, using the +-- returns the lock. If the lock already exists checks if it's stale, using the -- second parameter (default for the second parameter is INT_MAX, which in -- practice means the lock will never be stale. To free the the lock call -- lock:free(). @@ -1998,34 +2005,41 @@ function lfs.dir(path) end -- -- Returns true if the operation was successful; in case of error, it returns -- nil plus an error string. -function lfs.lock(filehandle, mode[, start[, length]]) +function lfs.lock(filehandle, mode[, start[, length]]) end + +--- +-- Creates a link. The first argument is the object to link to and the second is +-- the name of the link. If the optional third argument is true, the link will +-- be a symbolic link (by default, a hard link is created). +function lfs.link(old, new[, symlink]) end --- -- Creates a new directory. The argument is the name of the new directory. -- --- Returns true if the operation was successful; in case of error, it returns --- nil plus an error string. +-- Returns true in case of success or nil, an error message and a +-- system-dependent error code in case of error. function lfs.mkdir(dirname) end --- -- Removes an existing directory. The argument is the name of the directory. -- --- Returns true if the operation was successful; in case of error, it returns --- nil plus an error string. +-- Returns true in case of success or nil, an error message and a +-- system-dependent error code in case of error. function lfs.rmdir(dirname) end --- --- Sets the writing mode for a file. The mode string can be either binary or --- text. Returns the previous mode string for the file. This function is only --- available in Windows, so you may want to make sure that lfs.setmode exists --- before using it. +-- Sets the writing mode for a file. The mode string can be either "binary" or +-- "text". Returns true followed by the previous mode string for the file, or +-- nil followed by an error string in case of errors.. On non-Windows platforms, +-- where the two modes are identical, setting the mode has no effect, and the +-- mode is always returned as binary. function lfs.setmode(file, mode) end --- -- Identical to lfs.attributes except that it obtains information about the link --- itself (not the file it refers to). This function is not available in Windows --- so you may want to make sure that lfs.symlinkattributes exists before using --- it. +-- itself (not the file it refers to). It also adds a target field, containing +-- the file name that the symlink points to. On Windows this function does not +-- yet support links, and is identical to lfs.attributes. function lfs.symlinkattributes(filepath [, aname]) end --- @@ -2036,8 +2050,8 @@ function lfs.symlinkattributes(filepath [, aname]) end -- standard function os.time). If the modification time is omitted, the access -- time provided is used; if both times are omitted, the current time is used. -- --- Returns true if the operation was successful; in case of error, it returns --- nil plus an error string. +-- Returns true in case of success or nil, an error message and a +-- system-dependent error code in case of error. function lfs.touch(filepath [, atime [, mtime]]) end --- |