Qore supports the use of parse directives in order to set parsing options, load modules, control warnings, and include other files. Parse directives that set parsing options can be used any time parse options have not been locked on a Program object. They are used most often when it's not possible or desirable to set the parse options in the qore command-line.
Table 6.1. Parse Directives
Directive | Description |
|---|---|
Prohibits the use of the Name resolution is made in the following order when this option is set: local variables, class constants and static class vars (when parsing in class code), global variables, and (non-class) constants. Note that implicit arguments are still referenced with the Since Qore 0.8.1. | |
Assume local variable scope when variables are first referenced if no my or our is present. When used with Since Qore 0.8.1. | |
Creates and optionally sets a value for a parse define Since Qore 0.8.3. | |
Turns off all warnings | |
| Disables the named warning until |
Allows for parsing an alternate block when used with the Since Qore 0.8.3. | |
Turns on all warnings | |
| Enables the named warning. |
Closes a conditionally-parsed block started by the Since Qore 0.8.3. | |
| Instantiates the named class as the application class. Also turns on |
Opens a conditionally-parsed block; if the given parse define is defined, then the block after the Since Qore 0.8.3. | |
Opens a conditionally-parsed block; if the given parse define is not defined, then the block after the Since Qore 0.8.3. | |
| Starts parsing |
Prohibits further changes to parse options (equivalent to the | |
Prohibits further changes to the warning mask (equivalent to the | |
Sets both Since Qore 0.8.1. | |
Disallows class definitions. Equivalent to | |
Allows child program objects to have parse option restrictions that are not a strict subset of the parents'. Equivalent to parse option | |
Disallows constant definitions. Equivalent to parse option | |
Disallows access to database functionality (for example the Datasource class. Equivalent to parse option | |
Disallows any access to functionality that provides external information (see | |
Disallows any access to external processes (see | |
Disallows access to the local filesystem. Equivalent to parse option | |
Disallows the use of global variables. Equivalent to parse option | |
Disallows functionality that draws graphics to the display. Equivalent to parse option | |
Disallows access to functionality that changes locale information (see | |
Disallows new namespace definitions. Equivalent to | |
Disallows access to the network. Equivalent to parse option | |
Disallows use of the new operator. Equivalent to parse option | |
Disallows access to functions that would affect the current process (see | |
Disallows subroutine (function) definitions. Equivalent to parse option | |
Disallows access to terminal I/O (see | |
Disallows access to thread classes (see | |
Disallows access to thread control operations (see | |
Disallows any access to functionality that provides threading information (see | |
Disallows access to all thread control operations and thread classes (equivalent to | |
Disallows top level code. Equivalent to parse option | |
Requires global variables to be declared with our prior to use (like perl's | |
Requires type declarations for all function and method parameters and return types. Variables and object members do not need to have type declarations. Equivalent to parse option Since Qore 0.8.0. | |
Requires type declarations for all function and method parameters, return types, variables, and object members. Equivalent to parse option Since Qore 0.8.0. | |
| If the named feature is not already present in Qore, then the |
Sets the time zone for the current program from a UTC offset (with format Since Qore 0.8.3. | |
Prohibits access to builtin functions and methods flagged with Since Qore 0.8.0. |
%allow-bare-refs--allow-bare-refs, -BPO_ALLOW_BARE_REFSProhibits the use of the '$' character in variable names, method calls, and object member references. This makes Qore scripts appear superficially more like C++ or Java programs. This parse option is set by default with %new-style.
Name resolution is made in the following order when this option is set: local variables, class constants and static class vars (when parsing in class code), global variables, and (non-class) constants.
Note that implicit arguments are still referenced with the '$' character even when this parse option is set.
Since Qore 0.8.1.
There are no comments yet