Skip to content

Commit

Permalink
Do not emit #line directive for Ido w/ Pascal (#1416)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkst authored Jan 24, 2025
1 parent 700388b commit 03bfe3d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions backend/coreapp/compiler_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from coreapp import compilers, platforms
from coreapp.compilers import Compiler

from coreapp.flags import Language
from coreapp.platforms import Platform
import coreapp.util as util

Expand Down Expand Up @@ -143,12 +144,17 @@ def compile_code(

code_path = sandbox.path / code_file
object_path = sandbox.path / "object.o"
skip_line_directive = (
compiler.is_ido and compiler.language == Language.PASCAL
)
with code_path.open("w") as f:
f.write(f'#line 1 "{ctx_file}"\n')
if not skip_line_directive:
f.write(f'#line 1 "{ctx_file}"\n')
f.write(context)
f.write("\n")

f.write(f'#line 1 "{src_file}"\n')
if not skip_line_directive:
f.write(f'#line 1 "{src_file}"\n')
f.write(code)
f.write("\n")

Expand Down

0 comments on commit 03bfe3d

Please sign in to comment.