Skip to content

Commit

Permalink
feat: add spaces between callouts
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobslisboa committed Sep 11, 2024
1 parent 0667941 commit bc831cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/1 - AST/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ As the AST represents the structure of the source code in a tree-like format, it
There are 2 forms of extension nodes:

- **For “algebraic” categories**: `[%name "John Doe"]`
- **For structures and signatures**: `[%%name "John Doe"]`
- **For structures and signatures**: `[%%name "John Doe"]`


> In the code `let name = [%name "John Doe"]`, `[%name "John Doe"]` is the extension node, where **name** is the extension name (`string Ast_414.Asttypes.loc`) and **"John Doe"** is the `payload`. For the entire item `let name = "John Doe"`, you must use `%%`: `[%%name "John Doe]`.
Expand All @@ -295,6 +296,7 @@ As the AST represents the structure of the source code in a tree-like format, it
- **Attached to “blocks”**: `[@@name]`
- **Stand-alone of signatures or structures modules**: `[@@@name]`


> In the code `let name = "John Doe" [@print expr]`, `[@print expr]` is the attribute of the `"John Doe"` node, where **print** is the attribute name (`string Ast_414.Asttypes.loc`) and **expr** is the `payload`. To be an attribute of the entire item `let name = "John Doe"`, you must use `@@`: `[@@print]`. If it is an stand-alone attribute of a module, you must use `@@@`: `[@@@print]`.
Don't worry much about creating a new attributes node; we'll cover it in the [Wrinting PPXs section](../2%20-%20Writing%20PPXs/README.md).
Expand Down

0 comments on commit bc831cd

Please sign in to comment.