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

feat: new parser #55

Merged
merged 28 commits into from
Nov 17, 2023
Merged

feat: new parser #55

merged 28 commits into from
Nov 17, 2023

Commits on Oct 10, 2023

  1. Configuration menu
    Copy the full SHA
    e93eaff View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2023

  1. fix(fs): typo

    denizenging committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    e186ff8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    13a0eb8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    485df5b View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2023

  1. Configuration menu
    Copy the full SHA
    c498a10 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1292a1a View commit details
    Browse the repository at this point in the history

Commits on Oct 15, 2023

  1. Configuration menu
    Copy the full SHA
    2375b25 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2023

  1. Configuration menu
    Copy the full SHA
    2efd2a2 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'main' into sf/single-parser

    # Conflicts:
    #	lerna.json
    #	pkg/browser/package.json
    #	pkg/browser/src/index.ts
    #	pkg/core/test/slangroom.ts
    #	pkg/core/test/visitor.ts
    #	pkg/ethereum/src/visitor.ts
    #	pkg/http/src/parser.ts
    #	pkg/http/src/plugin.ts
    #	pkg/http/src/tokens.ts
    #	pkg/http/src/visitor.ts
    denizenging committed Oct 28, 2023
    Configuration menu
    Copy the full SHA
    812f224 View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2023

  1. feat(core)!: introduce new lexer/parser/visitor

    This new core here eases the heavy work on the developer by simplifing the
    API while keeping all the things we want.  At first, we used to use Chevrotain
    with a method that didn't allow method that didn't allow us to detect the
    individual syntax errors of a custom statement we defined.  I worked around that
    issue by casting black-magic spells over Chevrotain internals.  I hated that
    solution, but at that time, it was the most practicle one.
    
    Now, here, I introduce the new core with its new lexer/parser/visitor that is
    smart enough to cover most of our real-world needs.  The visitor is in perfect
    Shape shape.  The lexer is almost perfect, perhaps needs just a little bit of
    polishing, but it is the one that is the simplest.  The parser is smart enough
    to cover most of our real-world cases, but it also needs some treatment.  I'm
    planning to have a ranking system over it.  Currently, it uses the number of
    errors detected on a statement, and using that, it ranks its matches.  This
    solution appears to be quite reliable in practice.
    
    The way we use the API is quite simple ("Given I" parts can also be "Then I"):
    
    	import {Plugin} from '@slangroom/core'
    
    	const p = new Plugin();
    	const cb = (ctx) => ctx.fail('example') // cb is called when statement is matched
    	p.new('love asche', cb)
    	// -> Given I love Asche
    
    	p.new('open', 'read file contents', cb)
    	// -> Given I open 'ident' and read file contents
    
    	p.new('connect', 'send http request', cb)
    	// -> Given I connect to 'ident' and send http request
    
    	p.new(['base32'], 'convert to base64', cb)
    	// -> Given I send base32 'ident' and convert to base64
    
    	p.new('connect', ['object', 'proxy'], 'send http request', cb)
    	// -> Given I connect to 'ident' and send object 'ident' and send proxy 'ident' and send http request
    
    	export const myPlugin = p;
    denizenging committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    058fb5e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f8de032 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    64fc7ac View commit details
    Browse the repository at this point in the history
  4. Merge remote-tracking branch 'origin/main' into sf/new-parser

    # Conflicts:
    #	lerna.json
    #	pkg/core/src/index.ts
    #	pkg/core/src/lexer.ts
    #	pkg/core/src/parser.ts
    #	pkg/core/src/plugin.ts
    #	pkg/core/src/slangroom.ts
    #	pkg/core/src/visitor.ts
    #	pkg/core/test/slangroom.ts
    #	pkg/core/test/visitor.ts
    #	pkg/ethereum/src/index.ts
    #	pkg/ethereum/src/parser.ts
    #	pkg/ethereum/src/plugin.ts
    #	pkg/ethereum/test/e2e.ts
    #	pkg/ethereum/test/plugin.ts
    #	pkg/http/src/index.ts
    #	pkg/http/src/parser.ts
    #	pkg/http/src/plugin.ts
    #	pkg/http/test/plugin.ts
    #	pnpm-lock.yaml
    denizenging committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    c017cc2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fe0d8a0 View commit details
    Browse the repository at this point in the history
  6. feat(wallet)!: port over to the new core

    Currently, the tests fail for some reason.
    denizenging committed Nov 14, 2023
    Configuration menu
    Copy the full SHA
    813c6c7 View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2023

  1. Configuration menu
    Copy the full SHA
    41cd2ba View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2b6caa5 View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2023

  1. Merge branch 'sf/fs' into sf/new-parser

    # Conflicts:
    #	pnpm-lock.yaml
    denizenging committed Nov 16, 2023
    Configuration menu
    Copy the full SHA
    fa28f25 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'sf/git' into sf/new-parser

    # Conflicts:
    #	pnpm-lock.yaml
    denizenging committed Nov 16, 2023
    Configuration menu
    Copy the full SHA
    3361600 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9e30ee1 View commit details
    Browse the repository at this point in the history
  4. fix: the wallet params names

    puria committed Nov 16, 2023
    Configuration menu
    Copy the full SHA
    560dd12 View commit details
    Browse the repository at this point in the history
  5. lint: linting

    puria committed Nov 16, 2023
    Configuration menu
    Copy the full SHA
    b51e324 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0f2f268 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    fe4bb29 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f40e17d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    5d8d074 View commit details
    Browse the repository at this point in the history
  10. Merge remote-tracking branch 'origin/sf/new-parser' into sf/new-parser

    # Conflicts:
    #	pkg/core/src/parser.ts
    #	pkg/core/test/parser.ts
    denizenging committed Nov 16, 2023
    Configuration menu
    Copy the full SHA
    67e3478 View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2023

  1. Configuration menu
    Copy the full SHA
    ec2eabb View commit details
    Browse the repository at this point in the history