diff options
author | Neil <nyamatongwe@gmail.com> | 2019-12-13 22:28:13 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-12-13 22:28:13 +1100 |
commit | 38e4d3cbc591f06a6663d6c0962bc17ea73d61ad (patch) | |
tree | 83ee4102d4d9a7c7d92c308d06bfe0459588892a /lexilla/scripts/LexillaGen.py | |
parent | a8141c4c11ad77014802d003d649abc8335a4f70 (diff) | |
download | scintilla-mirror-38e4d3cbc591f06a6663d6c0962bc17ea73d61ad.tar.gz |
Lexilla implemented as loadable lexer.
Diffstat (limited to 'lexilla/scripts/LexillaGen.py')
-rw-r--r-- | lexilla/scripts/LexillaGen.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lexilla/scripts/LexillaGen.py b/lexilla/scripts/LexillaGen.py new file mode 100644 index 000000000..569f043ac --- /dev/null +++ b/lexilla/scripts/LexillaGen.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +# LexillaGen.py - implemented 2019 by Neil Hodgson neilh@scintilla.org +# Released to the public domain. + +# Regenerate the Lexilla source files that list all the lexers. +# Should be run whenever a new lexer is added or removed. +# Requires Python 3.6 or later +# Files are regenerated in place with templates stored in comments. +# The format of generation comments is documented in FileGenerator.py. + +import os, sys + +sys.path.append(os.path.join("..", "..", "scripts")) + +from FileGenerator import Regenerate, UpdateLineInFile, \ + ReplaceREInFile, UpdateLineInPlistFile, ReadFileAsList, UpdateFileFromLines, \ + FindSectionInList +import ScintillaData + +def RegenerateAll(root): + + scintillaBase = os.path.abspath(root) + + sci = ScintillaData.ScintillaData(root + os.sep) + + src = os.path.join(root, "lexilla", "src") + + Regenerate(os.path.join(src, "Lexilla.cxx"), "//", sci.lexerModules) + Regenerate(os.path.join(src, "lexilla.mak"), "#", sci.lexFiles) + + #~ startDir = os.getcwd() + #~ os.chdir(os.path.join(scintillaBase, "win32")) + #~ win32.DepGen.Generate() + #~ os.chdir(os.path.join(scintillaBase, "gtk")) + #~ gtk.DepGen.Generate() + #~ os.chdir(startDir) + +if __name__=="__main__": + RegenerateAll(os.path.join("..", "..")) |