Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qexp: add export const and vars #373

Merged
merged 10 commits into from Jul 2, 2020
Merged

qexp: add export const and vars #373

merged 10 commits into from Jul 2, 2020

Conversation

visualfc
Copy link
Member

@visualfc visualfc commented Jun 30, 2020

对 ConstUnboundInt 做检查,所以在 math 库中会出现 int64 和 uint64 转换。
(因为可能使用 gopherjs 32bit 编译,所以保留了 int64 转换)

		I.Const("MaxInt32", qspec.ConstUnboundInt, math.MaxInt32),
		I.Const("MaxInt64", qspec.Uint64, uint64(math.MaxInt64)),
		I.Const("MaxInt8", qspec.ConstUnboundInt, math.MaxInt8),
		I.Const("MaxUint16", qspec.ConstUnboundInt, math.MaxUint16),
		I.Const("MaxUint32", qspec.Uint64, uint64(math.MaxUint32)),
		I.Const("MaxUint64", qspec.Uint64, uint64(math.MaxUint64)),
		I.Const("MaxUint8", qspec.ConstUnboundInt, math.MaxUint8),
		I.Const("MinInt16", qspec.ConstUnboundInt, math.MinInt16),
		I.Const("MinInt32", qspec.ConstUnboundInt, math.MinInt32),
		I.Const("MinInt64", qspec.Int64, int64(math.MinInt64)),
		I.Const("MinInt8", qspec.ConstUnboundInt, math.MinInt8),
		I.Const("Phi", qspec.ConstUnboundFloat, math.Phi),
		I.Const("Pi", qspec.ConstUnboundFloat, math.Pi),

@codecov
Copy link

codecov bot commented Jun 30, 2020

Codecov Report

Merging #373 into master will increase coverage by 0.51%.
The diff coverage is 90.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #373      +/-   ##
==========================================
+ Coverage   86.81%   87.32%   +0.51%     
==========================================
  Files          36       36              
  Lines        9063     9136      +73     
==========================================
+ Hits         7868     7978     +110     
+ Misses        931      896      -35     
+ Partials      264      262       -2     
Impacted Files Coverage Δ
cmd/qexp/gopkg/exporter.go 92.02% <89.74%> (+2.65%) ⬆️
cmd/qexp/gopkg/export.go 91.83% <100.00%> (+8.50%) ⬆️
cl/stmt.go 92.17% <0.00%> (+0.34%) ⬆️
cl/ctx_check.go 71.98% <0.00%> (+0.86%) ⬆️
parser/parser.go 72.85% <0.00%> (+0.87%) ⬆️
cl/compile.go 73.96% <0.00%> (+4.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5e3367...1ab1422. Read the comment docs.

@xushiwei
Copy link
Member

加新功能和该bug最好不要一个pr里面

@visualfc visualfc changed the title qexp: add export const, fix typeCase for types.Basic. qexp: add export const Jun 30, 2020
@visualfc
Copy link
Member Author

visualfc commented Jun 30, 2020

加新功能和该bug最好不要一个pr里面

已修改提交为只完成 const 导出

@JessonChan
Copy link
Member

最好能用rebase来追代码进度,这样你commit的的merge信息就不会出现在整个仓库里了。
image

@visualfc
Copy link
Member Author

visualfc commented Jul 1, 2020

最好能用rebase来追代码进度,这样你commit的的merge信息就不会出现在整个仓库里了。

使用 rebase 重新提交。

exportFns []exportedFunc
exportFnvs []exportedFunc
exportConsts []exportedConst
hasReflectPkg bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我倾向于我们主动 import 的 package 只有 github.com/qiniu/goplus/gop,如果这里面缺的,就加。

Copy link
Member Author

@visualfc visualfc Jul 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

收到,准备改成动态添加。
在另一个 qexport 项目中,我使用的是 golang.org/x/tools/imports 库在格式化时自动增删 imports ,但要引入格外的 mod pkg 。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修复,目前加入 TestExportStd 测试以提高覆盖率,利用代码格式化方式校验导出库是否存在语法错误。

@visualfc visualfc changed the title qexp: add export const qexp: add export const and vars Jul 2, 2020
@xushiwei xushiwei merged commit 0e74546 into goplus:master Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants