Skip to content

Use a class over string in case of DOCOL #184

@bahmanm

Description

@bahmanm

Currently the raw string "DOCOL" is placed in memory where it would mean calling the native function Machine#DOCOL.

To avoid any confusion when extending the compiler, use a class or an enum instead of the string.

For example:

enum NativeCode {
  DOCOL
}

...
machine.setMemoryAt(..., NativeCode.DOCOL);

...
if (memory instanceof NativeCode code && DOCOL.equals(code)) 
  ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions