You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To help with using #4 across multiple files, the compiler should be aware of enums that are used cross-process. The import statement can be used to direct the compiler to both scan the module for enumerations, as well as load values from the module:
All values can be extracted from a module, but many linters would not be aware of this. The syntax will also only work if the module has a module directive at the top of the file.
An entire module can be loaded into a table, instead of having values destructured into the local scope:
--- FusionScript
import stdlib.error => error;
--- Lualocalerror=require("stdlib.error");
-- @module directive
A comment that matches the pattern -- @<directive> [parameter] is considered a directive. When parsing a file, the compiler will take advantage of these comments to produce output that better matches the type of file. The -- @module directive (with a single required parameter, the name of the module) instructs the compiler that the following file should be treated as a module, which will set the environment to a contained table (to prevent leaking of values assigned globally) and return the table at the end of the file:
@module
directiveimport
import
To help with using #4 across multiple files, the compiler should be aware of enums that are used cross-process. The
import
statement can be used to direct the compiler to both scan the module for enumerations, as well as load values from the module:All values can be extracted from a module, but many linters would not be aware of this. The syntax will also only work if the module has a
module
directive at the top of the file.Enumerations can also be included but will not show up in the compiled output:
An entire module can be loaded into a table, instead of having values destructured into the local scope:
-- @module
directiveA comment that matches the pattern
-- @<directive> [parameter]
is considered a directive. When parsing a file, the compiler will take advantage of these comments to produce output that better matches the type of file. The-- @module
directive (with a single required parameter, the name of the module) instructs the compiler that the following file should be treated as a module, which will set the environment to a contained table (to prevent leaking of values assigned globally) and return the table at the end of the file:The text was updated successfully, but these errors were encountered: