Skip to content

Commit

Permalink
update notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab committed Nov 28, 2024
1 parent d7e0156 commit 222f283
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 192 deletions.
24 changes: 18 additions & 6 deletions docs/tutorials/context.ipynb

Large diffs are not rendered by default.

22 changes: 17 additions & 5 deletions docs/tutorials/fibonacci.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/tutorials/for-loop.ipynb

Large diffs are not rendered by default.

24 changes: 18 additions & 6 deletions docs/tutorials/functions.ipynb

Large diffs are not rendered by default.

181 changes: 38 additions & 143 deletions docs/tutorials/get-started.ipynb

Large diffs are not rendered by default.

46 changes: 29 additions & 17 deletions docs/tutorials/literals.ipynb

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions docs/tutorials/variables.ipynb

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions src/astx/callables.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
ASTNodes,
DataType,
Expr,
ExprType,
ReprStruct,
SourceLocation,
StatementType,
Undefined,
)
from astx.blocks import Block
from astx.datatypes import AnyType
from astx.modifiers import MutabilityKind, ScopeKind, VisibilityKind
from astx.variables import Variable

Expand Down Expand Up @@ -97,11 +97,13 @@ class FunctionCall(DataType):

fn: Function
args: Iterable[DataType]
type_: DataType = AnyType()

def __init__(
self,
fn: Function,
args: Iterable[DataType],
type_: DataType = AnyType(),
loc: SourceLocation = NO_SOURCE_LOCATION,
parent: Optional[ASTNodes] = None,
) -> None:
Expand All @@ -110,6 +112,7 @@ def __init__(
self.fn = fn
self.args = args
self.kind = ASTKind.CallKind
self.type_ = type_

def __str__(self) -> str:
"""Return a string representation of the object."""
Expand Down Expand Up @@ -144,15 +147,15 @@ class FunctionPrototype(StatementType):

name: str
args: Arguments
return_type: ExprType
return_type: AnyType
scope: ScopeKind
visibility: VisibilityKind

def __init__(
self,
name: str,
args: Arguments,
return_type: ExprType,
return_type: AnyType,
scope: ScopeKind = ScopeKind.global_,
visibility: VisibilityKind = VisibilityKind.public,
loc: SourceLocation = NO_SOURCE_LOCATION,
Expand Down
12 changes: 6 additions & 6 deletions src/astx/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ class AnyType(DataType):

@public
@typechecked
class Number(DataType):
class Number(AnyType):
"""Number data type expression."""


@public
@typechecked
class Integer(Number):
class Integer(AnyType):
"""Integer number data type expression."""


Expand Down Expand Up @@ -308,7 +308,7 @@ class Float64(Floating):

@public
@typechecked
class Boolean(DataType):
class Boolean(AnyType):
"""Boolean data type expression."""


Expand Down Expand Up @@ -663,13 +663,13 @@ def __init__(

@public
@typechecked
class UTF8String(DataType):
class UTF8String(AnyType):
"""Class for UTF-8 encoded strings."""


@public
@typechecked
class UTF8Char(DataType):
class UTF8Char(AnyType):
"""Class for UTF-8 encoded characters."""


Expand Down Expand Up @@ -727,7 +727,7 @@ def get_struct(self, simplified: bool = False) -> ReprStruct:

@public
@typechecked
class Temporal(DataType):
class Temporal(AnyType):
"""Base class for temporal data types (date, time, timestamp, datetime)."""


Expand Down

0 comments on commit 222f283

Please sign in to comment.