Boo

Dot prefix as implicit self (ie. allow OmittedExpression as MemberReferenceExpression target)

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.9
  • Fix Version/s: 0.9.1
  • Component/s: Compiler
  • Labels:
    None
  • Number of attachments :
    0

Description

Allow ".Foo" syntax to express "self.Foo" or "$(CurrentType).Foo" (in a static context).

AST-wise it creates a MemberReferenceExpression (as usual) but with Target an OmittedExpression.
Moreover allowing shorthand notation this allows "HAML-like notation" in macros and also macros that can change the meaning of such omitted expression(s).

E.g:

macro with(replacement):
    for mre in OmittedExpressionFinder(with.Body):
        mre.Target = replacement
    yield

with Context.NameResolutionServices:
    .Resolve(typeRef1)
    .Resolve(typeRef2)

Activity

Hide
Rodrigo B. de Oliveira added a comment -

Resolved in rev. 3248.

Show
Rodrigo B. de Oliveira added a comment - Resolved in rev. 3248.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: