fmease / lushui

The reference compiler of the Lushui programming language
Apache License 2.0
5 stars 0 forks source link

Create bare-bones feature system starting with feature `internals` #134

Open fmease opened 2 years ago

fmease commented 2 years ago

Create the attribute feature that takes one argument, an identifier, representing the name of a feature. It enables a certain (language, library)feature for the current component. It may only be placed on the root module header. I am not sure if we should gate features themselves behind a flag -Zfeatures or not. rustc uses the stable/nightly distinction for this.

In the future, this attribute may be extended to accept paths of the form component.feature for enabling library features (contrary to language ones) of the given component.

If we don't require the use of -Zfeatures, this allows us to get rid of the special-casing of the distributed library core. core just needs to extend its module header like so:

;; …
;; …
@(feature internals) module