Hoa compiler - feedback + help


#1

Hello, I’m back with graphql. I’m happy with the result but I still have some issue (I need node with exclusive synthaxe)

But I would like to provide some feedback :

  • in the documentation I don’t find anything explaining the différence between “#foo:” and “foo:”
  • in don’t find easy to understand that the order of declaration of the token have an huge impact (the documentation should be more explicit and provide example about it). in my case the root node and the token that can be assimilated as string (name)

#2

Hello :slight_smile:,

foo: is used to declare a rule. A rule can contain an node ID, for instance:

foo:
    <tokenA> <tokenB> ::tokenC:: #xoxo

It will generate a node in the AST named xoxo with 2 childrens: tokenA and tokenB. tokenC is recognized and consumed but not kept in the tree.

If you rename xoxo to foo, you obtain:

foo:
    <tokenA> <tokenB> ::tokenC:: #foo

which can be rewrite into:

#foo:
    <tokenA> <tokenB> ::tokenC::

It means: The rule will always a node of the same name than the rule name.

And yes, order of lexeme declaration is important. Do you think we should strike this fact on the documentation?


#3

yes, I think the documentation should be improved a bit. Because it’s one of the point that make me lose a lot of time!


#4

First, sorry for that! Second, can you open an issue on the Github repository please?