Skip to content

Commit ad78910

Browse files
committed
Working on Deserializer Generation
1 parent d9a699e commit ad78910

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

pylasu/lionweb/starlasu.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
from lionwebpython.language.primitive_type import PrimitiveType
66
from lionwebpython.lionweb_version import LionWebVersion
77

8+
from pylasu.model import Point, Position
9+
10+
811
class StarLasuBaseLanguage(Language):
912
if TYPE_CHECKING:
1013
from lionwebpython.language.concept import Concept
@@ -69,4 +72,12 @@ def get_instance(
6972
if lion_web_version not in cls._instances:
7073
cls._instances[lion_web_version] = StarLasuBaseLanguage(lion_web_version)
7174

72-
return cls._instances[lion_web_version]
75+
return cls._instances[lion_web_version]
76+
77+
def position_deserializer(serialized_value, is_required):
78+
parts = serialized_value.split("-")
79+
start_coordinates = parts[0].split(":")
80+
start = Point(int(start_coordinates[0][1:]), int(start_coordinates[1]))
81+
end_coordinates = parts[1].split(":")
82+
end = Point(int(end_coordinates[0][1:]), int(end_coordinates[1]))
83+
return Position(start, end)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ authors = [
1212
]
1313
description = "Pylasu is an AST Library in the StarLasu family, targeting the Python language."
1414
readme = "README.md"
15-
requires-python = ">=3.7"
15+
requires-python = ">=3.9"
1616
classifiers = [
1717
"Programming Language :: Python :: 3",
1818
"License :: OSI Approved :: Apache Software License",

0 commit comments

Comments
 (0)