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
GitLab 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
52e062ef
Commit
52e062ef
authored
Mar 16, 2016
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
py/frozenmod: Allow port to override lexer to use for frozen modules.
parent
664f03f4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
py/frozenmod.c
+7
-1
7 additions, 1 deletion
py/frozenmod.c
with
7 additions
and
1 deletion
py/frozenmod.c
+
7
−
1
View file @
52e062ef
...
...
@@ -32,6 +32,12 @@
#if MICROPY_MODULE_FROZEN
#ifndef MICROPY_MODULE_FROZEN_LEXER
#define MICROPY_MODULE_FROZEN_LEXER mp_lexer_new_from_str_len
#else
mp_lexer_t
*
MICROPY_MODULE_FROZEN_LEXER
(
qstr
src_name
,
const
char
*
str
,
mp_uint_t
len
,
mp_uint_t
free_len
);
#endif
extern
const
char
mp_frozen_names
[];
extern
const
uint32_t
mp_frozen_sizes
[];
extern
const
char
mp_frozen_content
[];
...
...
@@ -43,7 +49,7 @@ mp_lexer_t *mp_find_frozen_module(const char *str, int len) {
for
(
int
i
=
0
;
*
name
!=
0
;
i
++
)
{
int
l
=
strlen
(
name
);
if
(
l
==
len
&&
!
memcmp
(
str
,
name
,
l
))
{
mp_lexer_t
*
lex
=
mp_lexer_new_from_str_len
(
MP_QSTR_
,
mp_frozen_content
+
offset
,
mp_frozen_sizes
[
i
],
0
);
mp_lexer_t
*
lex
=
MICROPY_MODULE_FROZEN_LEXER
(
MP_QSTR_
,
mp_frozen_content
+
offset
,
mp_frozen_sizes
[
i
],
0
);
return
lex
;
}
name
+=
l
+
1
;
...
...
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