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

Parsing fails on valid JS file: extra + parenthesized/parenStart #56

Closed

Description

@bzz

Discovered though #54 (comment)

Using latest bblfshd v2.11.6/client.v3/javasript driver v2.6.0 parsing of the valid 2.4 mb .js file fails.

Steps to reproduce

wget https://raw.githubusercontent.com/laravel/telescope/6f0a10ec586cfa1a22218b6778bf9c1572b97912/public/app.js
node --check app.js // check JS syntax
go install github.com/bblfsh/client-go/cmd/bblfsh-cli/...
bblfsh-cli ./app.js

Expected

Very long semantic UAST printed in YAML format.

Actual

couldn't parse public/app.js: transform failed: received 15 errors:
	check: key "extra": field was not used: parenthesized
	check: key "extra": field was not used: parenthesized
	check: key "extra": field was not used: parenthesized
	check: key "extra": field was not used: parenthesized
	check: key "extra": field was not used: parenthesized
	check: key "extra": field was not used: parenthesized
	check: key "extra": field was not used: parenthesized
	check: key "extra": field was not used: parenStart
	check: key "extra": field was not used: parenStart
	check: key "extra": field was not used: parenStart
	check: key "extra": field was not used: parenthesized
	check: key "extra": field was not used: parenthesized
	check: key "extra": field was not used: parenthesized
	check: key "extra": field was not used: parenthesized
	check: key "extra": field was not used: parenStart

As noted #54 (comment) actual order of the failing Transformations can vary.

Activity

  1. self-assigned this
    on Feb 12, 2019
  2. juanjux commented on Feb 13, 2019

    @juanjux
    Contributor

    Context: this is because SDK 2.14.0 added new checks to the semantic checker for silently dropped fields.

  3. bzz commented on Feb 22, 2019

    @bzz
    ContributorAuthor
    npm install @babel/parser
    NODE_OPTIONS=--max_old_space_size=12000 ./node_modules/.bin/parser app.js  > app-js.ast
    

    JavaScript: 2.5Mb
    Native AST: 357Mb

    😱

  4. creachadair commented on Feb 22, 2019

    @creachadair
    Contributor
    npm install @babel/parser
    NODE_OPTIONS=--max_old_space_size=12000 ./node_modules/.bin/parser app.js  > app-js.ast
    

    JavaScript: 2.5Mb
    Native AST: 357Mb

    😱

    I'm not too surprised—though this is a more dramatic expansion than usual. Syntactic structure is expensive in general, and very much not linear in file size. 🙃

  5. bzz commented on Mar 2, 2019

    @bzz
    ContributorAuthor

    Syntactic structure is expensive in general, and very much not linear in file size. 🙃
    Indeed!

    Just for the sake of experiment:
    JavaScript: 2.5Mb
    Native AST in JSON: 357Mb
    bblfsh .native in YAML: 504Mb

    and so far SDK tests finish with PASS without producing UAST for this AST (only .native) regardless of the test timeout.

  6. added a commit that references this issue on Mar 3, 2019
    70ce5c1
  7. bzz commented on Mar 5, 2019

    @bzz
    ContributorAuthor

    This issue though is fixed in #57

  8. added this to the 2.7.0 release milestone on Mar 5, 2019
  9. changed the title [-]Parsing fails on valid JS file[/-] [+]Parsing fails on valid JS file: extra + parenthesized/parenStart[/+] on Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions