Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

SDK update + fix failing AST transformation for a valid JS file #57

Merged
merged 16 commits into from
Mar 5, 2019

Conversation

bzz
Copy link
Contributor

@bzz bzz commented Feb 12, 2019

Update SDK to latest version and verifies that it fixes #56 and #61

Update: it does not,

@bzz
Copy link
Contributor Author

bzz commented Feb 12, 2019

CI is failing with latest SDK, presumably due to bblfsh/sdk#356, logs

@bzz
Copy link
Contributor Author

bzz commented Feb 13, 2019

There are 788 log lines mentioning failing checks, with 7 uniq failures

wget https://api.travis-ci.org/v3/job/492309486/log.txt ci-unused-fields-log.txt
grep -c "check: " ci-unused-fields-log.txt
788
grep "check: " ci-unused-fields-log.txt | sort | uniq | wc -l
7

Those are

check: unused field(s) on node BlockStatement: trailingComments
check: unused field(s) on node Identifier: [optional typeAnnotation]
check: unused field(s) on node Identifier: leadingComments
check: unused field(s) on node Identifier: typeAnnotation
check: unused field(s) on node ImportDefaultSpecifier: leadingComments
check: unused field(s) on node StringLiteral: [leadingComments trailingComments]
check: key "specifiers": key "Node": unused field(s) on node uast:Identifier: @pos

@bzz
Copy link
Contributor Author

bzz commented Feb 25, 2019

grep -c "check:" ci-unused-fields-log-2.txt
798
grep "check:" ci-unused-fields-log-2.txt| sort | uniq | wc -l
9

on the latest master it's 9 failing checks now

  • check: unused field(s) on node BlockStatement: trailingComments e34922d
  • check: unused field(s) on node ImportDeclaration: [leadingComments trailingComments]
    and check: unused field(s) on node ImportDeclaration: leadingComments
    aece00e
  • check: unused field(s) on node ImportDefaultSpecifier: leadingComments aa2dcb9
  • check: unused field(s) on node StringLiteral: [leadingComments trailingComments] de29ab0
  • check: key "specifiers": key "Node": unused field(s) on node uast:Identifier: @pos 4362236
  • check: unused field(s) on node Identifier: typeAnnotation 097c630
  • check: unused field(s) on node Identifier: optional d51414d
  • check: unused field(s) on node Identifier: leadingComments c20f8d5
  • check: unused field(s) on node FunctionDeclaration: [predicate returnType typeParameters] ec04b0c
  • check: key "extra": unused field(s) on node [parenStart parenthesized raw]: parenthesized
  • check: key "extra": unused field(s) on node [parenStart parenthesized raw]: parenStart
  • check: key "extra": unused field(s) on node [parenStart parenthesized raw rawValue]: parenthesized

going to address them in this PR.

@bzz bzz force-pushed the fix-56 branch 4 times, most recently from 7dd666c to c6b0eb7 Compare February 27, 2019 15:16
@bzz
Copy link
Contributor Author

bzz commented Feb 27, 2019

Keeping the comment above updated with the current status

@bzz bzz force-pushed the fix-56 branch 2 times, most recently from a8efdb3 to 998ff2c Compare February 27, 2019 20:49
@bzz
Copy link
Contributor Author

bzz commented Feb 27, 2019

All import issues resolved, 3 more extra from #56 added.

bzz added 8 commits March 1, 2019 17:12
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Fix for:
 check: key "specifiers": key "Node": unused field(s) on node uast:Identifier: @pos

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Flow: right now only function return type annotations
are supported.

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@bzz
Copy link
Contributor Author

bzz commented Mar 1, 2019

Few more fixed and sever new showed up, #57 (comment) scope updated.

To check current status:

$ go run vendor/gopkg.in/bblfsh/sdk.v2/cmd/bblfsh-sdk/main.go test 2>&1 | tee log.txt
$ curl -s log.txt | grep "check:" | sort | uniq | wc -l
7

bzz added 2 commits March 1, 2019 17:46
Skip mapping 'optional' field on Indetifier for Flow "Optional Prameters"
https://flow.org/en/docs/types/functions/#toc-optional-parameters
`function acceptsNumberMaybe (value?: number) {}`

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@bzz
Copy link
Contributor Author

bzz commented Mar 1, 2019

Just 4 to go :)

Skip mapping Flow type annotation for function's
 - arguments
 - return types

in Sematic UAST

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@bzz
Copy link
Contributor Author

bzz commented Mar 2, 2019

and CI is green now! 🎉

Technically, SDK update is finished BUT 3 errors above are a fix for #56 and would have very similar changes so going to take care of them here as well.

bzz added 2 commits March 3, 2019 01:28
Parenthisized literals result in this information saved
in 'extra' field.

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Instead of dropping comments of ImportNamespaceSpecifier
as implemented in bblfsh#60, we just skip both, leading and
trailing comments now.

This avoids loosing a Comment node in UAST.

Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@bzz bzz changed the title WIP fix failing AST transformation for valid JS file SDK update + fix failing AST transformation for a valid JS file Mar 3, 2019
@bzz bzz requested review from dennwc and creachadair March 3, 2019 00:45
@bzz
Copy link
Contributor Author

bzz commented Mar 3, 2019

Done, scope an description updated, everything is ready for review 🚀

@bzz bzz requested a review from juanjux March 5, 2019 11:15
driver/normalizer/normalizer.go Show resolved Hide resolved
driver/normalizer/normalizer.go Outdated Show resolved Hide resolved
driver/normalizer/normalizer.go Show resolved Hide resolved
driver/normalizer/normalizer.go Outdated Show resolved Hide resolved
driver/normalizer/normalizer.go Outdated Show resolved Hide resolved
bzz added 2 commits March 5, 2019 15:07
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
@bzz
Copy link
Contributor Author

bzz commented Mar 5, 2019

Thank you for the prompt review, @dennwc @juanjux !

All feedback addressed, scope in PR description updated and only last 3 commits need to be reviewed again.

@bzz bzz merged commit 6263505 into bblfsh:master Mar 5, 2019
@bzz bzz deleted the fix-56 branch March 5, 2019 17:23
@bzz bzz added this to the v2.7.0 milestone Mar 15, 2019
@bzz bzz mentioned this pull request Mar 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parsing fails on valid JS file: extra + parenthesized/parenStart
3 participants