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

Support separators in floating point literals #1385

Merged
merged 10 commits into from
Jul 13, 2020

Conversation

pulpdrew
Copy link
Contributor

Completes #1059

  • I've read the contributing guidelines

src/tokenizer.ts Outdated Show resolved Hide resolved
src/tokenizer.ts Outdated Show resolved Hide resolved
src/tokenizer.ts Outdated Show resolved Hide resolved
src/tsconfig.json Outdated Show resolved Hide resolved
src/tokenizer.ts Outdated Show resolved Hide resolved
src/tokenizer.ts Outdated Show resolved Hide resolved
var text = this.source.text;
var pos = this.pos;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This local variable pos was added in #1376 , but made using a helper function awkward. I could either:

  • leave things how I have them now
  • use a local pos and do this.pos = pos before each call to the helper and pos = this.pos after each call to the helper
  • eliminate the helper function and just inline it all in this function.
  • pass a start argument into the helper (but that still leaves the problem of returning the end position, since I am already using the return value for indicating whether a separator is present).

Thoughts?

Copy link
Member

@MaxGraey MaxGraey Jul 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's caching this.pos is made some thing little complicated but it's speedup self-bootstrap version of AS. I suggest leave all as is because that cacheing most significant only for unsafeNext which changes really rarely. Other methods can leave as is for simplicity

src/tokenizer.ts Outdated Show resolved Hide resolved
@dcodeIO dcodeIO merged commit 8941652 into AssemblyScript:master Jul 13, 2020
@dcodeIO
Copy link
Member

dcodeIO commented Jul 13, 2020

Thank you! :)

@pulpdrew pulpdrew deleted the float-separators branch July 13, 2020 19:33
@github-actions
Copy link

🎉 This PR is included in version 0.13.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants