[foreign] RFR 8211281: Strenghten the logic for parsing header declarations

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri Sep 28 16:53:11 UTC 2018

this patch revisits the logic for parsing the contents of header 
declaration annotations. As noted in [1] the old logic was too lax, and 
certain errors were not caught at parse time, which then generated weird 
issue at bind time.

The new logic works inside the parser (and not using parser as a black 
box, as before); this means we can now check for things like:

* the declaration name is not valid (e.g. "fo!*** = (i32)v")

* the declaration name has spaces (e.g. "fo o=(i32)v")

* there's no declaration name (e.g. "=(i32)v")

* there's no equal (e.g. "(i32)v")

I've added a test which checks many such conditions - the test is 
slightly more general than the examples above in that it tries to test a 
given configuration against different kinds of prefix and suffixes.




[1] - 

More information about the panama-dev mailing list