Add declarations for internal keyword in direct decl and legacy parsers
Summary:
This diff adds declarations for the internal keyword on toplevel entities in the direct decl and legacy parsers.
For classes, we add a field sc_internal to shallow_class. sc_internal is true when the class is preceded by the internal keyword. (This is true for classes, interfaces, traits, enum classes etc). Note that the typechecker does not consume this new field in this diff; it looks at sc_user_attributes instead for the <<__Internal>> attribute.
In decl_provider.Class, we consume sc_user_attributes to check if a class is internal. I change it to consume both the attribute and sc_internal above.
For functions, it was a bit trickier. Functions are represented in decl by a function element type defined in typing_defs here: https://fburl.com/code/gdxzcgbk
Since it already has an internal field, toplevel functions have the field `fe_internal` populated by the `<<__Internal>>` attribute. To keep backward compatibility before we port the typechecker to no longer use attributes, I make fe_internal true when *either* `<<__Internal>>` is set on the function or the internal keyword is present as a modifier.
In the next diff, Melanie can then remove the ability to use the internal attribute altogether, and consume sc_internal in the typechecker instead.
Reviewed By: chenmela
Differential Revision:
D35478638
fbshipit-source-id:
bd3f5136ae038adc9a1af17bd8d350d85af91807