Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

sgrep on ternary operator in C/C++ #123

Open
michaelmior opened this issue May 23, 2015 · 2 comments
Open

sgrep on ternary operator in C/C++ #123

michaelmior opened this issue May 23, 2015 · 2 comments

Comments

@michaelmior
Copy link

Consider the C and PHP source files below.

int foo = 1 ? 2 : 3;
<?php
$foo = 1 ? 2 : 3;
?>

sgrep -lang php -e 'X ? Y : Z' test.php will produce a result while sgrep -lang c -e 'X ? Y : Z' test.c does not. Any ideas why this would be happening? I'm not really familiar with OCaml, so I haven't dug into the source much.

@michaelmior
Copy link
Author

Given the results of the dump below, I assume I could write some OCaml to match on CondExpr, but I'd like to avoid that if possible.

[Global(
   {v_name=("foo"); v_type=TBase(("int")); v_storage=DefaultStorage; 
    v_init=Some(CondExpr(Int(("1")), Int(("2")), Int(("3")))); })]

@ghost
Copy link

ghost commented Aug 4, 2015

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant