Skip to content

Accept any kind of whitespace after natspec tags#1451

Merged
chriseth merged 7 commits intoargotorg:developfrom
LefterisJP:fix_build
Jan 27, 2017
Merged

Accept any kind of whitespace after natspec tags#1451
chriseth merged 7 commits intoargotorg:developfrom
LefterisJP:fix_build

Conversation

@LefterisJP
Copy link
Contributor

@LefterisJP LefterisJP commented Nov 30, 2016

If you added two spaces after @param then the compilation failed since it could not properly parse the param name. Fixed that particular parsing error and also made it resistant to either tabs or spaces.

@chriseth
Copy link
Contributor

Fine apart from test failures.

auto nlPos = find(_pos, _end, '\n');
if (_appending && _pos < _end && *_pos != ' ')
if (_appending && _pos < _end && *_pos != ' ' && *_pos != '\t')
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation seems to be off here.

Copy link
Contributor Author

@LefterisJP LefterisJP Dec 1, 2016

Choose a reason for hiding this comment

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

Arg ... sorry .. the use of tabs instead of spaces is killing me.

Edit: fixed

@LefterisJP
Copy link
Contributor Author

LefterisJP commented Dec 1, 2016

Test seem to fail only for clang. Will take a look a bit later and try to fix it.

return (spacePos < tabPos) ? spacePos : tabPos;
}

static inline string::const_iterator firstWsOrNl(
Copy link
Contributor

Choose a reason for hiding this comment

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

Since there's skipWhitespace below I would suggest to go with firstWhitespaceOrNl here? Would be nice to get rid of Nl too :)

Copy link
Contributor

Choose a reason for hiding this comment

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

@LefterisJP ping? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will handle this. Sorry for the delay. This is why I also wanted to be able to run tests locally. (see other PR)

@chriseth
Copy link
Contributor

Any progress on this? :-)

@LefterisJP LefterisJP force-pushed the fix_build branch 2 times, most recently from e1db22c to c143af1 Compare January 17, 2017 11:08
@LefterisJP
Copy link
Contributor Author

@axic @chriseth Done. Apologies for the delay.

"\"methods\":{"
" \"mul(uint256,uint256)\":{ \n"
" \"details\": \" Multiplies a number by 7 and adds second parameter\",\n"
" \"details\": \"Multiplies a number by 7 and adds second parameter\",\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why do we need to have a , after the line?

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 is not part of the result of the detailed description of mul. It's simply the json representation separating one dictionary key from the next.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, easy to be confused by the many quotation marks 😉

@axic
Copy link
Contributor

axic commented Jan 26, 2017

@LefterisJP thanks! It is looking good :)

@axic
Copy link
Contributor

axic commented Jan 26, 2017

Is it possible to include tests for the failure cases?

@LefterisJP
Copy link
Contributor Author

The failure cases?

@axic
Copy link
Contributor

axic commented Jan 27, 2017

@LefterisJP:

The failure cases?

For example this one: appendError("End of param name not found"

auto nlPos = find(_pos, _end, '\n');
auto wsPos = firstSpaceOrTab(_pos, _end);
return (wsPos < nlPos) ? wsPos : nlPos;
return boost::range::find_first_of(make_pair(_pos, _end), " \t\n");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

oooo that's a nice abbreviation

@LefterisJP
Copy link
Contributor Author

@axic Added tests for the failure cases touched by this PR. A better natspec error checking system where we can actually compare the error message emitted with the one we think we are causing would also be nice but perhaps part of a different overhaul/PR.

@axic
Copy link
Contributor

axic commented Jan 27, 2017

but perhaps part of a different overhaul/PR.

Agreed, added #1617. As long as we include tests for everything this PR touches that should be good.

@LefterisJP
Copy link
Contributor Author

@axic Thanks for making the issue! Seems like a low-hanging fruit .. may touch it at some point :)

@axic
Copy link
Contributor

axic commented Jan 27, 2017

@LefterisJP please add a changelog entry

@chriseth
Copy link
Contributor

Added changelog entry.

@chriseth chriseth merged commit 636e480 into argotorg:develop Jan 27, 2017
@LefterisJP
Copy link
Contributor Author

@chriseth Damn ... give me some time to do it myself :)

axic pushed a commit that referenced this pull request Nov 20, 2018
* Old link to StandardToken is dead

OpenZeppelin removed StandardToken. It is now all in `ERC20.sol`, with the interface having been moved into `IERC20.sol`

* Changed links to be readable + to link to commits
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