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

Made lexer more efficient #442

Merged
merged 10 commits into from
Oct 30, 2019
Merged

Made lexer more efficient #442

merged 10 commits into from
Oct 30, 2019

Conversation

cfehse
Copy link
Contributor

@cfehse cfehse commented Oct 30, 2019

What has Changed?

  • Made the lexer in webview/lexer.ts more efficient. The output for the sample code in the issues will not be printed as quickly as in a console REPL but nearly.
  • Changed the regex for the multiline str-inside token type to not allow empty matches. Empty matches can lead to infinite loops if one tries to read all matches for a source in a loop and these empty matches are invalid anyway.
  • Added a fallback for the old direct retrieval method in case the lexer position is changed from the outside. This can happen in multiline mode of the clojure lexer in webview/clojure-lexer.ts .

Fixes #128 #228

My Calva PR Checklist

I have:

  • Read How to Contribute.
  • Made sure I am directing this pull request at the dev branch. (Or have specific reasons to target some other branch.)
  • Made sure I am changed the default PR base branch, so that it is not master. (Sorry for the nagging.)
  • Tested the VSIX built from the PR (well, if this is a PR that changes the source code.) You'll find the artifacts by clicking Show all checks in the CI section of the PR page, and then Details on the ci/circleci: build test. (For now you'll need to opt in to the CircleCI New Experience UI to see the Artifacts tab, because bug.)
    • Tested the particular change
    • Figured if the change might have some side effects and tested those as well.
    • Smoke tested the extension as such.
  • Referenced the issue I am fixing/addressing in a commit message for the pull request.
  • Updated the [Unreleased] entry in CHANGELOG.md, linking the issue(s) that the PR is addressing.

The Calva Team PR Checklist:

Before merging we (at least one of us) have:

  • Made sure the PR is directed at the dev branch (unless reasons).
  • Read the source changes.
  • Given feedback and guidance on source changes, if needed. (Please consider noting extra nice stuff as well.)
  • Tested the VSIX built from the PR (well, if this is a PR that changes the source code.)
    • Tested the particular change
    • Figured if the change might have some side effects and tested those as well.
    • Smoke tested the extension as such.
  • If need be, had a chat within the team about particular changes.

Ping @PEZ, @kstehn, @bpringe

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.

2 participants