# eric4.QScintilla.Lexers.Lexer

Module implementing the lexer base 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

object

### 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.
hasSmartIndent | Public method indicating whether lexer can do smart indentation.
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.
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.

Returns:
  flag indicating to keep tabs (boolean)

#### Lexer.autoCompletionWordSeparators

autoCompletionWordSeparators()

Public method to return the list of separators for autocompletion.

Returns:
  list of separators (QStringList)

#### Lexer.boxCommentStr

boxCommentStr()

Public method to return the box comment strings.

Returns:
  box comment strings (dictionary with three QStrings)

#### Lexer.canBlockComment

canBlockComment()

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

Returns:
  flag (boolean)

#### Lexer.canBoxComment

canBoxComment()

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

Returns:
  flag (boolean)

#### Lexer.canStreamComment

canStreamComment()

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

Returns:
  flag (boolean)

#### Lexer.commentStr

commentStr()

Public method to return the comment string.

Returns:
  comment string (QString)

#### Lexer.hasSmartIndent

hasSmartIndent()

Public method indicating whether lexer can do smart indentation.

Returns:
  flag indicating availability of smartIndentLine and smartIndentSelection methods (boolean)

#### Lexer.initProperties

initProperties()

Public slot to initialize the properties.

#### Lexer.isCommentStyle

isCommentStyle(style)

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

Returns:
  flag indicating a comment style (boolean)

#### Lexer.isStringStyle

isStringStyle(style)

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

Returns:
  flag indicating a string style (boolean)

#### Lexer.keywords

keywords(kwSet)

Public method to get the keywords.

kwSet
  number of the keyword set (integer)

Returns:
  string giving the keywords (string) or None

#### Lexer.smartIndentLine

smartIndentLine(editor)

Public method to handle smart indentation for a line.

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
  reference to the QScintilla editor object

#### Lexer.streamCommentStr

streamCommentStr()

Public method to return the stream comment strings.

Returns:
  stream comment strings (dictionary with two QStrings)

Up