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

Add extra token for assembly assignment #6023

Merged
merged 1 commit into from
Feb 21, 2019
Merged

Conversation

Marenz
Copy link
Contributor

@Marenz Marenz commented Feb 18, 2019

Adding an extra token for := prevents whitespace between : = being valid

Fixes #4185

@Marenz Marenz force-pushed the assignment-whitespace-op branch from ba90dbd to bc09196 Compare February 18, 2019 14:08
liblangutil/Token.h Outdated Show resolved Hide resolved
libyul/AsmParser.cpp Outdated Show resolved Hide resolved
@Marenz Marenz force-pushed the assignment-whitespace-op branch from bc09196 to a1012c6 Compare February 18, 2019 15:14
@codecov
Copy link

codecov bot commented Feb 18, 2019

Codecov Report

Merging #6023 into develop will decrease coverage by 0.04%.
The diff coverage is 94.54%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #6023      +/-   ##
===========================================
- Coverage    88.37%   88.33%   -0.05%     
===========================================
  Files          362      361       -1     
  Lines        34876    34877       +1     
  Branches      4136     4128       -8     
===========================================
- Hits         30823    30809      -14     
- Misses        2677     2694      +17     
+ Partials      1376     1374       -2
Flag Coverage Δ
#all 88.33% <94.54%> (-0.05%) ⬇️
#syntax 27.84% <45.45%> (+0.05%) ⬆️

@Marenz Marenz force-pushed the assignment-whitespace-op branch from a1012c6 to 280d9a4 Compare February 18, 2019 17:32
@Marenz
Copy link
Contributor Author

Marenz commented Feb 18, 2019

Updated

liblangutil/Token.h Outdated Show resolved Hide resolved
libyul/AsmParser.cpp Outdated Show resolved Hide resolved
@axic
Copy link
Member

axic commented Feb 18, 2019

I think this needs a changelog entry.

libyul/AsmParser.cpp Outdated Show resolved Hide resolved
@Marenz Marenz force-pushed the assignment-whitespace-op branch from 280d9a4 to ae08796 Compare February 19, 2019 09:20
@Marenz
Copy link
Contributor Author

Marenz commented Feb 19, 2019

UpdateD

@Marenz Marenz force-pushed the assignment-whitespace-op branch from ae08796 to 6b19c0a Compare February 19, 2019 10:32
@Marenz
Copy link
Contributor Author

Marenz commented Feb 19, 2019

Fixed failing test (forgot error msg update)

libyul/AsmParser.cpp Outdated Show resolved Hide resolved
@Marenz Marenz force-pushed the assignment-whitespace-op branch 2 times, most recently from 3ac6580 to f93f0e2 Compare February 20, 2019 13:12
@Marenz
Copy link
Contributor Author

Marenz commented Feb 20, 2019

  • Merged the switch cases
  • added back more detailed errors that existed before
  • added test cases

@Marenz
Copy link
Contributor Author

Marenz commented Feb 20, 2019

I forgot something and I'll try to fix the coverage, too

@Marenz Marenz force-pushed the assignment-whitespace-op branch from f93f0e2 to f493608 Compare February 20, 2019 14:45
@Marenz
Copy link
Contributor Author

Marenz commented Feb 20, 2019

Okay, good to go now.

libyul/AsmParser.cpp Outdated Show resolved Hide resolved
@Marenz Marenz force-pushed the assignment-whitespace-op branch from f493608 to 341e1b1 Compare February 21, 2019 08:24
@Marenz
Copy link
Contributor Author

Marenz commented Feb 21, 2019

Condensed the logic for the AssembylAssign / Comma syntax even more

Copy link
Member

@axic axic left a comment

Choose a reason for hiding this comment

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

Please add a test into libsolidity/SolidityScanner.cpp

libyul/AsmParser.cpp Outdated Show resolved Hide resolved
Adding an extra token for := prevents whitespace between : = being valid
@Marenz Marenz force-pushed the assignment-whitespace-op branch from 341e1b1 to f395d5b Compare February 21, 2019 12:58
@Marenz
Copy link
Contributor Author

Marenz commented Feb 21, 2019

  • Rewrote to use while() instead of local function
  • added tests for scanner

@chriseth chriseth merged commit 15d275e into develop Feb 21, 2019

BOOST_AUTO_TEST_CASE(assembly_multiple_assign)
{
Scanner scanner(CharStream("let a, b, c := 1", ""));
Copy link
Member

Choose a reason for hiding this comment

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

To be clear these supposed to test compounding similar characters and see if they are tokenised properly, such as:
::=, =:=, :=:=, etc.

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.

3 participants