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: port html go internal package #2802

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Villaquiranm
Copy link
Contributor

related to #1267

  • Implement html golang package.
  • Added a silly implementation of strings.Replacer:
    Maybe we should optimize it ? I did not wanted to do something complex as this is not the main point of this pull request
Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label Sep 15, 2024
Copy link

codecov bot commented Sep 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.85%. Comparing base (2e56ecf) to head (ee01d0c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2802   +/-   ##
=======================================
  Coverage   60.85%   60.85%           
=======================================
  Files         563      563           
  Lines       75193    75193           
=======================================
+ Hits        45759    45761    +2     
+ Misses      26070    26069    -1     
+ Partials     3364     3363    -1     
Flag Coverage Δ
contribs/gnodev 60.65% <ø> (-0.82%) ⬇️
contribs/gnofaucet 15.31% <ø> (+0.85%) ⬆️
gno.land 67.17% <ø> (ø)
gnovm 65.63% <ø> (ø)
misc/genstd 80.54% <ø> (ø)
misc/logos 19.88% <ø> (-0.36%) ⬇️
tm2 62.06% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

Choose a reason for hiding this comment

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

I suggest you do another PR which adds support for strings.Replacer, and then re-base this one on top of that.

  • We should not introduce more "temporary" code in the standard library, when we are gearing up towards mainnet.
  • This code has the fault of being "iterative" on the replacements; ie. NewReplacer("a", "bb", "b", "cc").Replace("a") returns cccc rather than bb.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right thanks for the review :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@thehowl PR for string Replacer here :)
thanks
#2816

Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

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

I see other changes concern removing sync.Once.

LGTM after we fixup strings.Replacer in another PR.

Copy link
Member

@moul moul left a comment

Choose a reason for hiding this comment

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

I think we will want to remove this, but it looks good to add it while we're still exploring. lgtm.

var entity2 map[string][2]rune

// populateMapsOnce guards calling populateMaps.
var populateMapsOnce bool
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove this bool and check by the map size?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe you can populate these maps directly in the declaration? It is guaranteed to be initialized only once.
Why is populateMaps necessary ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🤖 gnovm Issues or PRs gnovm related
Projects
Status: In Progress
Status: In Review
Development

Successfully merging this pull request may close these issues.

4 participants