[erlang-questions] My biggest beef with Erlang
Vlad Dumitrescu
vladdu55@REDACTED
Sun Nov 25 20:37:03 CET 2007
Hi,
On Nov 25, 2007 4:57 PM, Joe Armstrong <erlang@REDACTED> wrote:
> I think it would be easier to allow syntax transforms *before*
> parse_transform. We need
> character_transform that kicks in before tokenisation, and
> token_transform which kicks in after character_transform but before
> parse_transform.
Cool idea!
But I'm not sure what char_transform would do. I suppose it can select
strings with regexps,and do what to them? What it would be meaningful
would be to replace them with tokens, as a sort of pre-tokenizer, but
then the scanner should accept a stream of characters mixed with
tokens.....
Maybe token_transform is enough: given that the tokenizer will return
any unmatched characters as their own tokens, a token_transform phase
could take a sequence of two {'!', Line} tokens and compress them into
a {'!!', Line} one. Possible troublemakers would be whitespaces, as we
might want to convert two consecutive '!'s, without any intervening
spaces.
best regards,
Vlad
More information about the erlang-questions
mailing list