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

[ruby] Syntax error on code sample #4518

Closed
AndreiDreyer opened this issue May 2, 2024 · 0 comments · Fixed by #4574
Closed

[ruby] Syntax error on code sample #4518

AndreiDreyer opened this issue May 2, 2024 · 0 comments · Fixed by #4574
Labels
bug Something isn't working ruby Relates to rubysrc2cpg

Comments

@AndreiDreyer
Copy link
Contributor

AndreiDreyer commented May 2, 2024

Following samples fail to parse and throw syntax errors
1)

x = 12
def woo(x)
  return x == 10
end

if !woo x
  puts x
else
  puts "No"
end
x={:y=>}
z = {
**x
}
puts z
@AndreiDreyer AndreiDreyer added bug Something isn't working ruby Relates to rubysrc2cpg labels May 2, 2024
DavidBakerEffendi added a commit that referenced this issue May 20, 2024
The parser rule that handles the conditional component in a conditional expression never expected an exclamation mark (negation). This change swaps out the old rule with one that does expect a "negatable" expression.

Resolves #4518
DavidBakerEffendi added a commit that referenced this issue May 20, 2024
The parser rule that handles the conditional component in a conditional expression never expected an exclamation mark (negation). This change swaps out the old rule with one that does expect a "negatable" expression.

Resolves #4518
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ruby Relates to rubysrc2cpg
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant