Skip to content
Snippets Groups Projects
Commit cf054521 authored by xentrac's avatar xentrac
Browse files

Clean up apparent intended Markdown in HACKING

Also remove a couple of spelling and capitalization nits.  I did this
because I was reading the document and they bothered me.
parent 4cf306ce
No related branches found
No related tags found
No related merge requests found
......@@ -6,12 +6,13 @@ internal anaphoric macros use. Chances are that if you use these names
for other things, you're gonna have a bad time.
In particular, these names, and the macros that use them, are:
- state:
Used by a_new and company. Should be an HParseState*
- mm__:
Used by h_new and h_free. Should be an HAllocator*
- stk__:
Used in desugaring. Should be an HCFStack*
- `state`:
Used by `a_new` and company. Should be an `HParseState*`.
- `mm__`:
Used by `h_new` and `h_free`. Should be an `HAllocator*`.
- `stk__`:
Used in desugaring. Should be an `HCFStack*`.
Function suffixes
=================
......@@ -21,9 +22,9 @@ parameters or parameters in multiple different forms. For example,
often, you have a global memory manager that is used for an entire
program. In this case, you can leave off the memory manager arguments
off, letting them be implicit instead. Further, it is often convenient
to pass an array or va_list to a function instead of listing the
arguments inline (eg, for wrapping a function, generating the
arguments programattically, or writing bindings for another language.
to pass an array or `va_list` to a function instead of listing the
arguments inline (e.g., for wrapping a function, generating the
arguments programatically, or writing bindings for another language.)
Because we have found that most variants fall into a fairly small set
of forms, and to minimize the amount of API calls that users need to
......@@ -32,21 +33,22 @@ variants: the function name is followed by two underscores and a set
of single-character "flags" indicating what optional features that
particular variant has (in alphabetical order, of course):
__a: takes variadic arguments as a void*[] (not implemented yet, but will be soon.
__m: takes a memory manager as the first argument, to override the system memory manager.
__v: Takes the variadic argument list as a va_list
- `__a`: takes variadic arguments as a `void*[]` (not implemented yet,
but will be soon.)
- `__m`: takes a memory manager as the first argument, to override the
system memory manager.
- `__v`: Takes the variadic argument list as a `va_list`.
Memory managers
===============
If the __m function variants are used or system_allocator is
If the `__m` function variants are used or `system_allocator` is
overridden, there come some difficult questions to answer,
particularly regarding the behavior when multiple memory managers are
combined. As a general rule of thumb (exceptions will be explicitly
documented), assume that
If you have a function f, which is passed a memory manager m and
> If you have a function f, which is passed a memory manager m and
returns a value r, any function that uses r as a parameter must
also be told to use m as a memory manager.
......@@ -57,7 +59,7 @@ Language-independent test suite
There is a language-independent representation of the Hammer test
suite in `lib/test-suite`. This is intended to be used with the
tsparser.pl prolog library, along with a language-specific frontend.
tsparser.pl Prolog library, along with a language-specific frontend.
Only the C# frontend exists so far; to regenerate the test suites using it, run
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment