Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
8ab6f906
Commit
8ab6f906
authored
10 years ago
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
py: Move to guarded includes for compile.h and related headers.
parent
343266ea
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
py/compile.h
+8
-0
8 additions, 0 deletions
py/compile.h
py/emit.h
+6
-0
6 additions, 0 deletions
py/emit.h
py/emitglue.h
+4
-0
4 additions, 0 deletions
py/emitglue.h
py/lexer.h
+4
-0
4 additions, 0 deletions
py/lexer.h
py/parse.h
+4
-0
4 additions, 0 deletions
py/parse.h
py/runtime0.h
+4
-0
4 additions, 0 deletions
py/runtime0.h
with
30 additions
and
0 deletions
py/compile.h
+
8
−
0
View file @
8ab6f906
...
...
@@ -23,6 +23,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef __MICROPY_INCLUDED_PY_COMPILE_H__
#define __MICROPY_INCLUDED_PY_COMPILE_H__
#include
"py/lexer.h"
#include
"py/parse.h"
#include
"py/emitglue.h"
// These must fit in 8 bits; see scope.h
enum
{
...
...
@@ -38,3 +44,5 @@ mp_obj_t mp_compile(mp_parse_node_t pn, qstr source_file, uint emit_opt, bool is
// this is implemented in runtime.c
mp_obj_t
mp_parse_compile_execute
(
mp_lexer_t
*
lex
,
mp_parse_input_kind_t
parse_input_kind
,
mp_obj_dict_t
*
globals
,
mp_obj_dict_t
*
locals
);
#endif // __MICROPY_INCLUDED_PY_COMPILE_H__
This diff is collapsed.
Click to expand it.
py/emit.h
+
6
−
0
View file @
8ab6f906
...
...
@@ -33,6 +33,10 @@
* This is problematic for some emitters (x64) since they need to know the maximum
* stack size to compile the entry to the function, and this affects code size.
*/
#ifndef __MICROPY_INCLUDED_PY_EMIT_H__
#define __MICROPY_INCLUDED_PY_EMIT_H__
#include
"py/runtime0.h"
typedef
enum
{
MP_PASS_SCOPE
=
1
,
// work out id's and their kind, and number of labels
...
...
@@ -195,3 +199,5 @@ extern const emit_inline_asm_method_table_t emit_inline_thumb_method_table;
emit_inline_asm_t
*
emit_inline_thumb_new
(
mp_uint_t
max_num_labels
);
void
emit_inline_thumb_free
(
emit_inline_asm_t
*
emit
);
#endif // __MICROPY_INCLUDED_PY_EMIT_H__
This diff is collapsed.
Click to expand it.
py/emitglue.h
+
4
−
0
View file @
8ab6f906
...
...
@@ -23,6 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef __MICROPY_INCLUDED_PY_EMITGLUE_H__
#define __MICROPY_INCLUDED_PY_EMITGLUE_H__
// These variables and functions glue the code emitters to the runtime.
...
...
@@ -59,3 +61,5 @@ void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void
mp_obj_t
mp_make_function_from_raw_code
(
mp_raw_code_t
*
rc
,
mp_obj_t
def_args
,
mp_obj_t
def_kw_args
);
mp_obj_t
mp_make_closure_from_raw_code
(
mp_raw_code_t
*
rc
,
mp_uint_t
n_closed_over
,
const
mp_obj_t
*
args
);
#endif // __MICROPY_INCLUDED_PY_EMITGLUE_H__
This diff is collapsed.
Click to expand it.
py/lexer.h
+
4
−
0
View file @
8ab6f906
...
...
@@ -23,6 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef __MICROPY_INCLUDED_PY_LEXER_H__
#define __MICROPY_INCLUDED_PY_LEXER_H__
/* lexer.h -- simple tokeniser for Micro Python
*
...
...
@@ -186,3 +188,5 @@ mp_import_stat_t mp_import_stat(const char *path);
mp_lexer_t
*
mp_lexer_new_from_file
(
const
char
*
filename
);
extern
mp_uint_t
mp_optimise_value
;
#endif // __MICROPY_INCLUDED_PY_LEXER_H__
This diff is collapsed.
Click to expand it.
py/parse.h
+
4
−
0
View file @
8ab6f906
...
...
@@ -23,6 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef __MICROPY_INCLUDED_PY_PARSE_H__
#define __MICROPY_INCLUDED_PY_PARSE_H__
struct
_mp_lexer_t
;
...
...
@@ -93,3 +95,5 @@ typedef enum {
// returns MP_PARSE_NODE_NULL on error, and then parse_error_kind_out is valid
mp_parse_node_t
mp_parse
(
struct
_mp_lexer_t
*
lex
,
mp_parse_input_kind_t
input_kind
,
mp_parse_error_kind_t
*
parse_error_kind_out
);
#endif // __MICROPY_INCLUDED_PY_PARSE_H__
This diff is collapsed.
Click to expand it.
py/runtime0.h
+
4
−
0
View file @
8ab6f906
...
...
@@ -23,6 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef __MICROPY_INCLUDED_PY_RUNTIME0_H__
#define __MICROPY_INCLUDED_PY_RUNTIME0_H__
// taken from python source, Include/code.h
// These must fit in 8 bits; see scope.h
...
...
@@ -152,3 +154,5 @@ typedef enum {
}
mp_fun_kind_t
;
extern
void
*
const
mp_fun_table
[
MP_F_NUMBER_OF
];
#endif // __MICROPY_INCLUDED_PY_RUNTIME0_H__
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment