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
e0722ee9
Commit
e0722ee9
authored
11 years ago
by
Damien George
Browse files
Options
Downloads
Plain Diff
Merge branch 'free-parse-tree' of github.com:pfalcon/micropython into pfalcon-free-parse-tree
parents
28eb5778
aee2ba70
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
py/parse.c
+14
-0
14 additions, 0 deletions
py/parse.c
py/parse.h
+1
-0
1 addition, 0 deletions
py/parse.h
unix/main.c
+1
-0
1 addition, 0 deletions
unix/main.c
with
16 additions
and
0 deletions
py/parse.c
+
14
−
0
View file @
e0722ee9
...
...
@@ -135,6 +135,20 @@ mp_parse_node_struct_t *parse_node_new_struct(int src_line, int rule_id, int num
return
pn
;
}
int
parse_node_free_struct
(
mp_parse_node_t
pn_in
)
{
int
cnt
=
0
;
if
(
MP_PARSE_NODE_IS_STRUCT
(
pn_in
))
{
mp_parse_node_struct_t
*
pn
=
(
mp_parse_node_struct_t
*
)
pn_in
;
int
n
=
pn
->
kind_num_nodes
>>
8
;
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
cnt
+=
parse_node_free_struct
(
pn
->
nodes
[
i
]);
}
m_del_var
(
mp_parse_node_struct_t
,
mp_parse_node_t
,
n
,
pn
);
cnt
++
;
}
return
cnt
;
}
#if MICROPY_DEBUG_PRINTERS
void
mp_parse_node_print
(
mp_parse_node_t
pn
,
int
indent
)
{
if
(
MP_PARSE_NODE_IS_STRUCT
(
pn
))
{
...
...
This diff is collapsed.
Click to expand it.
py/parse.h
+
1
−
0
View file @
e0722ee9
...
...
@@ -53,6 +53,7 @@ typedef struct _mp_parse_node_struct_t {
#define MP_PARSE_NODE_STRUCT_NUM_NODES(pns) ((pns)->kind_num_nodes >> 8)
mp_parse_node_t
mp_parse_node_new_leaf
(
machine_int_t
kind
,
machine_int_t
arg
);
int
parse_node_free_struct
(
mp_parse_node_t
pn_in
);
void
mp_parse_node_print
(
mp_parse_node_t
pn
,
int
indent
);
...
...
This diff is collapsed.
Click to expand it.
unix/main.c
+
1
−
0
View file @
e0722ee9
...
...
@@ -62,6 +62,7 @@ static void execute_from_lexer(mp_lexer_t *lex, mp_parse_input_kind_t input_kind
*/
mp_obj_t
module_fun
=
mp_compile
(
pn
,
source_name
,
is_repl
);
parse_node_free_struct
(
pn
);
if
(
module_fun
==
mp_const_none
)
{
// compile error
...
...
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