Error parsing function declaration (without return statement) inside struct
See original GitHub issueHi, 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:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.Ah ok, thanks! Will fix this shortly.