# eric6.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck

Module implementing the syntax check for Python 2/3.

### Global Attributes

VcsConflictMarkerRe

### Classes

None

### Functions

extractLineFlags | Function to extract flags starting and ending with '__' from a line comment.
initService | Initialize the service and return the entry point.
normalizeCode | Function to normalize the given code.
syntaxAndPyflakesCheck | Function to compile one Python source file to Python bytecode and to perform a pyflakes check.

## extractLineFlags

extractLineFlags(line, startComment=")

Function to extract flags starting and ending with '__' from a line comment.

line
  line to extract flags from (string)
startComment=
  string identifying the start of the comment (string)
endComment=
  string identifying the end of a comment (string)

Returns:
  list containing the extracted flags (list of strings)

Up

## initService

initService()

Initialize the service and return the entry point.

Returns:
  the entry point for the background client (function)

Up

## normalizeCode

normalizeCode(codestring)

Function to normalize the given code.

codestring
  code to be normalized (string)

Returns:
  normalized code (string)

Up

## syntaxAndPyflakesCheck

syntaxAndPyflakesCheck(filename, codestring, checkFlakes=True, ignoreStarImportWarnings=False)

Function to compile one Python source file to Python bytecode and to perform a pyflakes check.

filename
  source filename (string)
codestring
  string containing the code to compile (string)
checkFlakes=
  flag indicating to do a pyflakes check (boolean)
ignoreStarImportWarnings=
  flag indicating to ignore 'star import' warnings (boolean)

Returns:
  dictionary with the keys 'error' and 'warnings' which hold a list containing details about the error/ warnings (file name, line number, column, codestring (only at syntax errors), the message, a list with arguments for the message)

Up