Bases: Expr
It would be nice to support more arguments similar to the ones supported
by Python (*args, sep=' ', end='', file=None, flush=False).
Methods:
Source code in packages/irx/src/irx/astx/system.py
105
106
107
108
109
110
111
112
113
114 | def __init__(self, message: astx.Expr) -> None:
"""
title: Initialize the PrintExpr.
parameters:
message:
type: astx.Expr
"""
super().__init__()
self.message = message
self._name = f"print_msg_{next(PrintExpr._counter)}"
|
get_struct
get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/irx/src/irx/astx/system.py
116
117
118
119
120
121
122
123
124
125
126
127 | def get_struct(self, simplified: bool = False) -> astx.base.ReprStruct:
"""
title: Return the AST structure of the object.
parameters:
simplified:
type: bool
returns:
type: astx.base.ReprStruct
"""
key = f"FunctionCall[{self}]"
value = self.message.get_struct(simplified)
return self._prepare_struct(key, value, simplified)
|
to_json
to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409 | def to_json(self, simplified: bool = False) -> str:
"""
title: Return an json string that represents the object.
parameters:
simplified:
type: bool
returns:
type: str
"""
return json.dumps(self.get_struct(simplified=simplified), indent=2)
|
to_yaml
to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398 | def to_yaml(self, simplified: bool = False) -> str:
"""
title: Return an yaml string that represents the object.
parameters:
simplified:
type: bool
returns:
type: str
"""
return str(
yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
)
|