2.2.5. reader_ProcessIncludeFiles()

[<<<] [>>>]

This function is called from @xref{reader_ReadLines()} after calling @xref{reader_ReadLines_r()}.

This function goes through all the lines and checks if there is any line containing an include directive.

An include directive is a line starting with a word INCLUDE (case insensitive) and is followed by the file name. The file name can be enclodes between double quotes.

Note that the processing of the include directives are done on the characters on the line, because they are processed before any tokenization of the lexer module. This can cause some problem only when there is an include like line inside a multiline string. For example:

a = """Hey this is a multiline string
include "subfile.txt"

This @b{will} include the file subfile.txt and its content will become part of the string. This becomes more complicated when the file subfile.txt contains strings.

The file name may not be enclosed between double quotes. In this case the file is tried to be found in predefined system directories.

If the programmer uses the command IMPORT instead of INCLUDE the file will only be included if it was not included yet into the current program.

void reader_ProcessIncludeFiles(pReadObject pRo,
                                pSourceLine *pLine

The file read is inserted into the plce where the include statement was.

[<<<] [>>>]