# eric7.QScintilla.Lexers.Lexer

Module implementing the lexer mixin class.

### Global Attributes

None

### Classes

Lexer | Class to implement the lexer mixin class.

### Functions

None

## Lexer

Class to implement the lexer mixin class.

### Derived from

None

### Class Attributes

None

### Class Methods

None

### Methods

Lexer | Constructor
alwaysKeepTabs | Public method to check, if tab conversion is allowed.
autoCompletionWordSeparators | Public method to return the list of separators for autocompletion.
boxCommentStr | Public method to return the box comment strings.
canBlockComment | Public method to determine, whether the lexer language supports a block comment.
canBoxComment | Public method to determine, whether the lexer language supports a box comment.
canStreamComment | Public method to determine, whether the lexer language supports a stream comment.
commentStr | Public method to return the comment string.
defaultKeywords | Public method to get the default keywords.
hasSmartIndent | Public method indicating whether lexer can do smart indentation.
hasSubstyles | Public method to indicate the support of sub-styles.
initProperties | Public slot to initialize the properties.
isCommentStyle | Public method to check, if a style is a comment style.
isStringStyle | Public method to check, if a style is a string style.
keywords | Public method to get the keywords.
keywordsDescription | Public method to get the description for a keywords set.
lexerName | Public method to return the lexer name.
maximumKeywordSet | Public method to get the maximum keyword set.
smartIndentLine | Public method to handle smart indentation for a line.
smartIndentSelection | Public method to handle smart indentation for a selection of lines.
streamCommentStr | Public method to return the stream comment strings.

### Static Methods

None

#### Lexer (Constructor)

Lexer()

Constructor

#### Lexer.alwaysKeepTabs

alwaysKeepTabs()

Public method to check, if tab conversion is allowed.

Return:
  flag indicating to keep tabs

Return Type:
  bool

#### Lexer.autoCompletionWordSeparators

autoCompletionWordSeparators()

Public method to return the list of separators for autocompletion.

Return:
  list of separators

Return Type:
  list of str

#### Lexer.boxCommentStr

boxCommentStr()

Public method to return the box comment strings.

Return:
  dictionary containing the start, middle and end box comment strings

Return Type:
  dict of {"start": str, "middle": str, "end": str}

#### Lexer.canBlockComment

canBlockComment()

Public method to determine, whether the lexer language supports a block comment.

Return:
  flag indicating block comment is available

Return Type:
  bool

#### Lexer.canBoxComment

canBoxComment()

Public method to determine, whether the lexer language supports a box comment.

Return:
  flag box comment is available

Return Type:
  bool

#### Lexer.canStreamComment

canStreamComment()

Public method to determine, whether the lexer language supports a stream comment.

Return:
  flag indicating stream comment is available

Return Type:
  bool

#### Lexer.commentStr

commentStr()

Public method to return the comment string.

Return:
  comment string

Return Type:
  str

#### Lexer.defaultKeywords

defaultKeywords(kwSet)

Public method to get the default keywords.

kwSet (int)
  number of the keyword set

Return:
  space separated list of keywords

Return Type:
  str or None

#### Lexer.hasSmartIndent

hasSmartIndent()

Public method indicating whether lexer can do smart indentation.

Return:
  flag indicating availability of smartIndentLine and smartIndentSelection methods

Return Type:
  bool

#### Lexer.hasSubstyles

hasSubstyles()

Public method to indicate the support of sub-styles.

Return:
  flag indicating sub-styling support

Return Type:
  bool

#### Lexer.initProperties

initProperties()

Public slot to initialize the properties.

#### Lexer.isCommentStyle

isCommentStyle(style)

Public method to check, if a style is a comment style.

style (int)
  style to check

Return:
  flag indicating a comment style

Return Type:
  bool

#### Lexer.isStringStyle

isStringStyle(style)

Public method to check, if a style is a string style.

style (int)
  style to check

Return:
  flag indicating a string style

Return Type:
  bool

#### Lexer.keywords

keywords(kwSet)

Public method to get the keywords.

kwSet (int)
  number of the keyword set

Return:
  space separated list of keywords

Return Type:
  str or None

#### Lexer.keywordsDescription

keywordsDescription(kwSet)

Public method to get the description for a keywords set.

kwSet (int)
  number of the keyword set

Return:
  description of the keyword set

Return Type:
  str

#### Lexer.lexerName

lexerName()

Public method to return the lexer name.

Return:
  lexer name

Return Type:
  str

#### Lexer.maximumKeywordSet

maximumKeywordSet()

Public method to get the maximum keyword set.

Note: A return value of 0 indicates to determine this dynamically.

Return:
  maximum keyword set

Return Type:
  int

#### Lexer.smartIndentLine

smartIndentLine(editor)

Public method to handle smart indentation for a line.

editor (Editor)
  reference to the QScintilla editor object

#### Lexer.smartIndentSelection

smartIndentSelection(editor)

Public method to handle smart indentation for a selection of lines.

Note: The assumption is, that the first line determines the new indentation level.

editor (Editor)
  reference to the QScintilla editor object

#### Lexer.streamCommentStr

streamCommentStr()

Public method to return the stream comment strings.

Return:
  dictionary containing the start and end stream comment strings

Return Type:
  dict of {"start": str, "end": str}

Up