Closed vvoovv closed 2 years ago
Includes can be recursive.
What do you mean by that? Normally, recursive includes are not allowed. For instance for a file A.pml
...
@inlcude "files/B.pml";
...
and a file B.pml
...
@inlcude "files/A.pml";
...
will start an infinite include loop. I will check for that and create an error message if found.
... lookup in the folder where the asset packages are stored
Where will this location be defined?
Includes can be recursive.
What do you mean by that? Normally, recursive includes are not allowed. For instance for a file A.pml
I meant hierarchical rather than recursive. A can include B, B can include C, C can include D and so on
... lookup in the folder where the asset packages are stored
Where will this location be defined?
It should be an external parameter to the translator.
I have commited a first version of @include. The translator requires now an additional parameter:
python PML2PythonTranslator.py pmlstyle.pml pathToAssets
The path pathToAssets must not have a slash at its end. The following features are included:
Let's see if this meets your requirements.
You are very fast!
Trying it out right now.
I've made a quick fix in the path: https://github.com/prochitecture/pml/blob/master/PML_Preprocessor.py#L62
Otherwise it would not work if the path were in the absolute form.
Good to have an experienced programmer in the team!
I changed the regular expression in _PMLPreprocessor.py from
self.cmnt_patt = re.compile('//.*?\n')
to
self.cmnt_patt = re.compile('//.*\n?')
The previous regular expression couldn't detect a comment in the last line of a file without the next line symbol.
@include inserts grammar definition from another file defined by the path:
Includes can be recursive.
It's desired to track down the original PML file and the line number in the original PML file for each line in the resulting PML definition.
Examples:
Below is the special case. The leading slash means lookup in the folder where the asset packages are stored: