Skip to content

Correct syntax highlighting for "import Foo as Bar" #121

@fsaad

Description

@fsaad

The as in import Foo as Bar should be highlighted in red. Note that as is not a reserved for in the usual sense, for example, it can itself be a package name or be assigned to a variable.

image

The Github syntax highlighter, which seems to be based on the Julia Atom package handles this case correctly but only in some cases, e.g.,

import Foo as Bar
import Foo, Bar as Zing
import as               # `as` is a package name
import Foo, as          # `as` is a package name
import as as as         # XXX Github renders incorrectly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions