2020-06-25 15:06:08 +03:00
|
|
|
---
|
|
|
|
layout: developer-doc
|
|
|
|
title: Macro Resolution
|
|
|
|
category: parser
|
|
|
|
tags: [parser, macro, resolution]
|
|
|
|
order: 5
|
|
|
|
---
|
|
|
|
|
|
|
|
# Macro Resolution
|
2020-07-21 15:59:40 +03:00
|
|
|
|
2020-06-26 16:54:20 +03:00
|
|
|
Macro resolution is the process of taking the structured token stream from the
|
|
|
|
[lexer](./lexer.md), and resolving it into the [ast](./ast.md) through the
|
|
|
|
process of resolving macros. This process produces a chunked AST stream,
|
|
|
|
including spacing-unaware elements.
|
2020-06-25 15:06:08 +03:00
|
|
|
|
|
|
|
<!-- MarkdownTOC levels="2,3" autolink="true" -->
|
|
|
|
|
2020-06-26 16:54:20 +03:00
|
|
|
- [Functionality](#functionality)
|
|
|
|
- [Errors During Macro Resolution](#errors-during-macro-resolution)
|
|
|
|
|
2020-06-25 15:06:08 +03:00
|
|
|
<!-- /MarkdownTOC -->
|
2020-06-26 16:54:20 +03:00
|
|
|
|
|
|
|
## Functionality
|
2020-07-21 15:59:40 +03:00
|
|
|
|
2020-06-26 16:54:20 +03:00
|
|
|
The current functionality of the macro resolver is as follows:
|
|
|
|
|
|
|
|
- TBC
|
|
|
|
|
|
|
|
The current overview of the macro resolution process can be found in the scala
|
|
|
|
[implementation](../../lib/syntax/specialization/shared/src/main/scala/org/enso/syntax/text/Parser.scala).
|
|
|
|
|
|
|
|
> The actionables for this section are:
|
|
|
|
>
|
|
|
|
> - Discuss how the space-unaware AST should be handled as it is produced by
|
|
|
|
> macros.
|
|
|
|
> - Handle precedence for operators properly within macro resolution (e.g.
|
|
|
|
> `x : a -> b : a -> c` should parse with the correct precedence).
|
|
|
|
> - Create a detailed design for how macro resolution should work.
|
|
|
|
|
|
|
|
## Errors During Macro Resolution
|
2020-07-21 15:59:40 +03:00
|
|
|
|
2020-06-26 16:54:20 +03:00
|
|
|
It is very important that, during macro resolution, the resolver produces
|
|
|
|
descriptive errors for error conditions in the macro resolver.
|
|
|
|
|
|
|
|
> The actionables for this section are:
|
|
|
|
>
|
|
|
|
> - Determine how best to provide detailed and specific errors from within the
|
|
|
|
> macro resolution engine.
|