Skip to content

GoLang lexer customized to parse files only for comments but allowing for multiple filetypes.

License

Notifications You must be signed in to change notification settings

Acetolyne/commentlex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Commentlex

Commentlex is based off of the standard go lexer however it is modified to only return comments. It is not a complete lexer but does offer the advantage of being able to return comments based on filetype and can return comments for languages that do not use the standard // or /* */ comment syntax. Additionally it can return comments from files that use a mix of comment styles for example html files that have html comments and javascript comments.

Options

s.Match: lexer option to add additional matching on comments. For single line comments this string needs to directly follow the characters that trigger the comment ignoring any whitespaces. For multiline comments this string needs to be anywhere in the comment.

Supported Filetypes

.go .py .js .rs .html .gohtml .php .c .cpp .h .class .jar .java .jsp .sh .php .html .gohtml .md .lua .rb

About

GoLang lexer customized to parse files only for comments but allowing for multiple filetypes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published