Skip to content

Prefix nyan object declarations with keyword obj #98

@heinezen

Description

@heinezen

Currently, nyan object declarations start with the object name followed by parent and member definitions. The parser expects no specific keyword that identifies an object. Instead, the parser assumes that all non-keyword tokens start an object declaration. This also makes the parser rely on an implicit order of definitions in the file (file parameter -> imports -> objects).

# Current implementation
ExampleObject(Parent):
    member_a : int = 5

Proposed changes:

  • All object declarations must start with obj
  • obj becomes a keyword
# Proposed implementation
obj ExampleObject(Parent):
    member_a : int = 5

Advantages:

  • Makes it easier to introduce new data structures (if necessary)
  • Definitions of objects, parameters and imports can be read in any order

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementimproves existing functionalityproposalpending discussion about something to dospecificationinvolves the nyan language specification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions