Skip to content

Add support for absolute qualified identifiers #990

@bocchino

Description

@bocchino

Allow qualified identifiers that begin with a dot. An initial dot indicates that the qualified identifier is to be resolved from the top level, regardless of where it appears. This feature provides a way to refer to symbols that are hidden by definitions in an inner scope. It is similar to an initial :: in a C++ name qualifier.

For example:

constant a = 0
module M {
  constant a = 1 # M.a hides a here
  constant b = a # Sets b to 1
  constant c = .a # Sets c to 0
  constant d = .M.a # Same as constant d = a
}

In this scheme, there are two kinds of qualified identifiers:

  • Relative qualified identifiers: Each of these is a list of simple names separated by dots. It specifies a qualified name relative to the innermost scope in which the first simple name is defined. For example, when a is defined in scope M, then inside scope M, a refers to M.a. This is true regardless of whether a is defined at the top level.
  • Absolute qualified identifiers: Each of these is a dot followed by a relative qualified identifier. It specifies a name relative to the top scope. For example, when a is defined at the top level, then .a refers to a. This is true even in a scope M that also defines a.

Metadata

Metadata

Assignees

No one assigned

    Labels

    semanticsIssues related to semanticsspecIssues related to the FPP language specificationsyntaxIssues related to syntaxuser's guideIssues related to the FPP User's Guide

    Projects

    Status

    CCB

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions