From 45745c52ff6a8860965dde336385f5221b359b28 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 17 Jan 2011 22:41:13 -0500 Subject: Files in scripts/ should be in the source release, not hg. --- scripts/gen_iface.lua | 115 ------------------------------------------------- scripts/update_doc | 117 -------------------------------------------------- 2 files changed, 232 deletions(-) delete mode 100755 scripts/gen_iface.lua delete mode 100755 scripts/update_doc (limited to 'scripts') diff --git a/scripts/gen_iface.lua b/scripts/gen_iface.lua deleted file mode 100755 index e8f94560..00000000 --- a/scripts/gen_iface.lua +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/lua --- Copyright 2007-2011 Mitchell mitchellcaladbolg.net. See LICENSE. - -local f = io.open('../../scite-latest/scite/src/IFaceTable.cxx') -local contents = f:read('*all') -f:close() - -local constants = contents:match('ifaceConstants%[%] = (%b{})') -local functions = contents:match('ifaceFunctions%[%] = (%b{})') -local properties = contents:match('ifaceProperties%[%] = (%b{})') - -local out = [[ --- Copyright 2007-2011 Mitchell mitchellcaladbolg.net. See LICENSE. - ---- --- Scintilla constants, functions, and properties. --- Do not modify anything in this module. Doing so will result in instability. -module('_SCINTILLA', package.seeall) - -]] - -local types = { - void = 0, int = 1, length = 2, position = 3, colour = 4, bool = 5, - keymod = 6, string = 7, stringresult = 8, cells = 9, textrange = 10, - findtext = 11, formatrange = 12 -} - -out = out..[[ ---- --- Scintilla constants. --- @class table --- @name constants -constants = {]] --- {"constant", value} -for item in constants:sub(2, -2):gmatch('%b{}') do - local name, value = item:match('^{"(.-)",(.-)}') - if not name:find('^IDM_') and not name:find('^SCE_') and - not name:find('^SCLEX_') then - if name == 'SC_MASK_FOLDERS' then value = '-33554432' end - local line = (" %s = %s,"):format(name, value) - out = out..line - end -end -out = out..string.gsub([[ -SCLEX_CONTAINER = 0, -SCLEX_NULL = 1, -SCLEX_LPEG = 999, -SCLEX_AUTOMATIC = 1000, -SCN_STYLENEEDED = 2000, -SCN_CHARADDED = 2001, -SCN_SAVEPOINTREACHED = 2002, -SCN_SAVEPOINTLEFT = 2003, -SCN_MODIFYATTEMPTRO = 2004, -SCN_KEY = 2005, -SCN_DOUBLECLICK =2006, -SCN_UPDATEUI = 2007, -SCN_MODIFIED = 2008, -SCN_MACRORECORD = 2009, -SCN_MARGINCLICK = 2010, -SCN_NEEDSHOWN = 2011, -SCN_PAINTED = 2013, -SCN_USERLISTSELECTION = 2014, -SCN_URIDROPPED = 2015, -SCN_DWELLSTART = 2016, -SCN_DWELLEND = 2017, -SCN_ZOOM = 2018, -SCN_HOTSPOTCLICK = 2019, -SCN_HOTSPOTDOUBLECLICK = 2020, -SCN_CALLTIPCLICK = 2021, -SCN_AUTOCSELECTION = 2022, -SCN_INDICATORCLICK = 2023, -SCN_INDICATORRELEASE = 2024,]], '\n', ' ') -out = out..' }\n\n' - -out = out..[[ ---- --- Scintilla functions. --- @class table --- @name functions -functions = {]] --- {"function", msg_id, iface_*, {iface_*, iface_*}} -for item in functions:sub(2, -2):gmatch('%b{}') do - local name, msg_id, rt_type, p1_type, p2_type = - item:match('^{"(.-)"%D+(%d+)%A+iface_(%a+)%A+iface_(%a+)%A+iface_(%a+)') - name = name:gsub('([a-z])([A-Z])', '%1_%2') - name = name:gsub('([A-Z])([A-Z][a-z])', '%1_%2') - name = name:lower() - local line = (" %s = {%d, %d, %d, %d},"):format( - name, msg_id, types[rt_type], types[p1_type], types[p2_type]) - out = out..line -end -out = out..' }\n\n' - -out = out..[[ ---- --- Scintilla properties. --- @class table --- @name properties -properties = {]] --- {"property", get_id, set_id, rt_type, p1_type} -for item in properties:sub(2, -2):gmatch('%b{}') do - local name, get_id, set_id, rt_type, p1_type = - item:match('^{"(.-)"%D+(%d+)%D+(%d+)%A+iface_(%a+)%A+iface_(%a+)') - name = name:gsub('([a-z])([A-Z])', '%1_%2') - name = name:gsub('([A-Z])([A-Z][a-z])', '%1_%2') - name = name:lower() - local line = (" %s = {%d, %d, %d, %d},"):format( - name, get_id, set_id, types[rt_type], types[p1_type]) - out = out..line -end -out = out..' }\n' - -f = io.open('../core/iface.lua', 'w') -f:write(out) -f:close() diff --git a/scripts/update_doc b/scripts/update_doc deleted file mode 100755 index c3aedc20..00000000 --- a/scripts/update_doc +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/lua --- Copyright 2007-2011 Mitchell mitchellcaladbolg.net. See LICENSE. - --- Generate LuaDoc. -os.execute('rm -rf ../doc/modules/') -os.execute('cd ../; luadoc -d doc/ --nofiles modules/ core/ lexers/lexer.lua') - --- Insert Markdown in modules into LuaDoc. -local p = io.popen('grep -r "\\-\\- Markdown:" ../*') -for file in p:lines() do - local module - - -- Open the Lua file and extract the Markdown lines. - local f = io.open(file:match('^[^:]+')) - local markdown, flag = {}, false - for line in f:lines() do - if flag and line:match('^%-%-') then - local match = line:match('^%-%- ([^\n]+)') - markdown[#markdown + 1] = match or '' - elseif flag then -- markdown ended - break - elseif line:match('^%-%- Markdown:') then - flag = true - elseif line:match('^module') then - module = line:match("^module%('([^']+)") - end - end - f:close() - - -- Convert the Markdown into HTML. - markdown = table.concat(markdown, '\n') - f = io.open('tmp', 'w') - f:write(markdown) - f:close() - f = io.popen('perl ../doc/Markdown.pl tmp') - markdown = f:read('*all') - f:close() - os.execute('rm tmp') - - -- Insert the Marked down HTML in the LuaDoc HTML file. - local filename = '../doc/modules/'..module..'.html' - f = io.open(filename) - local contents = f:read('*all') - f:close() - local s = contents:find('

Functions

') - if not s then s = contents:find('

Tables

') end - contents = contents:sub(1, s - 1)..markdown..contents:sub(s) - f = io.open(filename, 'w') - f:write(contents) - f:close() -end -p:close() - --- Generate the Manual. -p = io.popen('ls -1 ../doc/manual/*.md') -for mdfile in p:lines() do - local htmlfile = mdfile:match('^(.+).md$')..'.html' - html = [[ - - - - Textadept Manual - - - - -
-
- -
- - %content% - -
-
-
-

Valid XHTML 1.0!

-
-
- - - ]] - - local sidebar_md = io.popen('../doc/Markdown.pl ../doc/sidebar.md') - html = html:gsub('%%sidebar%%', sidebar_md:read('*all')) - sidebar_md:close() - local content_md = io.popen('../doc/Markdown.pl '..mdfile) - local md = content_md:read('*all'):gsub('%%', '%%%%') - md = md:gsub('()([^<]+)()', - function(s, text, e) - return string.format('%s%s%s', s, - text:gsub(' ', '_'):lower(), text, e) - end) - html = html:gsub('%%content%%', md) - content_md:close() - - local f = io.open(htmlfile, 'w') - f:write(html) - f:close() -end -p:close() - --- Modify default CSS. -os.execute("sed -i 's/pre.example/pre, pre.example/;' ../doc/luadoc.css") - --- Generate Doxygen documentation. -os.execute('cd ../; doxygen Doxyfile') - --- Create Lua adeptsense for textadept. -os.execute(table.concat{ 'luadoc -d ../modules/lua -doclet adeptsensedoc ', - '../modules ../core ../lexers/lexer.lua' }) -os.execute('sed -i -e "s/class:lexer/class:l/g;" ../modules/lua/tags') -- cgit v1.2.3