[erlang-questions] some language changes

Vlad Dumitrescu vladdu55@REDACTED
Wed May 23 10:01:29 CEST 2007


Hi,

On 5/23/07, ok <ok@REDACTED> wrote:
> This preprocessor is just 16 SLOC of AWK.  For *THIS* we are to
> make Erlang lexical structure more complicated and to break editor
> support for the language?

Cold you please elaborate on why a preprocessor doesn't break the
editor support for the language?

The way I see it is that if the said editor is to provide advanced
support, it needs to be able to work with the textual raw
representation, not the preprocessed one, because that is the one the
developer sees and uses.

For example, I might be interested in renaming a normal -define()
macro and get all uses replaced with the new name. This means that the
lexer and parser used by the editor need to include the concept of a
macro.

At the same time, the editor needs to be able to map back the final
AST to the actual concrete syntax, for example in order to map compile
errors to the right place in the code even if that code contains
macros and parse transforms. [*]

So IMHO if the language is extended in any way, via preprocessor or
not, the editor still needs to be updated if it is going to be able to
understand the changes.

[*] the difficulty of this backward mapping is also one reasonfor
which line numbers in errors wouldn't be meaningful in the general
case.

best regards,
Vlad



More information about the erlang-questions mailing list