Documentation ¶
Overview ¶
Package language contains methods and information about the different programming languages the comment parser supports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Language ¶
type Language int
Language is the progamming language we're grabbing the comments from.
const ( Unknown Language = iota AppleScript Assembly Batch C Clif Clojure CMake CSharp Dart Fortran GLSLF // OpenGL Shading Language Go Haskell HTML Java JavaScript Flex Lisp Matlab MySQL NinjaBuild ObjectiveC Perl Python R Ruby Rust Shader Shell SQL Swift SWIG TypeScript Yacc Yaml )
Languages we can retrieve comments from.
func ClassifyLanguage ¶
ClassifyLanguage determines what language the source code was written in. It does this by looking at the file's extension.
func (Language) MultilineCommentEnd ¶
MultilineCommentEnd returns the ending string of a multiline comment for the given langauge.
func (Language) MultilineCommentStart ¶
MultilineCommentStart returns the starting string of a multiline comment for the given language.
func (Language) NestedComments ¶
NestedComments returns true if the language allows for nested multiline comments.
func (Language) QuoteCharacter ¶
QuoteCharacter returns 'true' if the character is considered the beginning of a string in the given language. The second return value is true if the string allows for escaping.
func (Language) SingleLineCommentStart ¶
SingleLineCommentStart returns the starting string of a single line comment for the given language. There is no equivalent "End" method, because it's the end of line.