Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
circuitpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
circuitpython
Commits
3b2fd4df
Commit
3b2fd4df
authored
Feb 27, 2017
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/utils/pyexec: Allow to compile when the uPy compiler is disabled.
parent
e2f1a8a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
lib/utils/pyexec.c
lib/utils/pyexec.c
+6
-0
No files found.
lib/utils/pyexec.c
View file @
3b2fd4df
...
...
@@ -75,11 +75,15 @@ STATIC int parse_compile_execute(void *source, mp_parse_input_kind_t input_kind,
}
else
#endif
{
#if MICROPY_ENABLE_COMPILER
// source is a lexer, parse and compile the script
mp_lexer_t
*
lex
=
source
;
qstr
source_name
=
lex
->
source_name
;
mp_parse_tree_t
parse_tree
=
mp_parse
(
lex
,
input_kind
);
module_fun
=
mp_compile
(
&
parse_tree
,
source_name
,
MP_EMIT_OPT_NONE
,
exec_flags
&
EXEC_FLAG_IS_REPL
);
#else
mp_raise_msg
(
&
mp_type_RuntimeError
,
"script compilation not supported"
);
#endif
}
// execute code
...
...
@@ -137,6 +141,7 @@ STATIC int parse_compile_execute(void *source, mp_parse_input_kind_t input_kind,
return
ret
;
}
#if MICROPY_ENABLE_COMPILER
#if MICROPY_REPL_EVENT_DRIVEN
typedef
struct
_repl_t
{
...
...
@@ -497,6 +502,7 @@ friendly_repl_reset:
}
#endif // MICROPY_REPL_EVENT_DRIVEN
#endif // MICROPY_ENABLE_COMPILER
int
pyexec_file
(
const
char
*
filename
)
{
mp_lexer_t
*
lex
=
mp_lexer_new_from_file
(
filename
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment