Classes | |
| class | TokenNotFound |
| Parsing exception. More... | |
| class | ELexer |
| A wrapper to add peeking and line counting to pygments lexer. More... | |
| class | EToken |
Functions | |
| def | GetTokenValue |
| Get the first value associated with the given token type in the line will raise TokenNotFound if the value cannot be found. | |
| def | HasToken |
| Find if the token exists in the line. | |
| def | BeginsWithToken |
| Returns true it the first non whitespace token in the given line is the given token. | |
| def | BeginsWithAnyOf |
| Returns true if the line begins with any of the given values. | |
| def | GetFirstIdentifier |
| Extract the first identifier from the given line. | |
| def | GetTokenParenLeft |
| Get the first identifier token to the left of the first opening paren found in the given line. | |
| def | IsGoodName |
| Check if the name is a valid identifier name or not. | |
| def | IsToken |
| Check if the given item is a token or not. | |
| def | SkipWhitespace |
| Increment and return the index in the current line past any whitespace. | |
| def | FindStringEnd |
| Walk through the string until the next non escaped matching ending quotation is found. | |
Variables | |
| string | __author__ = "Cody Precord <cprecord@editra.org>" |
| Contains misc common parsing helper functions used by the various parsers in this library. | |
| string | __svnid__ = "$Id: parselib.py 70229 2012-01-01 01:27:10Z CJP $" |
| string | __revision__ = "$Revision: 70229 $" |
| def codebrowser.gentag.parselib.BeginsWithAnyOf | ( | line, | |
| searchToken, | |||
| searchValueList | |||
| ) |
Returns true if the line begins with any of the given values.
| searchValueList | list of unicode |
| def codebrowser.gentag.parselib.BeginsWithToken | ( | line, | |
| searchToken, | |||
| searchValue | |||
| ) |
Returns true it the first non whitespace token in the given line is the given token.
| line | pygments line enumeration |
| searchToken | pygments.Token. |
| searchValue | unicode |
| def codebrowser.gentag.parselib.FindStringEnd | ( | line, | |
| idx | |||
| ) |
Walk through the string until the next non escaped matching ending quotation is found.
Returning the current state of the parse. The first character in the given line should be the beginning of the string.
| line | line of text |
| idx | current index in parse document |
| def codebrowser.gentag.parselib.GetFirstIdentifier | ( | line | ) |
Extract the first identifier from the given line.
Identifiers are classified as the first contiguous string of characters that only contains AlphaNumeric or "_" character. In other words [a-zA-Z0-9_]+.
| def codebrowser.gentag.parselib.GetTokenParenLeft | ( | line, | |
exchars = '_' |
|||
| ) |
Get the first identifier token to the left of the first opening paren found in the given line.
Example: function myfunct(param1) => myfunct
| line | line to search |
| exchars | Extra non-alphanumeric characters that can be in the token |
| def codebrowser.gentag.parselib.GetTokenValue | ( | line, | |
| searchToken | |||
| ) |
Get the first value associated with the given token type in the line will raise TokenNotFound if the value cannot be found.
| def codebrowser.gentag.parselib.HasToken | ( | line, | |
| searchToken, | |||
searchValue = None |
|||
| ) |
Find if the token exists in the line.
| line | line of code |
| searchToken | Token to look for |
| def codebrowser.gentag.parselib.IsGoodName | ( | name, | |
exchars = '_' |
|||
| ) |
Check if the name is a valid identifier name or not.
A valid identifier is a string that only has alpha numeric and/or the specified exchars in it. Also meaning it matches the following character class [a-zA-Z_][a-zA-Z0-8_]+
| name | name to check |
| exchars | extra non alphanumeric characters that are valid |
| def codebrowser.gentag.parselib.IsToken | ( | line, | |
| idx, | |||
| name, | |||
ignorecase = False |
|||
| ) |
Check if the given item is a token or not.
The function will return True if the item at the given index matches the name and is preceded and followed by whitespace. It will return False otherwise.
| line | string to check |
| idx | index in string to look from |
| name | name of token to look for match |
| ignorecase | do case insensitive search |
| def codebrowser.gentag.parselib.SkipWhitespace | ( | line, | |
| idx | |||
| ) |
Increment and return the index in the current line past any whitespace.
| line | string |
| idx | index to check from in line |
| string __author__ = "Cody Precord <cprecord@editra.org>" |
Contains misc common parsing helper functions used by the various parsers in this library.
Common helper functions for tag generators.
| string __revision__ = "$Revision: 70229 $" |
| string __svnid__ = "$Id: parselib.py 70229 2012-01-01 01:27:10Z CJP $" |
1.7.6.1