Skip to content

Instantly share code, notes, and snippets.

@NN---
Created October 29, 2012 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NN---/3971936 to your computer and use it in GitHub Desktop.
Save NN---/3971936 to your computer and use it in GitHub Desktop.
private __GENERATED_PEG__RULE__startx__(position : int, text : string) : int
{
unchecked
{
mutable (c : char);
_ = c;
{
mutable token_1;
if (__GENERATED_PEG__Memeoize_Pos__start__ == position)
{
when (__GENERATED_PEG__Memeoize_End__start__ >= 0) result = __GENERATED_PEG__Memeoize_Res__start__;
__GENERATED_PEG__Memeoize_End__start__
}; else
{
def newPosCompileRuleCaptureHandler =
{
def newPosCompileRuleCaptureChars =
{
mutable okPos = -1;
mutable curPos = position;
State_0 /* id: 6845 */:
DEFAULT;
when (curPos >= text.Length) goto State_3 /* id: 6848 try id: 1 */;
c = text[curPos];
++curPos;
when ('0' <= c && c <= '9') goto State_1 /* id: 6846 try id: 1 */;
goto State_3 /* id: 6848 try id: 1 */;
State_1 /* id: 6846 */:
DEFAULT;
okPos = curPos;
when (curPos >= text.Length) goto State_3 /* id: 6848 try id: 1 */;
c = text[curPos];
++curPos;
when ('0' <= c && c <= '9') goto State_1 /* id: 6846 try id: 1 */;
goto State_3 /* id: 6848 try id: 1 */;
State_2 /* id: 6847 */:
DEFAULT;
okPos = curPos;
State_3 /* id: 6848 */:
DEFAULT;
okPos
};
when (newPosCompileRuleCaptureChars >= 0) token_1 = Nemerle.Peg.NToken(position, newPosCompileRuleCaptureChars);
newPosCompileRuleCaptureChars
};
__GENERATED_PEG__Memeoize_Pos__start__ = position;
__GENERATED_PEG__Memeoize_End__start__ = newPosCompileRuleCaptureHandler;
if (newPosCompileRuleCaptureHandler >= 0)
{
result = start(token_1);
();
__GENERATED_PEG__Memeoize_Res__start__ = result
}; else when (__GENERATED_PEG__MaxRollback___start__ < position) __GENERATED_PEG__MaxRollback___start__ = position;
newPosCompileRuleCaptureHandler
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment