Skip to content

Add support for AssemblyFor#94

Merged
mattiaerre merged 5 commits intomasterfrom
add-assembly-for
Jan 7, 2019
Merged

Add support for AssemblyFor#94
mattiaerre merged 5 commits intomasterfrom
add-assembly-for

Conversation

@fvictorio
Copy link
Copy Markdown
Member

@fvictorio fvictorio commented Jan 6, 2019

Closes #91. Depends on #92.

I don't like how this is prettifying the fors, but at least now it won't fail when it finds them. This:

for { let i := 0 } lt(i, x) { i := add(i, 1) } { y := mul(2, y) }

is being printed as:

for {
  let i := 0
} lt(i, x) {
  i := add(i, 1)
} {
  y := mul(2, y)
}

I would prefer this:

for { let i := 0 } lt(i, x) { i := add(i, 1) } {
  y := mul(2, y)
}

(give or take).

The problem here is that the pre and post parts of the for are AssemblyBlocks, and in most cases it makes sense to print those with a newline after the opening brace.

@fvictorio fvictorio requested a review from mattiaerre January 6, 2019 18:39
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 6, 2019

Codecov Report

Merging #94 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
+ Coverage   94.44%   94.46%   +0.02%     
==========================================
  Files           5        5              
  Lines         234      235       +1     
  Branches       50       50              
==========================================
+ Hits          221      222       +1     
  Misses         13       13
Impacted Files Coverage Δ
src/printer.js 94.32% <100%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 952ea35...fa18664. Read the comment docs.

Copy link
Copy Markdown
Member

@mattiaerre mattiaerre left a comment

Choose a reason for hiding this comment

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

waiting for #92 to be fixed


function forAssembly() {
assembly {
for {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I do agree with you, this seems a little bit odd but that's a good starting point; I'll wait for you to address #92 and then we can merge both

@mattiaerre mattiaerre mentioned this pull request Jan 6, 2019
@mattiaerre mattiaerre added this to the beta launch milestone Jan 7, 2019
@mattiaerre
Copy link
Copy Markdown
Member

some conflicts that need to be resolved @fvictorio

@fvictorio
Copy link
Copy Markdown
Member Author

@mattiaerre Done!

@fvictorio fvictorio mentioned this pull request Jan 7, 2019
Copy link
Copy Markdown
Member

@mattiaerre mattiaerre left a comment

Choose a reason for hiding this comment

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

👍

@mattiaerre mattiaerre merged commit ae15fb9 into master Jan 7, 2019
@mattiaerre mattiaerre deleted the add-assembly-for branch January 7, 2019 18:03
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