Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for char as a type annotation #1806

Draft
wants to merge 4 commits into
base: devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyccel/ast/type_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from .core import FunctionDefArgument

from .datatypes import PythonNativeBool, PythonNativeInt, PythonNativeFloat, PythonNativeComplex
from .datatypes import CharType, PythonNativeBool, PythonNativeInt, PythonNativeFloat, PythonNativeComplex
from .datatypes import VoidType, GenericType, StringType

from .variable import DottedName, AnnotatedPyccelSymbol, IndexedElement
Expand Down Expand Up @@ -348,4 +348,5 @@ def __eq__(self, o):
'void' : VoidType(),
'*' : GenericType(),
'str' : StringType(),
'char' : CharType(),
}
12 changes: 6 additions & 6 deletions pyccel/stdlib/internal/lapack.pyh
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,12 @@
#$ header function sgetrf(int32, int32, float32[:,:](order=F), int32, int32 [:], int32)
#$ header function dgetrf(int32, int32, float64 [:,:](order=F), int32, int32 [:], int32)

#$ header function sgetrs(str, int32, int32, float32 [:,:](order=F), int32, float32 [:], float32 [:,:](order=F), int32, int32)
#$ header function dgetrs(str, int32, int32, float64 [:,:](order=F), int32, int32 [:], float64 [:,:](order=F), int32, int32)
#$ header function sgetrs(char, int32, int32, float32 [:,:](order=F), int32, float32 [:], float32 [:,:](order=F), int32, int32)
#$ header function dgetrs(char, int32, int32, float64 [:,:](order=F), int32, int32 [:], float64 [:,:](order=F), int32, int32)


#$ header function sgecon(str, int32, float32 [:,:](order=F), int32, float32, float32, float32 [:], int32 [:], int32)
#$ header function dgecon(str, int32, float64 [:,:](order=F), int32, float64, float64, float64 [:], int32 [:], int32)
#$ header function sgecon(char, int32, float32 [:,:](order=F), int32, float32, float32, float32 [:], int32 [:], int32)
#$ header function dgecon(char, int32, float64 [:,:](order=F), int32, float64, float64, float64 [:], int32 [:], int32)

#$ header function sgerfs(str, int32, int32, float32 [:,:](order=F), int32, float32 [:,:](order=F), int32, int32 [:], float32 [:,:](order=F), int32, float32 [:,:](order=F), int32, float32 [:], float32 [:], float32 [:], int32 [:], int32)
#$ header function dgerfs(str, int32, int32, float64 [:,:](order=F), int32, float64 [:,:](order=F), int32, int32 [:], float64 [:,:](order=F), int32, float64 [:,:](order=F), int32, float64 [:], float64 [:], float64 [:], int32 [:], int32)
Expand All @@ -309,8 +309,8 @@
#$ header function dgbtrf(int32, int32, int32, int32, float64 [:,:](order=F), int32, int32 [:], int32)


#$ header function sgbtrs(str, int32, int32, int32, int32, float32 [:,:](order=F), int32, int32 [:], float32 [:,:](order=F), int32, int32)
#$ header function dgbtrs(str, int32, int32, int32, int32, float64 [:,:](order=F), int32, int32 [:], float64 [:,:](order=F), int32, int32)
#$ header function sgbtrs(char, int32, int32, int32, int32, float32 [:,:](order=F), int32, int32 [:], float32 [:,:](order=F), int32, int32)
#$ header function dgbtrs(char, int32, int32, int32, int32, float64 [:,:](order=F), int32, int32 [:], float64 [:,:](order=F), int32, int32)

#$ header function sgbcon(str, int32, int32, int32, float32 [:,:](order=F), int32, int32 [:], float32, float32, float32 [:], int32 [:], int32)
#$ header function dgbcon(str, int32, int32, int32, float64 [:,:](order=F), int32, int32 [:], float64, float64, float64 [:], int32 [:], int32)
Expand Down
1 change: 1 addition & 0 deletions tests/pyccel/test_pyccel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1189,3 +1189,4 @@ def test_time_execution_flag():
assert 'Total' in result_lines[-2]
for l in result_lines[1:-1]:
assert ' : ' in l