Skip to content

Grammar or Lexical Specification #17

@twitchyliquid64

Description

@twitchyliquid64

I had a look through the docs but didnt see anything specific about what constructions are permitted within what other constructions. Could this be documented?

ie: The Go specification writes everything like this:

FunctionType   = "func" Signature .
Signature      = Parameters [ Result ] .
Result         = Parameters | Type .
Parameters     = "(" [ ParameterList [ "," ] ] ")" .
ParameterList  = ParameterDecl { "," ParameterDecl } .
ParameterDecl  = [ IdentifierList ] [ "..." ] Type .

This is super helpful when trying to see what building blocks fit together.

In particular, I would like to understand whether type declarations / namespaces can be used within functions or even within expressions. It would also be an easy reference to see what features are available and what their syntax is (ie: ternary).

I feel a grammar like the above is a nice neat way to express whats allowed.

Yeah/Nah or Nah/Yeah?

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions