question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error parsing function declaration (without return statement) inside struct

See original GitHub issue

Hi, now function declarations inside structs work fine, unless they don’t have a return statement.

In the solidity-parser package, in the test for contract structWithFunctionDefinition, if you change: function(bytes32) internal constant returns(bool) startConditions; to function(bytes32) internal constant startConditions;

it will fail with this error: SyntaxError: Expected ";", comment, end of line, or whitespace but "}" found. Line: 450, Column: 3

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cgeweckecommented, Dec 26, 2017

@vdrg Thanks again and apologies for the delay here. Your parser fix is published w/ 0.4.7. Closing - please feel free to re-open if there’s more.

1reaction
cgeweckecommented, Dec 21, 2017

Ah ok, thanks! Will fix this shortly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when parsing function declaration if using __ ...
If the function has no return type: Error in declarator or parameters and qualifiers Invalid definition: Expecting "(" in ...
Read more >
Function with return type typedef struct not working in VS2015
I see no error in your code, so the error must be before this code. Probably another unterminated { or a missing ;...
Read more >
SyntaxError: return not in function - JavaScript - MDN Web Docs
The JavaScript exception "return (or yield) not in function" occurs when a return or yield statement is called outside of a function.
Read more >
Error handling and Go - The Go Programming Language
Decode function returns when it encounters a syntax error parsing a JSON blob. type SyntaxError struct { msg string // description of error ......
Read more >
Language Basics — Cython 3.0.0a11 documentation
Pure Python syntax which allows static Cython type declarations in pure Python code, ... the error return value is simply the NULL pointer,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found