A Java and C source code comment parser written in lua
clone or download (and unzip) this repository
install lua 5.1.5 (not tested on other versions)
to scan an entire tree use
lua lumment.lua C:\Path\to\directorie\to\scan
or scan an entire tree relative to the location of lumment.lua
lua lumment.lua ..\directorie_to_scan
or scan the current directory even if lumment.lua isn't in there
lua relative_path\to\lumment.lua
or scan some directory even if lumment.lua isn't in there
lua relative_path\to\lumment.lua relative_path\to\directorie
or use absolute paths
lua C:\path_to\lumment.lua C:\path\directorie
Specific folders can be ignored by including them into the .lummentignore
file.
ignored_folder
node_modules
will ignore the contents of any folder that is named ignored_folder
or node_modules
To add new ignored folders just write down their name on a new line.
"..\\BlackjackCL\\blackjack.cpp" 5 26 " std::default_random_engine"
"..\\BlackjackCL\\blackjack.cpp" 6 26 " std::chrono::system_clock"
"..\\BlackjackCL\\blackjack.cpp" 27 2 "values"
"..\\BlackjackCL\\blackjack.cpp" 28 2 "0 1 2 3 4 5 6 7 8 9 10 11 12"
"..\\BlackjackCL\\blackjack.cpp" 29 2 "2 3 4 5 6 7 8 9 T J Q K A"
"..\\BlackjackCL\\blackjack.cpp" 43 31 "there are only 52 cards in a deck every number over 52 loops into the next deck of cards"
"..\\BlackjackCL\\blackjack.cpp" 44 32 "the cards are orderd every 13 cards a new suit starts"
Formatted as
Path | line | offset | comment |
---|---|---|---|
"..\BlackjackCL\blackjack.cpp" | 5 | 26 | " std::default_random_engine" |
"..\BlackjackCL\blackjack.cpp" | 6 | 26 | " std::chrono::system_clock" |
"..\BlackjackCL\blackjack.cpp" | 27 | 2 | "values" |
"..\BlackjackCL\blackjack.cpp" | 28 | 2 | "0 1 2 3 4 5 6 7 8 9 10 11 12" |
"..\BlackjackCL\blackjack.cpp" | 29 | 2 | "2 3 4 5 6 7 8 9 T J Q K A" |
"..\BlackjackCL\blackjack.cpp" | 43 | 31 | "there are only 52 cards in a deck every number over 52 loops into the next deck of cards" |
"..\BlackjackCL\blackjack.cpp" | 44 | 32 | "the cards are orderd every 13 cards a new suit starts" |
The output is formatted to work more or less good as an sqlite import
- Connect to, or create s sqlite3 database
- Create a table with 4 Columns. Example:
create table comments (path text, line int, offset int, comment text);
- Change mode to
tcl
with.mode tcl
- Import data with
.import file_with_comment.txt table_name
- Ignore any errors and hope that it worked
- Query
test by running
lua lumment.lua
it will print all comments contained in test.java and test-files/test.java
by default the ignored_folder
folder will be ignored
Took the test files from https://github.com/g4s8/commentator/blob/c1e136ecd288dce27954f18e8644b8f574aebe51/test-files/test.java and changed it a bit