save input stream with cached results
This commit is contained in:
parent
5668b46f97
commit
80ad3476e2
2 changed files with 25 additions and 16 deletions
|
|
@ -108,6 +108,12 @@ typedef struct HLeftRec_ {
|
|||
HRecursionHead *head;
|
||||
} HLeftRec;
|
||||
|
||||
/* Result and remaining input, for rerunning from a cached position. */
|
||||
typedef struct HCachedResult_ {
|
||||
HParseResult *result;
|
||||
HInputStream input_stream;
|
||||
} HCachedResult;
|
||||
|
||||
/* Tagged union for values in the cache: either HLeftRec's (Left) or
|
||||
* HParseResult's (Right).
|
||||
*/
|
||||
|
|
@ -115,7 +121,7 @@ typedef struct HParserCacheValue_t {
|
|||
HParserCacheValueType value_type;
|
||||
union {
|
||||
HLeftRec *left;
|
||||
HParseResult *right;
|
||||
HCachedResult *right;
|
||||
};
|
||||
} HParserCacheValue;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue