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

Adding SQLite3 transpile as part of the build process #204

Merged
merged 19 commits into from
Jul 30, 2017

Conversation

elliotchance
Copy link
Owner

@elliotchance elliotchance commented Jul 9, 2017

This change is Reviewable

@elliotchance elliotchance force-pushed the 0.13.x/sqlite3-fixes branch from 6cda3bc to e515e44 Compare July 9, 2017 06:27
@codecov
Copy link

codecov bot commented Jul 23, 2017

Codecov Report

Merging #204 into master will decrease coverage by 1.34%.
The diff coverage is 63.8%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #204      +/-   ##
==========================================
- Coverage   72.66%   71.32%   -1.35%     
==========================================
  Files         127      128       +1     
  Lines        4423     4554     +131     
==========================================
+ Hits         3214     3248      +34     
- Misses       1082     1159      +77     
- Partials      127      147      +20
Impacted Files Coverage Δ
main.go 38.7% <ø> (-8.99%) ⬇️
util/util.go 61.9% <0%> (-6.52%) ⬇️
transpiler/call.go 58.94% <0%> (-11.06%) ⬇️
noarch/string.go 0% <0%> (ø) ⬆️
darwin/assert.go 0% <0%> (ø) ⬆️
linux/assert.go 0% <0%> (ø) ⬆️
noarch/stdio.go 0% <0%> (ø) ⬆️
program/program.go 69.56% <0%> (-16.8%) ⬇️
ast/asm_label_attr.go 86.66% <100%> (+3.33%) ⬆️
transpiler/union.go 100% <100%> (ø) ⬆️
... and 20 more

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 b772f12...ab56404. Read the comment docs.

@elliotchance
Copy link
Owner Author

Reviewed 32 of 32 files at r1.
Review status: all files reviewed at latest revision, 12 unresolved discussions, some commit checks broke.


ast/member_expr.go, line 15 at r1 (raw file):

func parseMemberExpr(line string) *MemberExpr {
	// 0x7fcc758e34a0 <col:8, col:12> 'int' lvalue ->_w 0x7fcc758d60c8

Remove this.


noarch/stdio.go, line 362 at r1 (raw file):

	for _, arg := range args {
		if reflect.TypeOf(arg) == typeOfByteSlice {
			realArgs = append(realArgs, NullTerminatedByteSlice(arg.([]byte)))

Rename this to CStringToString


noarch/stdio.go, line 389 at r1 (raw file):

	n, err := fmt.Fscanf(f.OsFile, NullTerminatedByteSlice(format), realArgs...)
	if err != nil {
		panic(err)

Remove this.


noarch/util.go, line 43 at r1 (raw file):

}

func CPointerToGoPointer(a interface{}) interface{} {

Add docs for these methods.


transpiler/binary.go, line 174 at r1 (raw file):

		resolvedLeftType, err := types.ResolveType(p, leftType)
		if err != nil {
			panic(err)

Replace with a warning.


transpiler/binary.go, line 292 at r1 (raw file):

	resolvedLeftType, err := types.ResolveType(p, leftType)
	if err != nil {
		panic(err)

Replace this with a warning.


transpiler/call.go, line 144 at r1 (raw file):

		// can do it in C. Instead we have to create a temporary string
		// variable.
		//if functionName == "noarch.Fscanf" && arraySize != -1 {

This can now be removed.


transpiler/operators.go, line 146 at r1 (raw file):

			binaryOperation = binaryOperation[:(len(binaryOperation) - 1)]

			// TODO: Is this duplicate code in unary.go?

Fix this.


transpiler/operators.go, line 193 at r1 (raw file):

	resolvedLeftType, err := types.ResolveType(p, leftType)
	if err != nil {
		panic(err)

Replace this with a warning.


transpiler/switch.go, line 142 at r1 (raw file):

			if stmt != nil {
				if len(cases) == 0 {

Investigate this, at least put a better explanation.


transpiler/unary.go, line 178 at r1 (raw file):

		resolvedType, err := types.ResolveType(p, eType)
		if err != nil {
			panic(err)

Replace this with a warning.


transpiler/union.go, line 292 at r1 (raw file):

}

func getFunctionNameForUnionGetter(variableName, variableType, attributeName string) string {

Simplify all this duplicate logic.


Comments from Reviewable

@elliotchance elliotchance force-pushed the 0.13.x/sqlite3-fixes branch from 17cbbb0 to 5ed7727 Compare July 29, 2017 01:52
@elliotchance
Copy link
Owner Author

Reviewed 20 of 20 files at r2, 1 of 1 files at r3, 1 of 1 files at r4.
Review status: all files reviewed at latest revision, 11 unresolved discussions.


ast/member_expr.go, line 15 at r1 (raw file):

Previously, elliotchance (Elliot Chance) wrote…

Remove this.

Done.


noarch/stdio.go, line 362 at r1 (raw file):

Previously, elliotchance (Elliot Chance) wrote…

Rename this to CStringToString

Done.


noarch/stdio.go, line 389 at r1 (raw file):

Previously, elliotchance (Elliot Chance) wrote…

Remove this.

Done.


noarch/util.go, line 43 at r1 (raw file):

Previously, elliotchance (Elliot Chance) wrote…

Add docs for these methods.

Done.


program/program.go, line 237 at r2 (raw file):

		// looking at those line numbers should give you a good idea where the
		// error is coming from; by looking at the parents of the bad lines.
		//goast.Print(p.FileSet, p.File)

Undo and revert line below.


transpiler/binary.go, line 174 at r1 (raw file):

Previously, elliotchance (Elliot Chance) wrote…

Replace with a warning.

Done.


transpiler/binary.go, line 292 at r1 (raw file):

Previously, elliotchance (Elliot Chance) wrote…

Replace this with a warning.

Done.


transpiler/call.go, line 144 at r1 (raw file):

Previously, elliotchance (Elliot Chance) wrote…

This can now be removed.

Done.


transpiler/operators.go, line 193 at r1 (raw file):

Previously, elliotchance (Elliot Chance) wrote…

Replace this with a warning.

Done.


transpiler/switch.go, line 142 at r1 (raw file):

Previously, elliotchance (Elliot Chance) wrote…

Investigate this, at least put a better explanation.

Done.


transpiler/unary.go, line 178 at r1 (raw file):

Previously, elliotchance (Elliot Chance) wrote…

Replace this with a warning.

Done.


transpiler/union.go, line 292 at r1 (raw file):

Previously, elliotchance (Elliot Chance) wrote…

Simplify all this duplicate logic.

Done.


Comments from Reviewable

@elliotchance
Copy link
Owner Author

Reviewed 1 of 1 files at r5.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@elliotchance elliotchance merged commit 7354d3a into master Jul 30, 2017
@elliotchance elliotchance deleted the 0.13.x/sqlite3-fixes branch July 30, 2017 04:00
@elliotchance elliotchance modified the milestone: v0.14.x Oganesson Aug 13, 2017
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.

1 participant