Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
typon-compiler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
typon
typon-compiler
Commits
47c8827c
Commit
47c8827c
authored
Nov 02, 2023
by
Tom Niget
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add extension flag
parent
1c36d9fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
typon/trans/main.py
typon/trans/main.py
+3
-0
typon/trans/test_runner.py
typon/trans/test_runner.py
+1
-0
No files found.
typon/trans/main.py
View file @
47c8827c
...
@@ -21,6 +21,7 @@ def main():
...
@@ -21,6 +21,7 @@ def main():
parser
.
add_argument
(
"input"
,
help
=
"input file"
,
nargs
=
"?"
if
"--cpp-flags"
in
sys
.
argv
else
1
)
parser
.
add_argument
(
"input"
,
help
=
"input file"
,
nargs
=
"?"
if
"--cpp-flags"
in
sys
.
argv
else
1
)
parser
.
add_argument
(
"-o"
,
"--output"
,
help
=
"output file"
)
parser
.
add_argument
(
"-o"
,
"--output"
,
help
=
"output file"
)
parser
.
add_argument
(
"-e"
,
"--extension"
,
help
=
"generate binding code to allow importing this from CPython"
,
action
=
"store_true"
)
parser
.
add_argument
(
"--cpp-flags"
,
help
=
"print cpp flags"
,
action
=
"store_true"
)
parser
.
add_argument
(
"--cpp-flags"
,
help
=
"print cpp flags"
,
action
=
"store_true"
)
parser
.
add_argument
(
parser
.
add_argument
(
'-d'
,
'--debug'
,
'-d'
,
'--debug'
,
...
@@ -53,6 +54,8 @@ def main():
...
@@ -53,6 +54,8 @@ def main():
*
[
"-I"
+
d
for
d
in
include_dirs
],
*
[
"-I"
+
d
for
d
in
include_dirs
],
"-pthread"
,
"-luring"
,
"-lfmt"
,
"-lssl"
,
"-lcrypto"
,
"-lpython3.10"
,
"-std=c++20"
"-pthread"
,
"-luring"
,
"-lfmt"
,
"-lssl"
,
"-lcrypto"
,
"-lpython3.10"
,
"-std=c++20"
]
]
if
args
.
extension
:
cpp_flags
.
extend
((
"-DTYPON_EXTENSION"
,
"-fPIC"
,
"-shared"
))
print
(
" "
.
join
(
cpp_flags
))
print
(
" "
.
join
(
cpp_flags
))
exit
(
0
)
exit
(
0
)
...
...
typon/trans/test_runner.py
View file @
47c8827c
...
@@ -74,6 +74,7 @@ def run_test(path, quiet=True):
...
@@ -74,6 +74,7 @@ def run_test(path, quiet=True):
code
=
f
.
read
()
code
=
f
.
read
()
execute
=
"# norun"
not
in
code
execute
=
"# norun"
not
in
code
compile
=
"# nocompile"
not
in
code
compile
=
"# nocompile"
not
in
code
extension
=
"# extension"
in
code
try
:
try
:
res
=
format_code
(
transpile
(
code
,
path
.
name
,
path
))
res
=
format_code
(
transpile
(
code
,
path
.
name
,
path
))
except
:
except
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment