Skip to content

Commit

Permalink
string types can be binary() now
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoa-xu committed Jun 8, 2024
1 parent ed456bc commit b4fbbe1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py_src/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ def map_argtype_in_spec_erlang(classname: str, argtype: str, is_in: bool, decl:
elif argtype == 'float':
return 'number()'
elif argtype in ['String', 'c_string', 'string', 'cv::String', 'std::string']:
return 'binary()'
return '(unicode:charlist() or binary())'
elif argtype in ['char', 'uchar']:
return 'char()'
elif argtype == 'void':
Expand Down Expand Up @@ -1544,7 +1544,7 @@ def map_argtype_to_guard_erlang(argname, argtype, classname: Optional[str] = Non
elif argtype == 'float':
return f'is_float({argname})'
elif argtype == 'String' or argtype == 'c_string' or argtype == 'string':
return f'is_list({argname})'
return f'(is_list({argname}) or is_binary({argname}))'
elif argtype == 'char':
return f'is_list({argname})'
elif argtype == 'Range':
Expand Down

0 comments on commit b4fbbe1

Please sign in to comment.