link fix in docs and anti-global jihad

This commit is contained in:
steve donovan 2013-02-13 14:15:29 +02:00
parent 55bbeed4f4
commit 394ba636bc
6 changed files with 14 additions and 11 deletions

View File

@ -707,7 +707,7 @@ LDoc knows about the basic Lua libraries, so that it can be used as a handy cons
v
message
Thanks to mitchell's [TextAdept](http://code.google.com/p/textadept/) project, LDoc has a
Thanks to Mitchell's [Textadept](http://foicica.com/textadept/) project, LDoc has a
set of `.luadoc` files for all the standard tables, plus
[LuaFileSystem](http://keplerproject.github.com/luafilesystem/) and
[LPeg](http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html).

View File

@ -78,6 +78,7 @@ local quit = utils.quit
class.ModuleMap(KindMap)
local ModuleMap = ModuleMap
function ModuleMap:_init ()
self.klass = ModuleMap
@ -541,7 +542,7 @@ local function style_dir (sname)
elseif type(style) == 'string' and path.isdir(style) then
dir = style
else
quit(quote(tostring(name)).." is not a directory")
quit(quote(tostring(style)).." is not a directory")
end
args[sname] = dir
end

View File

@ -631,7 +631,7 @@ function Item:finish()
acc ((']'):rep(npending))
npending=0
end
if m.opt or m.optchain then acc('['); npending=npending+1 end
if m.opt or m.optchain then acc(' ['); npending=npending+1 end
end
if i>1 then acc (', ') end
acc(names[i])
@ -656,7 +656,7 @@ end
function Item:warning(msg)
local file = self.file and self.file.filename
if type(file) == 'table' then pretty.dump(file); file = '?' end
if type(file) == 'table' then require 'pl.pretty'.dump(file); file = '?' end
file = file or '?'
io.stderr:write(file,':',self.lineno or '1',': ',self.name or '?',': ',msg,'\n')
return nil

View File

@ -7,11 +7,11 @@ local class = require 'pl.class'
local utils = require 'pl.utils'
local tools = require 'ldoc.tools'
local lexer = require 'ldoc.lexer'
local quit = utils.quit
local tnext = lexer.skipws
class.Lang()
local Lang = class()
function Lang:trim_comment (s)
return s:gsub(self.line_comment,'')
@ -67,7 +67,7 @@ function Lang:parse_module_modifier (tags, tok)
end
class.Lua(Lang)
local Lua = class(Lang)
function Lua:_init()
self.line_comment = '^%-%-+' -- used for stripping
@ -224,7 +224,7 @@ function Lua:parse_module_modifier (tags, tok, F)
if tags.class ~= 'field' then return nil,"cannot deduce @usage" end
local t1= tnext(tok)
if t1 ~= '[' then return nil, t1..' '..': not a long string' end
t, v = tools.grab_block_comment('',tok,'%]%]')
local t, v = tools.grab_block_comment('',tok,'%]%]')
return true, v, 'usage'
elseif tags.export then
if tags.class ~= 'table' then return nil, "cannot deduce @export" end
@ -241,7 +241,7 @@ end
-- note a difference here: we scan C/C++ code in full-text mode, not line by line.
-- This is because we can't detect multiline comments in line mode
class.CC(Lang)
local CC = class(Lang)
function CC:_init()
self.line_comment = '^//+'
@ -251,6 +251,7 @@ function CC:_init()
end
function CC.lexer(f)
local err
f,err = utils.readfile(f)
if not f then quit(err) end
return lexer.cpp(f,{})

View File

@ -23,7 +23,7 @@ local luadoc_tag_value = luadoc_tag..'(.*)'
local luadoc_tag_mod_and_value = luadoc_tag..'%[(.*)%](.*)'
-- assumes that the doc comment consists of distinct tag lines
function parse_at_tags(text)
local function parse_at_tags(text)
local lines = stringio.lines(text)
local preamble, line = tools.grab_while_not(lines,luadoc_tag)
local tag_items = {}
@ -52,7 +52,7 @@ end
local colon_tag = '%s*(%S-):%s'
local colon_tag_value = colon_tag..'(.*)'
function parse_colon_tags (text)
local function parse_colon_tags (text)
local lines = stringio.lines(text)
local preamble, line = tools.grab_while_not(lines,colon_tag)
local tag_items, follows = {}

View File

@ -206,6 +206,7 @@ function M.writefile(name,text)
end
function M.name_of (lpath)
local ext
lpath,ext = path.splitext(lpath)
return lpath
end