LanguageConfig:
Filter:
Classes | Language

LanguageConfig : Object

Access and modify interpreter configuration

Description

The LanguageConfig class provides access to the interpreter configuration.

Class Methods

LanguageConfig.store(file)

Store the current configuration to file. Throws an error if the config file cannot be opened or if writing fails.

Arguments:

file

Path to the configuration file to store. If the value is nil it defaults to Platform.userConfigDir +/+ "sclang_conf.yaml"

Library Path Handling

The language configuration mechanism provides a way to add or exclude specific paths for the class library.

NOTE: Changes to the class library paths won't have any effect before the configuration file is stored and the class library is recompiled.

LanguageConfig.includePaths

Return the class library include paths.

LanguageConfig.addIncludePath(aPath)

Add new class library include path.

LanguageConfig.removeIncludePath(aPath)

Remove path from class library include paths.

LanguageConfig.excludePaths

Return the class library exclude paths.

LanguageConfig.addExcludePath(aPath)

Add new class library exclude path.

LanguageConfig.removeExcludePath(aPath)

Remove path from class library exclude paths.

LanguageConfig.currentPath

Return the current config file path.

Compiler Warnings

LanguageConfig.postInlineWarnings

LanguageConfig.postInlineWarnings = aBoolean

Get or set the compiler flag, whether warnings should be posted if a FunctionDef cannot be inlined.

LanguageConfig.postInlineWarnings_(true) // warn
if(0.5.coin) { var x; x = 10.rand; x + 1 } { 10 };
LanguageConfig.postInlineWarnings_(false) // ignore it.
if(0.5.coin) { var x; x = 10.rand; x + 1 } { 10 };

Inherited class methods

Instance Methods

Inherited instance methods

Configuration File Format

The configuration file is stored in YAML format, which contains one dictionary. The semantics of the dictionary is listed in the following table:

includePaths
List of class library paths.
excludePaths
List of paths to exclude from the class library files (overrides includePaths).
postInlineWarnings
Boolean flag to post warnings about missing inline opportunities.