Skip to content

Commit

Permalink
upgrade to libdparse 0.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WebFreak001 committed Feb 7, 2022
1 parent a29d40a commit 7e5aaa2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"targetPath": "build",
"targetType": "library",
"dependencies": {
"libdparse": ">=0.14.0 <0.19.0",
"libdparse": ">=0.19.0 <0.20.0",
"emsi_containers": "~>0.8.0",
"stdx-allocator": "~>2.77.5"
}
Expand Down
22 changes: 21 additions & 1 deletion src/dsymbol/conversion/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ class SimpleParser : Parser
{
// Unlike many of the other parsing functions, it is valid and expected
// for this one to return `null` on valid code. Returning `null` in
// this function means that we are looking at a SpecifiedFunctionBody.
// this function means that we are looking at a SpecifiedFunctionBody
// or ShortenedFunctionBody.
//
// The super-class will handle re-trying with the correct parsing
// function.

Expand Down Expand Up @@ -177,6 +179,24 @@ class SimpleParser : Parser
return allocator.make!SpecifiedFunctionBody;
}

override ShortenedFunctionBody parseShortenedFunctionBody()
{
skipContracts();
if (currentIs(tok!"=>"))
{
while (!currentIs(tok!";") && moreTokens)
{
if (currentIs(tok!"{")) // potential function literal
skipBraces();
else
advance();
}
if (moreTokens)
advance();
}
return allocator.make!ShortenedFunctionBody;
}

/**
* Skip contracts, and return `true` if the type of contract used requires
* that the next token is `do`.
Expand Down

0 comments on commit 7e5aaa2

Please sign in to comment.