Skip to content

Instantly share code, notes, and snippets.

@ionoy
Created June 13, 2017 13:07
Show Gist options
  • Save ionoy/0139d721c1561f205311765cc61e7fc8 to your computer and use it in GitHub Desktop.
Save ionoy/0139d721c1561f205311765cc61e7fc8 to your computer and use it in GitHub Desktop.
Syntax:
extend syntax Expression
{
...
| Parenthesized = "(" Expression ")";
...
}
Mapping:
map syntax Expressions.Expression.Parenthesized -> DotNet.Expr
{
Parenthesized {
Expression -> Expression; // error : Rule 'CSharp.Core.Expression' has no AST mapping.
}
}
AST:
abstract ast Expr : BindableAst
{
...
| Parenthesized {
Expression : Expr;
Type = Expression.Type;
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment