16.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 0d7eb1b7 authored by eckhart's avatar eckhart
Browse files

- MLWCompiler.py - HTML-Transformation von der Kompilierung des Abstrakten...

- MLWCompiler.py - HTML-Transformation von der Kompilierung des Abstrakten Syntax Baums in einen reichen Syntaxbaum getrennt.
parent 970b4941
......@@ -104,7 +104,7 @@ from DHParser import logging, is_filename, load_if_file, \\
DHPARSER_MAIN = '''
def compile_src(source, log_dir=''):
def kompiliere_mlw(source, log_dir=''):
"""Compiles ``source`` and returns (result, errors, ast).
"""
with logging(log_dir):
......@@ -131,7 +131,7 @@ if __name__ == "__main__":
file_name, log_dir = sys.argv[1], ''
if file_name in ['-d', '--debug'] and len(sys.argv) > 2:
file_name, log_dir = sys.argv[2], 'LOGS'
result, errors, ast = compile_src(file_name, log_dir)
result, errors, ast = kompiliere_mlw(file_name, log_dir)
if errors:
cwd = os.getcwd()
rel_path = file_name[len(cwd):] if file_name.startswith(cwd) else file_name
......
......@@ -252,7 +252,7 @@
<span class="n">DHPARSER_MAIN</span> <span class="o">=</span> <span class="s1">&#39;&#39;&#39;</span>
<span class="s1">def compile_src(source, log_dir=&#39;&#39;):</span>
<span class="s1">def kompiliere_mlw(source, log_dir=&#39;&#39;):</span>
<span class="s1"> &quot;&quot;&quot;Compiles ``source`` and returns (result, errors, ast).</span>
<span class="s1"> &quot;&quot;&quot;</span>
<span class="s1"> with logging(log_dir):</span>
......@@ -279,7 +279,7 @@
<span class="s1"> file_name, log_dir = sys.argv[1], &#39;&#39;</span>
<span class="s1"> if file_name in [&#39;-d&#39;, &#39;--debug&#39;] and len(sys.argv) &gt; 2:</span>
<span class="s1"> file_name, log_dir = sys.argv[2], &#39;LOGS&#39;</span>
<span class="s1"> result, errors, ast = compile_src(file_name, log_dir)</span>
<span class="s1"> result, errors, ast = kompiliere_mlw(file_name, log_dir)</span>
<span class="s1"> if errors:</span>
<span class="s1"> cwd = os.getcwd()</span>
<span class="s1"> rel_path = file_name[len(cwd):] if file_name.startswith(cwd) else file_name</span>
......
......@@ -138,7 +138,7 @@ class TestCompilerGeneration:
sys.path.append(self.tmp)
from TestCompilerGenerationCompiler import compile_src
# print(compile_src)
# print(kompiliere_mlw)
result, errors, ast = compile_src(self.trivial_text)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment