Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
tools-mirror
Micropython
提交
949b5569
M
Micropython
项目概览
tools-mirror
/
Micropython
10 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
Micropython
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
949b5569
编写于
9月 06, 2017
作者:
D
Damien George
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
py/compile2: Rename "Micro Python" to "MicroPython".
上级
d64154c7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
8 deletion
+8
-8
py/compile2.c
py/compile2.c
+8
-8
未找到文件。
py/compile2.c
浏览文件 @
949b5569
...
...
@@ -574,7 +574,7 @@ STATIC void close_over_variables_etc(compiler_t *comp, scope_t *this_scope, int
for
(
int
j
=
0
;
j
<
this_scope
->
id_info_len
;
j
++
)
{
id_info_t
*
id2
=
&
this_scope
->
id_info
[
j
];
if
(
id2
->
kind
==
ID_INFO_KIND_FREE
&&
id
->
qst
==
id2
->
qst
)
{
// in Micro
Python we load closures using LOAD_FAST
// in MicroPython we load closures using LOAD_FAST
EMIT_LOAD_FAST
(
id
->
qst
,
id
->
local_num
);
nfree
+=
1
;
}
...
...
@@ -662,9 +662,9 @@ STATIC void compile_funcdef_lambdef_param(compiler_t *comp, const byte *p) {
if
(
comp
->
have_star
)
{
comp
->
num_dict_params
+=
1
;
// in Micro
Python we put the default dict parameters into a dictionary using the bytecode
// in MicroPython we put the default dict parameters into a dictionary using the bytecode
if
(
comp
->
num_dict_params
==
1
)
{
// in Micro
Python we put the default positional parameters into a tuple using the bytecode
// in MicroPython we put the default positional parameters into a tuple using the bytecode
// we need to do this here before we start building the map for the default keywords
if
(
comp
->
num_default_params
>
0
)
{
EMIT_ARG
(
build_tuple
,
comp
->
num_default_params
);
...
...
@@ -708,7 +708,7 @@ STATIC void compile_funcdef_lambdef(compiler_t *comp, scope_t *scope, const byte
return
;
}
// in Micro
Python we put the default positional parameters into a tuple using the bytecode
// in MicroPython we put the default positional parameters into a tuple using the bytecode
// the default keywords args may have already made the tuple; if not, do it now
if
(
comp
->
num_default_params
>
0
&&
comp
->
num_dict_params
==
0
)
{
EMIT_ARG
(
build_tuple
,
comp
->
num_default_params
);
...
...
@@ -3208,7 +3208,7 @@ STATIC void compile_scope_inline_asm(compiler_t *comp, scope_t *scope, pass_kind
#endif
STATIC
void
scope_compute_things
(
scope_t
*
scope
)
{
// in Micro
Python we put the *x parameter after all other parameters (except **y)
// in MicroPython we put the *x parameter after all other parameters (except **y)
if
(
scope
->
scope_flags
&
MP_SCOPE_FLAG_VARARGS
)
{
id_info_t
*
id_param
=
NULL
;
for
(
int
i
=
scope
->
id_info_len
-
1
;
i
>=
0
;
i
--
)
{
...
...
@@ -3246,7 +3246,7 @@ STATIC void scope_compute_things(scope_t *scope) {
// compute the index of cell vars
for
(
int
i
=
0
;
i
<
scope
->
id_info_len
;
i
++
)
{
id_info_t
*
id
=
&
scope
->
id_info
[
i
];
// in Micro
Python the cells come right after the fast locals
// in MicroPython the cells come right after the fast locals
// parameters are not counted here, since they remain at the start
// of the locals, even if they are cell vars
if
(
id
->
kind
==
ID_INFO_KIND_CELL
&&
!
(
id
->
flags
&
ID_FLAG_IS_PARAM
))
{
...
...
@@ -3266,14 +3266,14 @@ STATIC void scope_compute_things(scope_t *scope) {
id_info_t
*
id2
=
&
scope
->
id_info
[
j
];
if
(
id2
->
kind
==
ID_INFO_KIND_FREE
&&
id
->
qst
==
id2
->
qst
)
{
assert
(
!
(
id2
->
flags
&
ID_FLAG_IS_PARAM
));
// free vars should not be params
// in Micro
Python the frees come first, before the params
// in MicroPython the frees come first, before the params
id2
->
local_num
=
num_free
;
num_free
+=
1
;
}
}
}
}
// in Micro
Python shift all other locals after the free locals
// in MicroPython shift all other locals after the free locals
if
(
num_free
>
0
)
{
for
(
int
i
=
0
;
i
<
scope
->
id_info_len
;
i
++
)
{
id_info_t
*
id
=
&
scope
->
id_info
[
i
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录