rokucommunity / rokucommunity/brighterscript

use `new` syntax for `CreateObject` calls

Open
#259 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

BrighterScript enhancement good first issue help wanted New Language Feature
Dominant language
TypeScript
Stars
208
Forks
68
Avg merge
8h 39m
Merged PRs (30d)
39

Description

Support using the new keyword as shorthand for CreateObject things. For example, this:

newXfer = CreateObject("roUrlTransfer")

would become this:

newXfer = new RoUrlTransfer()

This would obviously prevent you from creating classes with the same name as all the CreateObject things, but I don't think that would be a big deal since most of them are prefixed with "ro" anyway.

This would also need to support passing in constructor arguments, which would become the arguments to CreateObject.

This would require building a complete list of valid strings for CreateObject, and then we could also validate the constructor arguments.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the parser and semantic handling for CreateObject and the validation of its string names. Then determine how constructor arguments and name collisions should interact with the proposed new syntax. Done means the syntax, complete CreateObject name list, and constructor-argument validation are specified and covered by compiler tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.