|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body><a NAME="top" ID="top"></a> |
|
22 <h1>eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck</h1> |
|
23 <p> |
|
24 Module implementing the syntax check for Python 2/3. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr><td>None</td></tr> |
|
33 </table> |
|
34 <h3>Functions</h3> |
|
35 <table> |
|
36 <tr> |
|
37 <td><a href="#extractLineFlags">extractLineFlags</a></td> |
|
38 <td>Function to extract flags starting and ending with '__' from a line comment.</td> |
|
39 </tr><tr> |
|
40 <td><a href="#initService">initService</a></td> |
|
41 <td>Initialize the service and return the entry point.</td> |
|
42 </tr><tr> |
|
43 <td><a href="#normalizeCode">normalizeCode</a></td> |
|
44 <td>Function to normalize the given code.</td> |
|
45 </tr><tr> |
|
46 <td><a href="#syntaxAndPyflakesCheck">syntaxAndPyflakesCheck</a></td> |
|
47 <td>Function to compile one Python source file to Python bytecode and to perform a pyflakes check.</td> |
|
48 </tr> |
|
49 </table> |
|
50 <hr /><hr /> |
|
51 <a NAME="extractLineFlags" ID="extractLineFlags"></a> |
|
52 <h2>extractLineFlags</h2> |
|
53 <b>extractLineFlags</b>(<i>line, startComment="</i>) |
|
54 <p> |
|
55 Function to extract flags starting and ending with '__' from a line |
|
56 comment. |
|
57 </p><dl> |
|
58 <dt><i>line</i></dt> |
|
59 <dd> |
|
60 line to extract flags from (string) |
|
61 </dd><dt><i>startComment=</i></dt> |
|
62 <dd> |
|
63 string identifying the start of the comment (string) |
|
64 </dd><dt><i>endComment=</i></dt> |
|
65 <dd> |
|
66 string identifying the end of a comment (string) |
|
67 </dd> |
|
68 </dl><dl> |
|
69 <dt>Returns:</dt> |
|
70 <dd> |
|
71 list containing the extracted flags (list of strings) |
|
72 </dd> |
|
73 </dl> |
|
74 <div align="right"><a href="#top">Up</a></div> |
|
75 <hr /><hr /> |
|
76 <a NAME="initService" ID="initService"></a> |
|
77 <h2>initService</h2> |
|
78 <b>initService</b>(<i></i>) |
|
79 <p> |
|
80 Initialize the service and return the entry point. |
|
81 </p><dl> |
|
82 <dt>Returns:</dt> |
|
83 <dd> |
|
84 the entry point for the background client (function) |
|
85 </dd> |
|
86 </dl> |
|
87 <div align="right"><a href="#top">Up</a></div> |
|
88 <hr /><hr /> |
|
89 <a NAME="normalizeCode" ID="normalizeCode"></a> |
|
90 <h2>normalizeCode</h2> |
|
91 <b>normalizeCode</b>(<i>codestring</i>) |
|
92 <p> |
|
93 Function to normalize the given code. |
|
94 </p><dl> |
|
95 <dt><i>codestring</i></dt> |
|
96 <dd> |
|
97 code to be normalized (string) |
|
98 </dd> |
|
99 </dl><dl> |
|
100 <dt>Returns:</dt> |
|
101 <dd> |
|
102 normalized code (string) |
|
103 </dd> |
|
104 </dl> |
|
105 <div align="right"><a href="#top">Up</a></div> |
|
106 <hr /><hr /> |
|
107 <a NAME="syntaxAndPyflakesCheck" ID="syntaxAndPyflakesCheck"></a> |
|
108 <h2>syntaxAndPyflakesCheck</h2> |
|
109 <b>syntaxAndPyflakesCheck</b>(<i>filename, codestring, checkFlakes=True, ignoreStarImportWarnings=False</i>) |
|
110 <p> |
|
111 Function to compile one Python source file to Python bytecode |
|
112 and to perform a pyflakes check. |
|
113 </p><dl> |
|
114 <dt><i>filename</i></dt> |
|
115 <dd> |
|
116 source filename (string) |
|
117 </dd><dt><i>codestring</i></dt> |
|
118 <dd> |
|
119 string containing the code to compile (string) |
|
120 </dd><dt><i>checkFlakes=</i></dt> |
|
121 <dd> |
|
122 flag indicating to do a pyflakes check (boolean) |
|
123 </dd><dt><i>ignoreStarImportWarnings=</i></dt> |
|
124 <dd> |
|
125 flag indicating to |
|
126 ignore 'star import' warnings (boolean) |
|
127 </dd> |
|
128 </dl><dl> |
|
129 <dt>Returns:</dt> |
|
130 <dd> |
|
131 dictionary with the keys 'error' and 'warnings' which |
|
132 hold a list containing details about the error/ warnings |
|
133 (file name, line number, column, codestring (only at syntax |
|
134 errors), the message, a list with arguments for the message) |
|
135 </dd> |
|
136 </dl> |
|
137 <div align="right"><a href="#top">Up</a></div> |
|
138 <hr /> |
|
139 </body></html> |