content
stringlengths 10
4.9M
|
---|
/* x_liris.x -- translated by f2c (version 19990503).
You must link the resulting object file with the libraries:
-lf2c -lm (in that order)
*/
#include "f2c.h"
/* Common Block Declarations */
struct {
logical xerflg, xerpad[84];
} xercom_;
#define xercom_1 xercom_
/* Table of constant values */
static integer c__4 = 4;
static integer c__1 = 1;
static integer c__0 = 0;
integer sysruk_(shortint *task, shortint *cmd, integer *rukarf, integer *
rukint)
{
/* Initialized data */
static shortint dict[21] = { 112,115,102,109,101,97,115,117,114,101,0,115,
116,97,114,102,111,99,117,115,0 };
static shortint st0009[29] = { 105,110,118,97,108,105,100,32,115,101,116,
32,115,116,97,116,101,109,101,110,116,58,32,39,37,115,39,10,0 };
static shortint st0010[25] = { 105,110,118,97,108,105,100,32,83,69,84,32,
105,110,32,73,82,65,70,32,77,97,105,110,0 };
static integer dp[3] = { 1,12,0 };
static integer lmarg = 5;
static integer maxch = 0;
static integer ncol = 0;
static integer rukean = 3;
static integer ntasks = 0;
static shortint st0001[9] = { 116,116,121,110,99,111,108,115,0 };
static shortint st0002[6] = { 99,104,100,105,114,0 };
static shortint st0003[3] = { 99,100,0 };
static shortint st0004[6] = { 104,111,109,101,36,0 };
static shortint st0005[6] = { 72,79,77,69,36,0 };
static shortint st0006[4] = { 115,101,116,0 };
static shortint st0007[6] = { 114,101,115,101,116,0 };
static shortint st0008[2] = { 9,0 };
/* System generated locals */
integer ret_val;
/* Local variables */
static integer i__, rmarg;
extern logical streq_(shortint *, shortint *);
extern integer envgei_(shortint *);
extern /* Subroutine */ int xfchdr_(shortint *), erract_(integer *),
eprinf_(shortint *);
extern integer envscn_(shortint *);
extern /* Subroutine */ int xffluh_(integer *), pargsr_(shortint *),
tpsfme_(void), envlit_(integer *, shortint *, integer *), syspac_(
integer *, shortint *), xerpsh_(void), strtbl_(integer *,
shortint *, integer *, integer *, integer *, integer *, integer *,
integer *);
extern logical xerpop_(void);
extern /* Subroutine */ int tstars_(void), zzepro_(void);
/* Parameter adjustments */
--cmd;
--task;
/* Function Body */
if (! (ntasks == 0)) {
goto L110;
}
i__ = 1;
L120:
if (! (dp[i__ - 1] != 0)) {
goto L122;
}
/* L121: */
++i__;
goto L120;
L122:
ntasks = i__ - 1;
L110:
if (! (task[1] == 63)) {
goto L130;
}
xerpsh_();
rmarg = envgei_(st0001);
if (! xerpop_()) {
goto L140;
}
rmarg = 80;
L140:
strtbl_(&c__4, dict, dp, &ntasks, &lmarg, &rmarg, &maxch, &ncol);
ret_val = 0;
goto L100;
L130:
if (! (streq_(&task[1], st0002) || streq_(&task[1], st0003))) {
goto L150;
}
xerpsh_();
if (! (cmd[*rukarf] == 0)) {
goto L170;
}
xerpsh_();
xfchdr_(st0004);
if (! xerpop_()) {
goto L180;
}
xfchdr_(st0005);
L180:
goto L171;
L170:
xfchdr_(&cmd[*rukarf]);
L171:
/* L162: */
if (! xerpop_()) {
goto L160;
}
if (! (*rukint == 1)) {
goto L190;
}
erract_(&rukean);
if (xercom_1.xerflg) {
goto L100;
}
goto L191;
L190:
L191:
L160:
ret_val = 0;
goto L100;
L150:
if (! (streq_(&task[1], st0006) || streq_(&task[1], st0007))) {
goto L200;
}
xerpsh_();
if (! (cmd[*rukarf] == 0)) {
goto L220;
}
envlit_(&c__4, st0008, &c__1);
xffluh_(&c__4);
goto L221;
L220:
if (! (envscn_(&cmd[1]) <= 0)) {
goto L230;
}
if (! (*rukint == 1)) {
goto L240;
}
eprinf_(st0009);
pargsr_(&cmd[1]);
goto L241;
L240:
goto L91;
L241:
L230:
L221:
/* L212: */
if (! xerpop_()) {
goto L210;
}
if (! (*rukint == 1)) {
goto L250;
}
erract_(&rukean);
if (xercom_1.xerflg) {
goto L100;
}
goto L251;
L250:
L91:
syspac_(&c__0, st0010);
L251:
L210:
ret_val = 0;
goto L100;
L200:
/* L151: */
/* L131: */
if (! streq_(&task[1], &dict[dp[0] - 1])) {
goto L260;
}
tpsfme_();
ret_val = 0;
goto L100;
L260:
if (! streq_(&task[1], &dict[dp[1] - 1])) {
goto L270;
}
tstars_();
ret_val = 0;
goto L100;
L270:
ret_val = -1;
goto L100;
L100:
zzepro_();
return ret_val;
} /* sysruk_ */
|
def _write_datetime(value):
if value.utcoffset() is None:
raise ValueError("Expected datetime with time zone")
return value.isoformat() |
/**
****************************************************************************************
* @brief Find the array index for a given message id.
* @param[in] msg_util_id The message id
* @return Returns the index in the callback array
****************************************************************************************
*/
static int8_t app_easy_msg_find_idx(ke_msg_id_t msg_util_id)
{
int i;
i = msg_util_id - APP_MSG_UTIL_API_MES0;
if ((i >= 0) && (i < APP_MSG_UTIL_MAX_NUM))
{
return i;
}
return -1;
} |
/**
* A TokenSpec object represents a possible TLA+ symbol name together
* with the position of that symbol. Note that the
* expression Foo(a, b)!Bar(c) may be an occurrence of the symbol
* named "Foo!Bar", whose left position is at the "F" and whose right
* position is just after the "r" (and hence, at the following ")").
*
* The main methods are the two is findCurrentTokenSpecs methods.
* Most of the work is done by findTokenSpecs, which was coded from
* a PlusCal spec that is appended to this file.
*
* @author lamport
*
*/
public class TokenSpec
{
/*
* The following are the fields of the object. They are accessed
* directly, without any of this set...() and get...() Java
* nonsense.
*/
public String token;
public int leftPos;
public int rightPos;
public SymbolNode resolvedSymbol = null;
public TokenSpec(String tok, int left, int right)
{
this.token = tok;
this.leftPos = left;
this.rightPos = right;
}
/**
* This method returns the TokenSpec of the symbol at the cursor position
* of the TLAEditor with the current focus. If it cannot find the definition
* or declaration of such a symbol, it returns a TokenSpec for the token
* being pointed to with a null resolvedSymbol field. This will be the
* case if that token is a module name. This method is used by
* ShowUsesHandler.execute.
*
* @return
*/
public static TokenSpec findCurrentTokenSpec()
{
return findCurrentTokenSpec(null);
}
/**
* This method is like findCurrentTokenSpec(), except it finds the
* symbol at the position specified by a region, which is assumed
* to be a region in the TLA editor with the current focus. This method
* is used by TLAHyperlinkDetector.detectHyperlinks.
*
* @param regionInput
* @return
*/
public static TokenSpec findCurrentTokenSpec(IRegion regionInput)
{
// We first get the editor with focus and find its module and
// its document, returning null if we get any nulls.
// Note: Simon wrote a somewhat more baroque way of
// getting the current editor at the beginning of
// TLAEditor$OpenDeclarationHandler.execute. I don't know why.
TLAEditor editor = EditorUtil.getTLAEditorWithFocus();
if (editor == null)
{
return null;
}
String moduleName = editor.getModuleName();
if (moduleName == null) {
return null;
}
ModuleNode moduleNode = ResourceHelper.getModuleNode(moduleName);
if (moduleNode == null)
{
return null;
}
ISourceViewer internalSourceViewer = editor.publicGetSourceViewer();
IDocument document = internalSourceViewer.getDocument();
ITextSelection selection = (ITextSelection) editor.getSelectionProvider().getSelection();
IRegion region = regionInput;
if (regionInput == null)
{
region = new Region(selection.getOffset(), selection.getLength());
}
// Sets currentLine to the line of text of the module containing the beginning of the
// current region, and sets currentPos to the position of the beginning of the
// current region in that line. The Document.getLineLength method seems to include
// the length of the line's delimeter, which should not be included in currentLine.
String currentLine;
int currentPos;
int offsetOfLine;
try
{
int lineNumber = document.getLineOfOffset(region.getOffset());
int lineDelimLength = 0;
String delim = document.getLineDelimiter(lineNumber);
if (delim != null)
{
lineDelimLength = delim.length();
}
;
offsetOfLine = document.getLineOffset(lineNumber);
currentLine = document.get(offsetOfLine, document.getLineLength(lineNumber) - lineDelimLength);
currentPos = region.getOffset() - offsetOfLine;
} catch (BadLocationException e)
{
TLAEditorActivator.getDefault().logDebug("Exception thrown", e);
return null;
}
// Call findTokenSpecs to find the array of candidate TokenSpec
// objects. Note that this may return an array of length 0, but
// does not return null.
TokenSpec[] tokenSpecs = findTokenSpecs(currentLine, currentPos);
// We update the positions to be offsets within the document,
// and look for resolvedSymbol, setting goodIndex to the index
// in tokenSpecs of the first element that resolves.
int goodIndex = -1;
SymbolNode symbol = null;
for (int i = 0; i < tokenSpecs.length; i++)
{
int leftPos = tokenSpecs[i].leftPos;
int rightPos = tokenSpecs[i].rightPos;
tokenSpecs[i].leftPos = leftPos + offsetOfLine;
tokenSpecs[i].rightPos = rightPos + offsetOfLine;
String indiceAdjustedToken = tokenSpecs[i].token;
Location location = EditorUtil.getLocationAt(document, tokenSpecs[i].leftPos, rightPos - leftPos);
if ((indiceAdjustedToken != null) && (indiceAdjustedToken.length() > 1) && (indiceAdjustedToken.charAt(0) == '_')) {
indiceAdjustedToken = indiceAdjustedToken.substring(1);
}
symbol = EditorUtil.lookupOriginalSymbol(UniqueString.uniqueStringOf(indiceAdjustedToken), moduleNode, location, null);
if (symbol != null)
{
goodIndex = i;
break;
}
}
if (goodIndex == -1)
{
if (tokenSpecs.length == 0)
{
return null;
} else
{
goodIndex = 0;
}
}
TokenSpec result = new TokenSpec(tokenSpecs[goodIndex].token, tokenSpecs[goodIndex].leftPos,
tokenSpecs[goodIndex].rightPos);
result.resolvedSymbol = symbol;
return result;
}
/**
* This method finds all possible symbol names containing the character at
* or just before position inputPosition of line inputLine, in order of
* decreasing length. It returns their positions relative to the
* beginning of the line. There can be multiple possibilities because if
* inputPosition is at the "a" in
*
* Foo!Bar!End
*
* then the method return the array whose first element represents
* Foo!Bar!End and whose second element represents Foo!Bar. We don't
* know which is correct, because End could either be a symbol defined
* in an instantiated instantiated model, or else a label in the
* definition of the instantiated symbol Bar.
*
* This method is the encoding of the PlusCal procedure of the same name in
* module FindOp, which is appended as a comment to this file.
*
* @param inputLine
* @param inputPosition
* @return
*/
public static TokenSpec[] findTokenSpecs(String inputLine, int inputPosition)
{
// we pad the input line on the ends so we don't have to worry
// about going off the end of the line.
String line = Padding + inputLine + Padding;
// Maintains the current position at which we are processing.
int curPos = inputPosition + Padding.length();
// Contains the result we've found so far.
TokenSpec[] foundTokenSpecs = new TokenSpec[0];
// Set true if there can be no tokens to right of first one found.
boolean lastToken = false;
// Set true if we find a "!" to the right of the first token found.
boolean notLastToken = false;
// temporary variable
TokenSpec currentToken;
// Try to find the current TokenSpec and put it in foundTokenSpecs,
// leaving curPos to the left of that token. If the token is a
// step name, we can return that single TokenSpec as the spec.
// If it is an unnamed step, or if it is not a possible identifier
// or operator symbol, we return << >> (a zero-length array).
// First, we must check if we may be inside a string a possibly empty
// sequence of spaces, a "!", and a possibly empty sequence of spaces.
// If so, we move to its left, setting notLastToken to true.
if (line.charAt(curPos) == ' ')
{
curPos = skipLeftOverSpaces(line, curPos);
if (line.charAt(curPos - 1) == '!' && line.charAt(curPos - 2) != '!')
{
notLastToken = true;
curPos = curPos - 1;
curPos = skipLeftOverSpaces(line, curPos);
}
} else if ((line.charAt(curPos) == '!') && (line.charAt(curPos - 1) != '!') && (line.charAt(curPos + 1) != '!'))
{
notLastToken = true;
curPos = skipLeftOverSpaces(line, curPos);
}
;
// If we're to the right of a ")", we could be inside something like
//
// Foo(42) ! bar
// ^
// so we set notLastToken true and move to the left of the parenthesized string.
if ((notLastToken || line.charAt(curPos) == ' ') && (line.charAt(curPos - 1) == ')'))
{
notLastToken = true;
int returnVal = findMatchingLeftParen(line, curPos);
if (returnVal < 0)
{
return new TokenSpec[0];
}
curPos = returnVal;
curPos = skipLeftOverSpaces(line, curPos);
}
;
// If notLastToken is true, then we should be just to the right
// of the token we are expecting to find to the left of the '!' or the
// parenthesized expression.
if (notLastToken)
{
curPos = curPos - 1;
} else
{
if ((!(Character.isLetterOrDigit(line.charAt(curPos)) || (line.charAt(curPos) == '_')))
&& (findTokenIn(line, curPos, Operators) == null))
{
curPos = curPos - 1;
}
}
if (Character.isLetterOrDigit(line.charAt(curPos)) || line.charAt(curPos) == '_')
{
if ((line.charAt(curPos) == 'X') && findTokenIn(line, curPos, XOperators) != null)
{
TokenSpec returnVal = findTokenIn(line, curPos, XOperators);
foundTokenSpecs = new TokenSpec[] { returnVal };
curPos = returnVal.leftPos;
lastToken = true;
} else
{
currentToken = findMaximalIdCharSeq(line, curPos);
// silently prevent NPEs (hyperlinks will just not work)
if (currentToken == null)
{
TLAEditorActivator
.getDefault()
.getLog()
.log(new Status(IStatus.WARNING, TLAEditorActivator.PLUGIN_ID,
"Hyperlinking failed for " + inputLine));
return new TokenSpec[0];
}
// Check if token is part of step name. If it is, we set
// First, see if currentToken could be the token after the "<...>".
if (line.charAt(currentToken.leftPos - 1) == '>')
{
TokenSpec returnVal = findMaximalIdCharSeq(line, currentToken.leftPos - 1);
returnVal = checkIfStepName(line, returnVal, currentToken);
if (returnVal != null)
{
return FixOrigin(new TokenSpec[] { returnVal });
}
}
;
// Next see if it's the token to the left of the '>'
if (line.charAt(currentToken.rightPos) == '>')
{
TokenSpec returnVal = findMaximalIdCharSeq(line, currentToken.rightPos + 1);
returnVal = checkIfStepName(line, currentToken, returnVal);
if (returnVal != null)
{
return FixOrigin(new TokenSpec[] { returnVal });
}
}
;
// Next, check if it's a number, and return if it is.
if (IsNumber(currentToken.token))
{
return new TokenSpec[0];
}
// Next, check if the token appears as a "\\" token, in
// which case we adjust currentTok
int left = currentToken.leftPos;
int rt = currentToken.rightPos;
if ((line.charAt(left - 1) == '\\') && (line.charAt(left - 2) != '\\')
&& IsTeXSymbol(line.substring(left - 1, rt)))
{
lastToken = true;
currentToken.leftPos = left - 1;
currentToken.token = line.substring(left - 1, rt);
}
;
foundTokenSpecs = new TokenSpec[] { currentToken };
curPos = left;
}
} else
{
currentToken = findTokenIn(line, curPos, Operators);
if (currentToken == null)
{
return new TokenSpec[0];
}
;
TokenSpec returnVal = findTokenIn(line, curPos, NonOperators);
if (returnVal != null)
{
return new TokenSpec[0];
}
;
// Need to check if beginning or end of level specifier
// of step number.
if (currentToken.token.equals("<"))
{
TokenSpec temp1 = findMaximalIdCharSeq(line, currentToken.rightPos);
if ((temp1 != null) && (line.charAt(temp1.rightPos) == '>'))
{
TokenSpec temp2 = findMaximalIdCharSeq(line, temp1.rightPos + 1);
returnVal = checkIfStepName(line, temp1, temp2);
if (returnVal != null)
{
return FixOrigin(new TokenSpec[] { returnVal });
}
}
} else if (currentToken.token.equals(">"))
{
TokenSpec temp1 = findMaximalIdCharSeq(line, currentToken.leftPos);
TokenSpec temp2 = findMaximalIdCharSeq(line, currentToken.rightPos);
returnVal = checkIfStepName(line, temp1, temp2);
if (returnVal != null)
{
return FixOrigin(new TokenSpec[] { returnVal });
}
}
// We check for the case of a '\\' starting a TeX token.
if (currentToken.token.equals("\\"))
{
returnVal = findMaximalIdCharSeq(line, currentToken.rightPos);
if ((returnVal != null) && IsTeXSymbol(line.substring(currentToken.leftPos, returnVal.rightPos)))
{
currentToken.rightPos = returnVal.rightPos;
currentToken.token = line.substring(currentToken.leftPos, returnVal.rightPos);
}
}
;
foundTokenSpecs = new TokenSpec[] { currentToken };
curPos = currentToken.leftPos;
lastToken = true;
}
;
// At this point, foundTokenSpecs.length = 1, and we have found the
// base token. We now look to find extenders to the left of the form
// idtoken '!'. These must be part of the name, so we prepend
// them to foundTokenSpecs[0].
curPos = foundTokenSpecs[0].leftPos;
boolean notDone = true;
while (notDone)
{
curPos = skipLeftOverSpaces(line, curPos);
if (curPos < 0 || line.charAt(curPos - 1) == PaddingChar)
{
notDone = false;
} else
{
if (line.charAt(curPos - 1) == '!' && (line.charAt(curPos - 2) != '!'))
{
curPos = curPos - 1;
curPos = skipLeftOverSpaces(line, curPos);
curPos = findMatchingLeftParen(line, curPos);
if (curPos < 0)
{
notDone = false;
} else
{
curPos = skipLeftOverSpaces(line, curPos);
currentToken = findMaximalIdCharSeq(line, curPos);
if ((currentToken == null) || IsNumber(currentToken.token))
{
notDone = false;
} else
{
curPos = currentToken.leftPos;
foundTokenSpecs[0] = new TokenSpec(currentToken.token + "!" + foundTokenSpecs[0].token,
curPos, foundTokenSpecs[0].rightPos);
}
}
} else
{
notDone = false;
}
}
}
// We have now completed the first token. If there are no more,
// then we're done.
if (lastToken == true)
{
return FixOrigin(foundTokenSpecs);
}
// There may be more "!" parts of the name to the right.
curPos = foundTokenSpecs[0].rightPos;
boolean foundBangToken = false;
notDone = true;
while (notDone)
{
curPos = skipRightOverSpaces(line, curPos);
curPos = findMatchingRightParen(line, curPos);
if (curPos < 0)
{
notDone = false;
} else
{
curPos = skipRightOverSpaces(line, curPos);
if ((line.charAt(curPos) != '!') || (line.charAt(curPos + 1) == '!'))
{
notDone = false;
} else
{
curPos = curPos + 1;
curPos = skipRightOverSpaces(line, curPos);
currentToken = findMaximalIdCharSeq(line, curPos);
if ((currentToken == null) || IsNumber(currentToken.token))
{
notDone = false;
} else
{
foundBangToken = true;
// We now create a new TokenSpec by appending
// "!" + currentToken.token to the end of the
// first TokenSpec of foundTokenSpecs, and we prepend
// this TokenSpec to the beginning of foundTokenSpecs.
// We build the new foundTokenSpecs array in temp.
TokenSpec[] temp = new TokenSpec[1 + foundTokenSpecs.length];
temp[0] = new TokenSpec(foundTokenSpecs[0].token + "!" + currentToken.token,
foundTokenSpecs[0].leftPos, currentToken.rightPos);
for (int i = 0; i < foundTokenSpecs.length; i++)
{
temp[i + 1] = foundTokenSpecs[i];
}
foundTokenSpecs = temp;
curPos = currentToken.rightPos;
}
}
}
}
;
// If this wasn't the last token but we found no "!" following it,
// then something is wrong so we return an empty result
if (notLastToken && !foundBangToken)
{
return new TokenSpec[0];
}
;
return FixOrigin(foundTokenSpecs);
}
/**
* Returns the TokenSpec for the token in the array tokArray of Java
* strings (Java array of 1-character strings) in the line containing the
* character at position pos, or NullTokenSpec if there is none.
*
* @return
*/
private static TokenSpec findTokenIn(String line, int pos, String[] tokArray)
{
int tokIdx;
for (int i = 0; i < tokArray.length; i++)
{
tokIdx = tokArray[i].indexOf(line.charAt(pos), 0);
while (tokIdx != -1)
{
int ftlft = pos - tokIdx;
int ftrt = pos - tokIdx + tokArray[i].length();
if (tokArray[i].equals(line.substring(ftlft, ftrt)))
{
return new TokenSpec(tokArray[i], ftlft, ftrt);
}
tokIdx = tokArray[i].indexOf(line.charAt(pos), tokIdx + 1);
}
}
return null;
}
/**
* Returns the TokenSpec of the largest token containing digits, letters,
* and "_" characters containing position pos. Returns null if
* that would be an empty token.
*/
private static TokenSpec findMaximalIdCharSeq(String line, int pos)
{
int left = pos;
int rt = pos;
left = pos;
while (Character.isLetterOrDigit(line.charAt(left - 1)) || line.charAt(left - 1) == '_')
{
left--;
}
// The following while was
//
// while (Character.isLetterOrDigit(line.charAt(rt)) || line.charAt(left - 1) == '_')
//
// Apparently, the previous while was copied and only half-modified. As a
// result, the Goto Declaration and Show Uses commands wouldn't work if
// the cursor was inside an identifier containing a "_" to the left of the
// "_". This was also a problem with Control+click.
// Fixed by LL on 7 May 2012
while (Character.isLetterOrDigit(line.charAt(rt)) || line.charAt(rt) == '_')
{
rt++;
}
if (left == rt)
{
return null;
} else
{
return new TokenSpec(line.substring(left, rt), left, rt);
}
}
/**
* Assumes that leftTok and rightTok are two TokenSpecs, possibly
* NullTokenSpecs, separated by a ">". Checks if they form a step name.
* If so, it returns the TokenSpec for that step name; otherwise it
* returns null.
*
* @param line
* @param leftTok
* @param rightTok
* @return
*/
private static TokenSpec checkIfStepName(String line, TokenSpec leftTok, TokenSpec rightTok)
{
if (leftTok == null || rightTok == null)
{
return null;
}
if (IsNumber(leftTok.token) && (line.charAt(leftTok.leftPos - 1) == '<')
&& (line.charAt(leftTok.leftPos - 2) != '<'))
{
return new TokenSpec(line.substring(leftTok.leftPos - 1, rightTok.rightPos), leftTok.leftPos - 1,
rightTok.rightPos);
} else
{
return null;
}
}
/**
* Returns the position of the left paren matching a ")" at pos-1.
* If there is none, it returns -1.
*
* @param line
* @param pos
* @return
*/
private static int findMatchingLeftParen(String line, int pos)
{
if (line.charAt(pos - 1) != ')')
{
return pos;
}
;
return findMatchingLeftInner(line, pos, 0);
}
private static int findMatchingLeftInner(String line, int pos, int delim)
{
int ipos = pos;
int jdelim;
int delimLen = LeftDelimiters[delim].length();
ipos = pos - delimLen;
while (!line.substring(ipos - delimLen, ipos).equals(LeftDelimiters[delim]))
{
if (line.charAt(ipos - 1) == PaddingChar)
{
return -1;
}
;
ipos = ipos - 1;
jdelim = 0;
while (jdelim < LeftDelimiters.length)
{
if (line.substring(ipos - delimLen, ipos).equals(RightDelimiters[jdelim]))
{
ipos = findMatchingLeftInner(line, ipos, jdelim);
if (ipos < 0)
{
return -1;
}
jdelim = 99999; // exit while loop
}
;
jdelim = jdelim + 1;
}
}
;
return ipos - delimLen;
}
/**
* Returns the position of the right paren matching a "(" at position pos.
* If there is none, it returns -1.
*
* @param line
* @param pos
* @return
*/
private static int findMatchingRightParen(String line, int pos)
{
if (line.charAt(pos) != '(')
{
return pos;
}
;
return findMatchingRightInner(line, pos, 0);
}
private static int findMatchingRightInner(String line, int pos, int delim)
{
int ipos = pos;
int jdelim;
int delimLen = RightDelimiters[delim].length();
ipos = pos + delimLen;
while (!line.substring(ipos, ipos + delimLen).equals(RightDelimiters[delim]))
{
if (line.charAt(ipos) == PaddingChar)
{
return -1;
}
ipos = ipos + 1;
jdelim = 0;
while (jdelim < RightDelimiters.length)
{
if (line.substring(ipos, ipos + delimLen).equals(LeftDelimiters[jdelim]))
{
ipos = findMatchingRightInner(line, ipos, jdelim);
if (ipos < 0)
{
return -1;
}
jdelim = 99999; // exit while loop
}
;
jdelim = jdelim + 1;
}
}
;
return ipos + delimLen;
}
private static int skipLeftOverSpaces(String line, int curPos)
{
int index = curPos;
while (line.charAt(index - 1) == ' ')
{
index--;
}
return index;
}
private static int skipRightOverSpaces(String line, int curPos)
{
int index = curPos;
while (line.charAt(index) == ' ')
{
index++;
}
return index;
}
private static boolean IsNumber(String str)
{
if (str.length() == 0)
{
return false;
}
for (int i = 0; i < str.length(); i++)
{
if (!Character.isDigit(str.charAt(i)))
{
return false;
}
}
return true;
}
private static TokenSpec[] FixOrigin(TokenSpec[] tspec)
{
TokenSpec[] result = new TokenSpec[tspec.length];
for (int i = 0; i < tspec.length; i++)
{
result[i] = new TokenSpec(tspec[i].token, tspec[i].leftPos - Padding.length(), tspec[i].rightPos
- Padding.length());
}
return result;
}
private static final char PaddingChar = '\u0000';
private static final String Padding = "" + PaddingChar + PaddingChar + PaddingChar + PaddingChar + PaddingChar
+ PaddingChar + PaddingChar + PaddingChar + PaddingChar + PaddingChar;
private static final String[] Operators = new String[] { "-+->", "<=>", "...", "::=", "(+)", "(-)", "(.)", "(/)",
"(\\X)", "--", "**", "++", "<:", "<=", "<", ">=", "..", "||", "[]", "<>", "/\\", "\\/", "//", "/", "/=",
"~>", "=>", "=<", "=|", "^^", "##", "|-", "|=", "&&", "$$", "??", "%%", "@@", "!!", ":>", ":=", "~", "=",
"#", "^", "-", "*", ">", "<", "+", "|", "&", "$", "%", "\\" };
/*
* XOperators are the Operators containing an "X". Note that "\\X" is in
* a TeXSymbol, not in Operators.
*/
private static final String[] XOperators = { "(\\X)" };
// private static final String[] ParenOperators = new String[] { "(+)", "(-)", "(.)", "(/)", "(\\X)" };
private static final String[] TeXSymbols = new String[] { "\\neg", "\\lnot", "\\approx", "\\asymp", "\\bigcirc",
"\\bullet", "\\cap", "\\cdot", "\\circ", "\\cong", "\\cup", "\\div", "\\doteq", "\\equiv", "\\geq", "\\gg",
"\\in", "\\intersect", "\\union", "\\land", "\\leq", "\\ll", "\\lor", "\\mod", "\\o", "\\odot", "\\ominus",
"\\oplus", "\\oslash", "\\otimes", "\\prec", "\\preceq", "\\propto", "\\sim", "\\simeq", "\\sqcap",
"\\sqcup", "\\sqsubset", "\\sqsupset", "\\sqsubseteq", "\\sqsupseteq", "\\star", "\\subset", "\\subseteq",
"\\succ", "\\succeq", "\\supset", "\\supseteq", "\\uplus", "\\wr", "\\notin", "\\times", "\\X" };
private static final String[] NonOperators = new String[] { "==", "---", "->", "<-", "***", "<<", ">>" };
/**
* Returns true iff str is an element of the array TeXSymbols.
*
* @param str
* @return
*/
private static final boolean IsTeXSymbol(String str)
{
for (int i = 0; i < TeXSymbols.length; i++)
{
if (str.equals(TeXSymbols[i]))
{
return true;
}
}
return false;
}
private static String[] RightDelimiters = { ")", "]", "}", ">>" };
private static String[] LeftDelimiters = { "(", "[", "{", "<<" };
public String toString()
{
String str = "[token |-> " + this.token + ", leftPos |-> " + this.leftPos +
/* */", rightPos |-> " + this.rightPos + ", resolvedSymbol |-> ";
if (this.resolvedSymbol == null)
{
return str + "null]";
}
return str + this.resolvedSymbol.getName() + "]";
}
} |
//////////////////////////////////////////////////////////////////////////
// Class Name: SItemPanel
// Description: A Framework wrapping frame to be used in a swindow.
// Creator: <NAME>
// Version: 2011.10.20 - 1.0 - Create
//////////////////////////////////////////////////////////////////////////
#pragma once
#include "SwndContainerImpl.h"
namespace SOUI
{
class SItemPanel;
struct IItemContainer
{
virtual void OnItemSetCapture(SItemPanel *pItem,BOOL bCapture)=0; //设置or释放鼠标捕获
virtual BOOL OnItemGetRect(SItemPanel *pItem,CRect &rcItem)=0; //获得表项的显示位置
virtual BOOL IsItemRedrawDelay()=0; //指示表项的更新方式
virtual void OnItemRequestRelayout(SItemPanel *pItem)=0; //列表项请求重新布局
};
class SOUI_EXP SItemPanel : public SwndContainerImpl
{
public:
static SItemPanel * Create(SWindow *pFrameHost,pugi::xml_node xmlNode,IItemContainer *pItemContainer);
SWindow * GetHostWindow() { return m_pFrmHost;}
protected:
SItemPanel(SWindow *pFrameHost,pugi::xml_node xmlNode,IItemContainer *pItemContainer);
virtual ~SItemPanel() {}
virtual void OnFinalRelease();
public://SwndContainerImpl
virtual LRESULT DoFrameEvent(UINT uMsg,WPARAM wParam,LPARAM lParam);
virtual BOOL OnFireEvent(EventArgs &evt);
virtual CRect GetContainerRect();
virtual IRenderTarget * OnGetRenderTarget(const CRect & rc ,DWORD gdcFlags);
virtual void OnReleaseRenderTarget(IRenderTarget *pRT,const CRect &rc,DWORD gdcFlags);
virtual void OnRedraw(const CRect &rc);
virtual BOOL OnReleaseSwndCapture();
virtual SWND OnSetSwndCapture(SWND swnd);
virtual HWND GetHostHwnd();
virtual const SStringW & GetTranslatorContext();
virtual void FrameToHost(RECT & rc);
virtual BOOL IsTranslucent() const;
virtual BOOL IsSendWheel2Hover() const;
virtual BOOL OnCreateCaret(SWND swnd,HBITMAP hBmp,int nWidth,int nHeight);
virtual BOOL OnShowCaret(BOOL bShow);
virtual BOOL OnSetCaretPos(int x,int y);
virtual BOOL UpdateWindow();
virtual void UpdateTooltip();
virtual SMessageLoop *GetMsgLoop();
virtual IScriptModule * GetScriptModule();
virtual int GetScale() const;
public://SWindow
virtual void ModifyItemState(DWORD dwStateAdd, DWORD dwStateRemove);
virtual SWND SwndFromPoint(CPoint ptHitTest, BOOL bOnlyText);
virtual void Draw(IRenderTarget *pRT,const CRect & rc);
virtual void SetSkin(ISkinObj *pSkin);
virtual void SetColor(COLORREF crBk,COLORREF crSelBk);
virtual void BeforePaint(IRenderTarget *pRT, SPainter &painter);
virtual BOOL NeedRedrawWhenStateChange();
virtual BOOL OnUpdateToolTip(CPoint pt, SwndToolTipInfo &tipInfo);
virtual BOOL IsLayeredWindow() const {return FALSE;}
virtual void RequestRelayout(SWindow *pSource ,BOOL bSourceResizable);
CRect GetItemRect();
void SetItemCapture(BOOL bCapture);
void SetItemData(LPARAM dwData);
LPARAM GetItemData();
LPARAM GetItemIndex(){return m_lpItemIndex;}
void SetItemIndex(LPARAM lp){m_lpItemIndex=lp;}
void OnShowWindow(BOOL bShow, UINT nStatus);
void OnDestroy();
SOUI_MSG_MAP_BEGIN()
MSG_WM_DESTROY(OnDestroy)
MSG_WM_SHOWWINDOW(OnShowWindow)
SOUI_MSG_MAP_END()
protected:
SOUI_ATTRS_BEGIN()
ATTR_COLOR(L"colorNormal",m_crBk,FALSE)
ATTR_COLOR(L"colorSelected",m_crSelBk,FALSE)
ATTR_COLOR(L"colorHover",m_crHover,FALSE)
SOUI_ATTRS_END()
protected:
SWindow * m_pFrmHost;
IItemContainer * m_pItemContainer;
COLORREF m_crBk, m_crSelBk,m_crHover;
LPARAM m_dwData;
LPARAM m_lpItemIndex;
};
}//namespace SOUI |
def defined(transit_key, vault_client):
resource_uri = '%s/transit/keys/%s' %(vault_client.base_endpoint, transit_key)
response = requests.get(resource_uri, headers=vault_client.token_header)
try:
response.raise_for_status()
return True
except HTTPError:
return False |
/**
* Creates a {@link org.apache.accumulo.core.client.BatchWriter} for the
* specified table
* <p>
*
* @param store the accumulo store
* @param tableName the table name
* @return A new BatchWriter with the settings defined in the
* gaffer.accumulostore properties
* @throws StoreException if the table could not be found or other table issues
*/
private static BatchWriter createBatchWriter(final AccumuloStore store, final String tableName)
throws StoreException {
final BatchWriterConfig batchConfig = new BatchWriterConfig();
batchConfig.setMaxMemory(store.getProperties().getMaxBufferSizeForBatchWriterInBytes());
batchConfig.setMaxLatency(store.getProperties().getMaxTimeOutForBatchWriterInMilliseconds(),
TimeUnit.MILLISECONDS);
batchConfig.setMaxWriteThreads(store.getProperties().getNumThreadsForBatchWriter());
try {
return store.getConnection().createBatchWriter(tableName, batchConfig);
} catch (final TableNotFoundException e) {
throw new StoreException("Table not set up! Use table gaffer.accumulostore.utils to create the table"
+ store.getTableName(), e);
}
} |
def docs(session: nox.Session) -> None:
args: argparse.Namespace = parse_session_posargs(session.posargs)
docs_version: str = args.version.pop()
docs_alias: str = "latest"
index_html: bool = args.index_html
ver_regex: re.Pattern = re.compile(
r"^(?P<tag>v?)"
r"(?P<major>[0-9]+)\."
r"(?P<minor>[0-9]+)\."
r"(?P<patch>[0-9]+.*)?"
)
ver_match = ver_regex.search(docs_version)
if ver_match is None:
docs_version = "unknown"
docs_alias = "unknown"
else:
ver_groups = ver_match.groupdict()
docs_version = f'{ver_groups["major"]}.{ver_groups["minor"]}'
session.log(f"docs version: '{docs_version}'")
install_dependencies(session, "doc")
git_action_bot(session)
session.run(
"mike",
"deploy",
"--push",
"--update-aliases",
"-m",
f"docs(gh-pages): build versioned documention {docs_version}:{docs_alias}",
"-t",
f"ver. {docs_version}",
docs_version,
docs_alias,
)
if index_html:
session.run("mike", "set-default", "--push", "latest") |
package name.pjmbox.jfx.starter;
import java.io.InputStream;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;
import javafx.application.Application;
import javafx.application.Preloader.ProgressNotification;
import javafx.geometry.Rectangle2D;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Screen;
import javafx.stage.Stage;
import name.pjmbox.jfx.starter.splash.SplashPreloader;
public class OpenjfxApplicationRunner extends Application {
private static final String JVM_PARAMETER_PRELOADER = "javafx.preloader";
private static Class<?> baseClass;
private static boolean isSplashEnabled = false;
private static String appName;
private static String splashClassString = SplashPreloader.class.getName();
private static String styleString = Application.STYLESHEET_CASPIAN;
private static InputStream fxmlInputStream;
public static void setBaseClass(Class<?> c) {
baseClass = c;
}
public static void enableSplash(boolean enabled) {
isSplashEnabled = enabled;
}
public static void setSplashClass(Class<?> c) {
splashClassString = c.getName();
}
public static void setFxmlInputStream(InputStream is) {
fxmlInputStream = is;
}
public static void setApplicationStyle(String style) {
styleString = style;
}
public static void setApplicationName(String n) {
appName = n;
}
public static void run(String[] args) {
if (isSplashEnabled) {
System.setProperty(JVM_PARAMETER_PRELOADER, splashClassString);
}
if (appName != null) {
// TODO: 设置Macos菜单的app名字,似乎不成功,留待以后解决。
System.setProperty("dock:name", appName);
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", appName);
}
launch(args);
}
private Scene scene;
public OpenjfxApplicationRunner() {
}
protected void setProgress(double p) {
if (isSplashEnabled) {
notifyPreloader(new ProgressNotification(p));
}
}
@Override
public void init() throws Exception {
Application.setUserAgentStylesheet(styleString);
setProgress(0.2);
ConfigurableApplicationContext ctx = SpringApplication.run(baseClass);
setProgress(0.3);
var fxmlLoaderFactory = new FxmlLoaderFactory();
setProgress(0.4);
fxmlLoaderFactory.setApplicationContext(ctx);
setProgress(0.5);
var fxmlLoader = fxmlLoaderFactory.getFXMLLoader();
setProgress(0.6);
var root = (Parent) fxmlLoader.load(fxmlInputStream);
setProgress(0.7);
scene = new Scene(root);
setProgress(0.9);
}
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setScene(scene);
Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
primaryStage.setX(primaryScreenBounds.getMinX());
primaryStage.setY(primaryScreenBounds.getMinY());
primaryStage.setWidth(primaryScreenBounds.getWidth());
primaryStage.setHeight(primaryScreenBounds.getHeight());
primaryStage.show();
}
}
|
<filename>src/test/java/com/faforever/client/chat/ChatUserServiceTest.java<gh_stars>0
package com.faforever.client.chat;
import com.faforever.client.chat.avatar.AvatarBean;
import com.faforever.client.chat.avatar.AvatarService;
import com.faforever.client.clan.Clan;
import com.faforever.client.clan.ClanService;
import com.faforever.client.game.Game;
import com.faforever.client.game.GameBuilder;
import com.faforever.client.game.PlayerStatus;
import com.faforever.client.i18n.I18n;
import com.faforever.client.map.MapService;
import com.faforever.client.map.MapService.PreviewSize;
import com.faforever.client.player.Player;
import com.faforever.client.player.PlayerBuilder;
import com.faforever.client.player.SocialStatus;
import com.faforever.client.preferences.Preferences;
import com.faforever.client.preferences.PreferencesBuilder;
import com.faforever.client.preferences.PreferencesService;
import com.faforever.client.remote.domain.GameStatus;
import com.faforever.client.test.AbstractPlainJavaFxTest;
import com.faforever.client.theme.UiService;
import com.google.common.eventbus.EventBus;
import javafx.collections.FXCollections;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.testfx.util.WaitForAsyncUtils;
import java.net.URL;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public class ChatUserServiceTest extends AbstractPlainJavaFxTest {
private ChatUserService instance;
@Mock
private AvatarService avatarService;
@Mock
private CountryFlagService countryFlagService;
@Mock
private PreferencesService preferencesService;
@Mock
private I18n i18n;
@Mock
private UiService uiService;
@Mock
private EventBus eventBus;
@Mock
private ClanService clanService;
@Mock
private MapService mapService;
@Mock
private AvatarBean avatar;
private Preferences preferences;
private URL avatarURL;
private Clan testClan;
@Before
public void setUp() throws Exception {
preferences = PreferencesBuilder.create().defaultValues()
.chatPrefs()
.chatColorMode(ChatColorMode.DEFAULT)
.then()
.get();
avatarURL = new URL("http://avatar.png");
testClan = new Clan();
testClan.setTag("testClan");
when(clanService.getClanByTag(anyString())).thenReturn(CompletableFuture.completedFuture(Optional.of(testClan)));
when(countryFlagService.loadCountryFlag(anyString())).thenReturn(Optional.of(mock(Image.class)));
when(uiService.getThemeImage(anyString())).thenReturn(mock(Image.class));
when(mapService.loadPreview(anyString(), any(PreviewSize.class))).thenReturn(mock(Image.class));
when(avatarService.loadAvatar(anyString())).thenReturn(mock(Image.class));
when(avatar.getUrl()).thenReturn(avatarURL);
when(avatar.getDescription()).thenReturn("fancy");
when(i18n.getCountryNameLocalized("US")).thenReturn("United States");
when(preferencesService.getPreferences()).thenReturn(preferences);
instance = new ChatUserService(
uiService,
mapService,
avatarService,
clanService,
countryFlagService,
preferencesService,
i18n,
eventBus
);
}
@Test
public void testPlayerIsNull() {
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.get();
instance.associatePlayerToChatUser(chatUser, null);
WaitForAsyncUtils.waitForFxEvents();
verify(clanService, never()).getClanByTag(anyString());
verify(countryFlagService, never()).loadCountryFlag(anyString());
verify(avatarService, never()).loadAvatar(anyString());
verify(mapService, never()).loadPreview(anyString(), any(PreviewSize.class));
verify(uiService, never()).getThemeImage(anyString());
}
@Test
public void testChatUserNotDisplayed() {
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.displayed(false)
.get();
Player player = PlayerBuilder.create("test").defaultValues().get();
instance.associatePlayerToChatUser(chatUser, player);
WaitForAsyncUtils.waitForFxEvents();
verify(clanService, never()).getClanByTag(anyString());
verify(countryFlagService, never()).loadCountryFlag(anyString());
verify(avatarService, never()).loadAvatar(anyString());
verify(mapService, never()).loadPreview(anyString(), any(PreviewSize.class));
verify(uiService, never()).getThemeImage(anyString());
}
@Test
public void testClanNotNull() {
Player player = PlayerBuilder.create("junit").defaultValues().clan(testClan.getTag()).get();
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.get();
instance.associatePlayerToChatUser(chatUser, player);
WaitForAsyncUtils.waitForFxEvents();
verify(clanService).getClanByTag(testClan.getTag());
assertEquals(chatUser.getClan().orElse(null), testClan);
assertEquals(chatUser.getClanTag().orElse(null), String.format("[%s]", testClan.getTag()));
}
@Test
public void testClanNull() {
Player player = PlayerBuilder.create("junit").defaultValues().clan(null).get();
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.get();
instance.associatePlayerToChatUser(chatUser, player);
WaitForAsyncUtils.waitForFxEvents();
verify(clanService, never()).getClanByTag(anyString());
assertTrue(chatUser.getClan().isEmpty());
assertTrue(chatUser.getClanTag().isEmpty());
}
@Test
public void testAvatarNotNull() {
Player player = PlayerBuilder.create("junit").defaultValues().avatar(avatar).get();
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.get();
instance.associatePlayerToChatUser(chatUser, player);
WaitForAsyncUtils.waitForFxEvents();
verify(avatarService).loadAvatar(avatarURL.toExternalForm());
assertTrue(chatUser.getAvatar().isPresent());
}
@Test
public void testAvatarNull() {
Player player = PlayerBuilder.create("junit").defaultValues().get();
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.get();
instance.associatePlayerToChatUser(chatUser, player);
WaitForAsyncUtils.waitForFxEvents();
verify(avatarService, never()).loadAvatar(anyString());
assertTrue(chatUser.getAvatar().isEmpty());
}
@Test
public void testCountryNotNull() {
Player player = PlayerBuilder.create("junit").defaultValues().country("US").get();
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.get();
instance.associatePlayerToChatUser(chatUser, player);
WaitForAsyncUtils.waitForFxEvents();
verify(countryFlagService).loadCountryFlag("US");
assertTrue(chatUser.getCountryFlag().isPresent());
assertEquals("United States", chatUser.getCountryName().orElse(null));
}
@Test
public void testCountryNull() {
Player player = PlayerBuilder.create("junit").defaultValues().country(null).get();
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.get();
instance.associatePlayerToChatUser(chatUser, player);
WaitForAsyncUtils.waitForFxEvents();
verify(countryFlagService).loadCountryFlag(null);
assertTrue(chatUser.getCountryFlag().isEmpty());
assertTrue(chatUser.getCountryName().isEmpty());
}
@Test
public void testStatusToIdle() {
Player player = PlayerBuilder.create("junit").defaultValues().game(null).get();
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.get();
when(i18n.get("game.gameStatus.none")).thenReturn("None");
instance.associatePlayerToChatUser(chatUser, player);
WaitForAsyncUtils.waitForFxEvents();
verify(uiService, never()).getThemeImage(anyString());
assertFalse(chatUser.getMapImage().isPresent());
assertEquals(PlayerStatus.IDLE, chatUser.getGameStatus().orElse(null));
assertEquals("None", chatUser.getStatusTooltipText().orElse(null));
}
@Test
public void testStatusToPlaying() {
Game game = GameBuilder.create().defaultValues().state(GameStatus.PLAYING).get();
Player player = PlayerBuilder.create("junit").defaultValues().game(game).get();
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.get();
when(i18n.get("game.gameStatus.playing")).thenReturn("Playing");
instance.associatePlayerToChatUser(chatUser, player);
WaitForAsyncUtils.waitForFxEvents();
verify(uiService).getThemeImage(UiService.CHAT_LIST_STATUS_PLAYING);
assertTrue(chatUser.getMapImage().isPresent());
assertEquals(PlayerStatus.PLAYING, chatUser.getGameStatus().orElse(null));
assertEquals("Playing", chatUser.getStatusTooltipText().orElse(null));
}
@Test
public void testStatusToHosting() {
Game game = GameBuilder.create().defaultValues().state(GameStatus.OPEN).host("junit").get();
Player player = PlayerBuilder.create("junit").defaultValues().game(game).get();
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.get();
when(i18n.get("game.gameStatus.hosting")).thenReturn("Hosting");
instance.associatePlayerToChatUser(chatUser, player);
WaitForAsyncUtils.waitForFxEvents();
verify(uiService).getThemeImage(UiService.CHAT_LIST_STATUS_HOSTING);
assertTrue(chatUser.getMapImage().isPresent());
assertEquals(PlayerStatus.HOSTING, chatUser.getGameStatus().orElse(null));
assertEquals("Hosting", chatUser.getStatusTooltipText().orElse(null));
}
@Test
public void testStatusToLobbying() {
Game game = GameBuilder.create().defaultValues().state(GameStatus.OPEN).get();
Player player = PlayerBuilder.create("junit").defaultValues().game(game).get();
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.get();
when(i18n.get("game.gameStatus.lobby")).thenReturn("Waiting for game to start");
instance.associatePlayerToChatUser(chatUser, player);
WaitForAsyncUtils.waitForFxEvents();
verify(uiService).getThemeImage(UiService.CHAT_LIST_STATUS_LOBBYING);
assertTrue(chatUser.getMapImage().isPresent());
assertEquals(PlayerStatus.LOBBYING, chatUser.getGameStatus().orElse(null));
assertEquals("Waiting for game to start", chatUser.getStatusTooltipText().orElse(null));
}
@Test
public void testUserColorNotSet() {
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.get();
instance.populateColor(chatUser);
WaitForAsyncUtils.waitForFxEvents();
assertTrue(chatUser.getColor().isEmpty());
}
@Test
public void testUserColorSetNoPlayer() {
preferences.getChat().setUserToColor(FXCollections.observableMap(Map.of("junit", Color.AQUA)));
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.get();
instance.populateColor(chatUser);
WaitForAsyncUtils.waitForFxEvents();
assertTrue(chatUser.getColor().isPresent());
assertEquals(chatUser.getColor().get(), Color.AQUA);
}
@Test
public void testGroupColorSet() {
preferences.getChat().setGroupToColor(FXCollections.observableMap(Map.of(ChatUserCategory.FRIEND, Color.AQUA)));
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.get();
Player player = PlayerBuilder.create("junit")
.defaultValues()
.socialStatus(SocialStatus.FRIEND)
.get();
instance.associatePlayerToChatUser(chatUser, player);
WaitForAsyncUtils.waitForFxEvents();
assertTrue(chatUser.getColor().isPresent());
assertEquals(chatUser.getColor().get(), Color.AQUA);
}
@Test
public void testModeratorColorOverGroup() {
preferences.getChat().setGroupToColor(FXCollections.observableMap(Map.of(ChatUserCategory.MODERATOR, Color.RED, ChatUserCategory.FRIEND, Color.AQUA)));
ChatChannelUser chatUser = ChatChannelUserBuilder.create("junit")
.defaultValues()
.moderator(true)
.get();
Player player = PlayerBuilder.create("junit")
.defaultValues()
.socialStatus(SocialStatus.FRIEND)
.get();
instance.associatePlayerToChatUser(chatUser, player);
WaitForAsyncUtils.waitForFxEvents();
assertTrue(chatUser.getColor().isPresent());
assertEquals(chatUser.getColor().get(), Color.RED);
}
}
|
raise Exception("TESS.py got replaced with PredictedTESS.py")
|
//
// Created by jemin on 10.08.16.
// you can store data in memory for logsNplots with gnuplot or sotre in file for logsNplots in matlab
//
#ifndef RAI_DATA_LOGGER_HPP
#define RAI_DATA_LOGGER_HPP
#include <map>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <limits.h>
#include <boost/filesystem.hpp>
#include "RAI_data.hpp"
#include <iostream>
namespace rai {
namespace Utils {
enum LoggingOption {
ONEFILE_FOR_ONEDATA = 1<<(1)
};
class RAI_logger {
public:
RAI_logger() {
file_name_ = "dataLog";
};
~RAI_logger() {
// create path directories if not exists
boost::filesystem::path dirPath(log_path_.c_str());
if(!boost::filesystem::exists(dirPath))
boost::filesystem::create_directories(dirPath);
if(flags_ & ONEFILE_FOR_ONEDATA) {
for (int id = 0; id < data_.size(); id++) {
std::ostringstream logPath;
logPath << log_path_ << "/"<<file_name_<<"_"<<data_[id]->getName()<<".rlog";
std::ofstream logFile;
logFile.open(logPath.str().c_str());
logFile<<"Executable: "<<getExePath()<< "\n\n";
data_[id]->write2File(logFile);
delete data_[id];
}
} else {
std::ostringstream logPath;
logPath << log_path_ << "/"<<file_name_<<".rlog";
std::ofstream logFile;
logFile.open(logPath.str().c_str());
logFile<<"Executable: "<<getExePath()<< "\n\n";
for (int id = 0; id < data_.size(); id++)
data_[id]->write2File(logFile);
for (int id = 0; id < data_.size(); id++)
delete data_[id];
}
}
void setOptions(int flag) {flags_ = flag;}
/* names are separated by "/". ex) RAI/DDPG/LearningCurves */
void addVariableToLog(int dim, std::string name, std::string description) {
data_.push_back(new RAI_data(dim, name, description));
dataIdx_.insert(std::pair<std::string, int>(name, numberOfData_));
numberOfData_++;
}
template<typename ...Dtype>
void appendData(std::string name, Dtype... values) {
data_[dataIdx_[name]]->appendNewData(values...);
}
template<typename ...Args, typename Dtype>
void appendData(std::string name, Args... values, Dtype *data) {
data_[dataIdx_[name]]->appendNewData(values..., data);
}
float const *getData(std::string name, int dimensionIdx) {
RAIFATAL_IF(dataIdx_.find(name) == dataIdx_.end(),"no such Data available");
RAIFATAL_IF(dimensionIdx >= getDimension(name),"Dimension index requested exceeds the dimension of the data");
return &data_[dataIdx_[name]]->getData()[dimensionIdx][0];
}
const std::vector<std::vector<float> > *getData(std::string name) {
RAIFATAL_IF(dataIdx_.find(name) == dataIdx_.end(),"no such Data available");
return &data_[dataIdx_[name]]->getData();
}
int getDataSize(std::string name) {
RAIFATAL_IF(dataIdx_.find(name) == dataIdx_.end(), "no such Data available");
return data_[dataIdx_[name]]->getData()[0].size();
}
int getDimension(std::string name) {
return data_[dataIdx_[name]]->getData().size();
}
void clearData(std::string name) {
data_[dataIdx_[name]]->clearData();
}
std::string getCurrentDataAndTime() {
std::ostringstream dataAndTime;
time_t t = time(0); // get time now
struct tm *now = localtime(&t);
dataAndTime << (now->tm_year + 1900) << '-' << std::setfill('0')
<< std::setw(2) << (now->tm_mon + 1) << '-'
<< std::setw(2) << now->tm_mday << '-' << std::setw(2)
<< now->tm_hour << '-' << std::setw(2)
<< now->tm_min << '-' << std::setw(2) << now->tm_sec;
return dataAndTime.str().c_str();
}
void setLogPath(std::string& path){
log_path_ = path;
}
void setLogFileName(std::string& name){
file_name_ = name;
}
private:
std::vector<RAI_data *> data_;
std::map<std::string, int> dataIdx_;
int numberOfData_ = 0;
int flags_=0;
std::string log_path_ = "/tmp";
std::string file_name_;
std::string getExePath()
{
char result[ 500 ];
ssize_t count = readlink( "/proc/self/exe", result, 500 );
return std::string( result, (count > 0) ? count : 0 );
}
};
}
}
#endif //RAI_DATA_LOGGER_HPP
|
import opc, time, math, random, sys
from base import CubeLights
class FPSQueue(object):
def __init__(self, samples):
self.samples = samples
self.frames = [0] * samples
self.pos = 0
def RecordFrame(self, ts, pixel_count):
self.frames[self.pos] = ts
self.pos = (self.pos + 1) % self.samples
if self.pos == 0:
fps = (self.samples - 1) / self.GetTotalTime()
print "%s fps (%f Mbps)" % (
round(fps, 2),
round(24 * pixel_count * fps / 1000000, 2))
def GetFrameTime(self, index):
return self.frames[index % self.samples]
def GetTotalTime(self):
return self.GetFrameTime(self.pos - 1) - self.GetFrameTime(self.pos)
class CubeAnimator(CubeLights):
def __init__(self, fps, width, depth, height):
super(CubeAnimator, self).__init__(width, depth, height)
self.fps = int(fps)
self.pixels = [(0, 0, 0)] * self.total_leds
self.client = opc.Client('localhost:8080')
self.fpsqueue = FPSQueue(int(fps))
self.pixel_args = self.GeneratePixelArgs()
def GeneratePixelArgs(self):
result = []
for x in range(self.width):
for y in range(self.depth):
for z in range(self.height):
pixel_index = (x * self.depth * self.height +
y * self.height +
z)
px = x / self.xd
py = y / self.yd
pz = z / self.zd
result.append((pixel_index,
x,
y,
z,
px,
py,
pz))
return result
def Run(self, pool, set_pixel):
frame_index = 0
start_time = round(time.time())
while True:
next_frame_time = start_time + (frame_index / float(self.fps))
now = time.time()
self.fpsqueue.RecordFrame(now, len(self.pixels))
wait_time = next_frame_time - now
#print "frame %f %f %f" % (time.time(), next_frame_time, wait_time)
if (wait_time > 0.0):
time.sleep(wait_time)
#else:
#print "falling behind: %f" % wait_time
self.RenderFrame(frame_index, pool, set_pixel)
frame_index += 1
def RenderFrame(self, frame_index, pool, set_pixel):
args = [(pixel_arg + (frame_index, )) for pixel_arg in self.pixel_args]
self.pixels = pool.map(set_pixel, args, chunksize=len(self.pixels)/8)
# for pixel_arg in self.pixel_args:
# joined_args = pixel_arg + (frame_index, )
# self.pixels[pixel_arg[0]] = self.SetPixel(*joined_args)
self.client.put_pixels(self.pixels)
|
"""
470. Implement Rand10() Using Rand7()
Given a function rand7 which generates a uniform random integer in the range 1 to 7, write a function rand10 which generates a uniform random integer in the range 1 to 10.
Do NOT use system's Math.random().
Example 1:
Input: 1
Output: [7]
Example 2:
Input: 2
Output: [8,4]
Example 3:
Input: 3
Output: [8,1,10]
"""
# quite interesting question
# use the knowlege about rejection sampling
# see tutorial: https://leetcode.com/articles/implement-rand10-using-rand7/
# The rand7() API is already defined for you.
# def rand7():
# @return a random integer in the range 1 to 7
class Solution:
def rand10(self):
"""
:rtype: int
"""
row, col = rand7(), rand7()
index = 7 * (row-1) + col
while index > 40:
row, col = rand7(), rand7()
index = 7 * (row-1) + col
return (index-1) % 10 + 1
|
Intergenic Spacer-RFLP Analysis and Direct Quantification of Australian Fusarium oxysporum f. sp. vasinfectum Isolates from Soil and Infected Cotton Tissues.
Fusarium wilt of cotton, caused by Fusarium oxysporum f. sp. vasinfectum, can have devastating effects on the vascular system of cotton plants and is a major threat to cotton production throughout the world. Accurate characterization and improved detection of these pathogenic isolates is needed for the implementation of a disease prevention program and the development of disease management strategies. Polymerase chain reaction (PCR) amplification of the ribosomal intergenic spacer (IGS) regions combined with digestion with three restriction enzymes (AluI, HaeIII, RsaI) resulted in three unique restriction profiles (IGS-restriction fragment length polymorphism haplotypes) for Australian F. oxysporum f. sp. vasinfectum isolates, which were capable of distinguishing them from other formae speciales of F. oxysporum. Furthermore, a portion of the IGS region flanking the 5' end was sequenced and single nucleotide polymorphisms (SNPs) were revealed. Using these sequence data, two specific real-time PCR-based assays were developed for the absolute quantification of genomic DNA from isolates obtained from soil substrates and infected cotton tissues. Standard curves of real-time PCR-based assays showed a linear relation (R2 = 0.993 to 0.994) between log values of fungal genomic DNA and real-time PCR cycle thresholds. Using these assays, it was possible to detect fungal DNA as low as 5 pg/μl. The detection sensitivity for inoculum added to sterile soils was lower than 104 conidia/g soil. In plant samples, the quantified fungal DNA varied from 30 pg to 1 ng/100 ng of total plant genomic DNA. |
By Garett Jones
We humans are a social species: we rely on each other to get things done. Whether it’s building a car, creating a happy marriage, or holding a potluck dinner at church, we usually need to cooperate in order to achieve the big successes in life.
Why is cooperation so hard? Because cooperating is often against your own best interest. When you’re going to a potluck dinner, the smart thing to do is to bring a bag of chips while sampling other people’s delicious casseroles. At some point before you arrive, you might think, “If everyone does that, then all we’ll have at the potluck is twenty bags of chips.” And that’s true enough, but you have no influence over whether those other nineteen people bring chips or casseroles, so why not do what’s best for yourself: chips it is.
But in real life, cooperation is fairly common, even when the temptation to betray is strong. Why? Economists found one solution in the early days of the field known as “game theory”: that once you turn a one-shot prisoner’s dilemma into a repeated game, it’s possible for selfish players to rationally cooperate with each other, not out of a sense of generosity but out of pure self-interest. This result—that repetition can turn lemons into lemonade—is known as the “folk theorem.” That’s because it seemed fairly obvious once people started thinking about it, and no one economist was really willing to take credit for the idea.
Get Evonomics in your inbox
One researcher—a political scientist, Robert Axelrod—went further than this. He saw repeated prisoner’s dilemmas (RPDs) everywhere in politics and society, and so he concluded that if he could find out how to get people cooperating rather than descending into bitter defection, he could help make the world a more peaceful place. It sounds a bit naive—but it was nothing of the sort. Axelrod’s research, summed up in his excellent book The Evolution of Cooperation, is still used by peace negotiators, labor-management mediators, and nuclear arms reduction experts. His is an agenda that has made the world a better, safer place. And it began by just taking the repeated prisoner’s dilemma seriously, so seriously that Axelrod decided to get a lot of social scientists together to play some games.
Axelrod ran a competition—not in real life, but on some 1970s- era computers. He invited social scientists, mathematicians, anyone interested to submit a simple computer program giving instructions to one of the electronic “players” in a two-person repeated prisoner’s dilemma game. The winner of the tournament would be the contestant whose program could win the most points when pitted against the other computer programs. The most points, naturally, clocked in when the other player cooperated while you defected; when both cooperated you got a good outcome, but not as good as when you were exploiting the other player.
So dozens of researchers proposed dozens of computer programs for the tournament. As you can imagine, some programs were quite sophisticated, looking for ways to dupe the other computerized player into cooperating so that the entrant could exploit his partner for at least a few rounds of the tournament. But not every program was sophisticated; in fact one program followed the simplest rule possible: “always cooperate.” Which computer program—which strategy—won the entire tournament? It’s known by the phrase: tit for tat.
Tit for tat combines an open right hand with an armed left hand. In a society filled with tit for tatters, people would always cooperate, not because those people were doormats or naïfs, but because any potential cheater would know that she would be quickly punished. So, tit for tat is a good strategy—something worth keeping in mind the next time you have an argument with the neighbors over who should fix the broken fence.
But Axelrod wanted to do more than just pinpoint a good computer program: he tried to distill the essence of what made tit for tat and a few similar strategies work so well in order to convey those lessons to the world. He came up with some principles for encouraging cooperation in repeated prisoner’s dilemma settings. Three of them matter for us: think of them as the Three P’s of the RPD. Players should
Be patient: Focus on the long-term benefits of finding a way to cooperate—don’t just focus on the short-run pleasures, whether it’s the pleasure of exploitation or the pleasure of punishment. Axelrod calls this “extending the shadow of the future.” Be pleasant: Start off nice—make sure those bared teeth are part of a smile. And later in the game, take the ABBA approach, and take a chance on cooperating every now and then, even when things have gone south for a while. Be perceptive: Figure out what game you’re playing—know the rules, and know the benefits and costs of cooperation.
I claim that people with higher IQs will be better at all three. That higher-IQ players tend to follow the third piece of advice, “Be perceptive,” is almost obvious: higher-IQ individuals are just more likely to get it, to grok the key ideas, as sci-fi writer Robert Heinlein used to say. Not always, not perfectly, but on average individuals with high IQ are better at grokking the rules of the social game, they’re more socially intelligent. As dozens of psychology and economics experiments demonstrate, high IQ also tends to predict patient behavior. Those who see the patterns in the Raven’s Progressive Matrices also see the future. That means that in a repeated prisoner’s dilemma, they’ll tend to focus on the rewards of long-term cooperation, not the short-term thrills of punishment or exploitation.
My final claim is that higher-IQ people are nicer than most other people—at least when they’re in settings such as the repeated prisoner’s dilemma. Can that really be the case? You might expect higher-IQ people to be a little meaner in some cases—they might try to exploit people if they figure out a way to exploit them. That might be important in some settings, but there are interesting new experiments that show how high IQ predicts generosity.
Economist Aldo Rustichini and his coauthors gave IQ tests to a thousand people enrolled in a truck-driving school, and then they had them play a trust game. A typical trust game—first invented by my George Mason colleague Kevin McCabe and his coauthors—works like this. The game has just two players, each making one choice. They can’t see each other, and they never know who they’re actually playing; in most cases, they’re just facing a computer terminal. First, Player 1 starts with $5; he then decides how much of his money (if any!) to send to Player 2 and how much to keep for himself. If some of the money is sent over, the money sent magically triples in value. So if Player 1 sent over $2, Player 2 now has $6. Player 2 now gets to decide how much money to return to Player 1; she can return nothing and keep all $6, she can return all $6 and keep nothing for herself, or she can do something in between. Since McCabe and coauthors invented this experiment, it’s been run numerous times: most players return just about the amount that Player 1 sent over—in other words, the average person is trustworthy, but no philanthropist.
Most people are interested in the question of “Who reciprocates? Who is trustworthy?” But here we’re interested not in Player 2 but in Player 1: Who’s the biggest sucker? Who takes the chance on sending money over—without a formal contract, without being able to even see the other person? Wouldn’t we expect players with lower IQ scores to naively send over cash, in the hope that Player 2 will be generous? Wouldn’t we expect a higher-IQ Player 1 to figure out that Player 2 has no incentive to be kind? We might, but in fact, Rustichini found just the opposite: the higher-IQ students in truck-driving school sent over more money than their classmates with lower IQs. So smarter players are more likely to start off by playing nice. This result—that IQ predicts “generous” or “nice” behavior—was backed up by a German study, a team- effort problem: a few players are each given a few Euros, and they each have to decide how much to chip in to the pot. If the total amount chipped in is greater than, say, 10€, then the pot doubles, and the amount in the pot is split equally between all the players; if not, the pot evaporates, with nobody getting anything except the money they held out of the pot. In this study, higher-IQ players put more into the pot. They may have done it out of kindness to others, or they may have done it because they shrewdly calculated that they had a decent chance of being the donor who pushed the pot over the 10€ threshold, so it’s hard to tell what their motives were. But in any case, smarter players chipped in more, and what they chipped in helped everyone in the group. They were more pleasant.
Another study by Brown University economist Louis Putterman and his coauthors found still more evidence that higher-IQ individuals are more likely to start off by playing nice, by being generous team players. In this game, known as the public goods game, players individually decide how much of their own money to put in a metaphorical pot, the money doubles or triples, and then it gets divided up among the group. When you give money, you’re directly contributing to the public good. The game was repeated for a few rounds with the same team so players would have a chance to learn from each other, a chance to find a path to cooperation.
As this was run at Brown University, an Ivy League school where one might expect that almost all students are raised in incredibly advantaged environments, it might seem that differences in IQ scores would be irrelevant. But in Putterman’s cooperation experiment, IQ mattered. He and his coauthors found that higher- IQ students at Brown put more money in the pot during the early rounds of the game: the higher-IQ students were more pleasant early on. That’s the smart thing to do, because extra money early on can send a signal of kindness, of cooperativeness, to the other players. And it’s worth noting that in another part of the experiment, when the students could vote on a way to penalize low contributors, higher-IQ students were more likely to vote for a rule that would penalize the non-cooperators: so higher-IQ students were pleasant, but not naive.
Intelligence as a Way to Read the Minds of Others
But just how socially perceptive are higher-IQ people? After all, being nice in a lab experiment might not translate into real-world social interactions, and while IQ predicts social intelligence in surveys, it would be good to have a concrete test of social perceptiveness.
One test by economist David Cesarini and his coauthors illustrates the ability of higher-IQ individuals to understand the minds of others. The Keynesian Beauty Contest, as it is known, is a game in which all the players are asked to pick a number from zero to one hundred. A prize will be given to the person whose guess is closest to, say, one-half of the group’s average guess. In the event of a tie they might split the prize among the best guesses. So if almost everyone chose fifty but just one person chose thirty, that lower guess would win. If the players were all perfectly rational, and they knew that everyone else in the game was equally rational, they would realize that the winning answer would be the only number that is exactly one half of itself: zero.
But people aren’t perfectly rational and—here’s the good part— people who are more rational are more likely to be aware of just how irrational most people are. So while the weaker players would pick numbers close to randomly—guessing on average fifty or a little below—someone better-skilled might realize that the group combines some sharper players with some weaker players, and so submit a guess quite a bit lower than fifty. But isn’t there a chance that higher-IQ players make the mistake of thinking that everyone is as smart as they are? Or might they overthink the situation, foolishly submitting zero as the right answer? In a study of Swedes, Cesarini and coauthors found that players with the highest IQs submitted numbers that were low but not too low; indeed they gave answers that were strikingly close to the best possible answer. By contrast, players in the bottom of the IQ distribution gave answers that tended to be far too high. IQ predicted not just individual rationality but a better view into the minds of others. And later a second study came to the same finding using another IQ-type test.
Overall, mental test scores predict the ability to understand the minds of others.
It’s possible that the link between IQ and cooperation won’t seem like any great surprise to you: these experiments are just games, an IQ test is a game, and people who are good at one kind of game are often good at other games. But life is a game as well.
In the field of psychology it’s well-known that higher IQ predicts greater openness to new experiences, a greater willingness to try new things out. In addition to being more open to new things, the person with the higher test score is more likely to understand the rules, more likely to figure out when being nice is worth it and when it’s a fool’s errand, and more likely to figure out when it’s best to cut her losses when the investment in kindness isn’t paying off. Assessing the situation: that’s a skill one would expect to be more common among people with higher test scores. If an entire group of individuals with higher IQs are together for a reasonably long period of time, we should expect them to find more win-win outcomes, growing a bigger pie that they can squabble over later.
I can’t tell you how many times I’ve met people from all walks of life who’ve told me that smarter people lack common sense, that they overthink and overstrategize issues to their detriment. If that were the case then smarter groups would likely turn out to be “too big for their britches” and collapse into endless rounds of cheating; failed attempts at exploitation; and continual, costly punishment. Certainly that happens sometimes, but on average, that is not the case. Smarter groups tend to be more cooperative. This finding, which shows up both in lab experiments and in free-form negotiation studies, means that intelligent groups have more social intelligence. That helps explain why countries with high average test scores usually have stronger economies and more effective governments.
Excerpt from Hive Mind: How Your Nation’s IQ Matters So Much More Than Your Own by Garett Jones.(c) 2016 by the Board of Trustees of the Leland Stanford Jr. University. All rights reserved. Published by Stanford University Press in hardcover and digital formats, sup.org. No reproduction or any other use is allowed without the publisher’s prior permission.
2016 March 13 |
Photography and modern architecture: a distinctive narrative from Spain
Introduction In 1928, Le Corbusier was invited to the Residencia de Estudiantes in Madrid. His letter of acceptance ended with the postscript: ‘I am sending you some photos.’ In 1936, Richard Neutra’s secretary asked the Director of the avant-garde magazine AC Documentos de Actividad Contemporánea: ‘Did you receive the set of photographs that we sent?’. José Antonio Coderch’s letter to the Dutchman Van der Grinten in 1952 stated that: ‘I am including a list of architects whom you can address in order to request photographs of their work.’ And in 1955, Alberto Sartoris reminded Rafael Aburto: ‘I want to inform you that the second edition of the first volume of my Encyclopédie de l’Architecture Nouvelle will soon be out. I would like to publish some of your work and I am taking the liberty to remind you that you once promised me photographs.’ These are a few examples of the photographs of Spanish architecture being circulated for dissemination in specialised media. A photograph depicting the architects’ hands fromGrupo R selecting pictures for inclusion in the Group’s show at the Galerías Layetanas of Barcelona in 1952 also offers a visual synthesis of the use of photography as an instrument for the propagation of the new architecture (Fig. 1). Just taking a look at the Alberto Sartoris Archive in Lausanne, Switzerland, gives us an impression of the kind of influx of requests and, above all, of the astonishing amount of photographs of modern architecture taken by renowned international architectural photographers. Amongst them, we find a significant representation from Spanish architecture, mostly attributed to the photographer Francesc Català-Roca (Fig. 2), and looking at them, we can easily begin to perceive that they are worth careful analysis. Modern architecture cannot be understood without a comprehension of the parallel role played by its photographic depiction: this assumption is in fact crucial to our investigation. It is also supported by the increasing importance attributed to the symbiotic relationship between architecture and photography amongst scholars and historians of both disciplines, as well as within a broader audience. Before arriving at the Spanish context, and given that it is helpful in supporting the findings and implications of our research, it is worth reviewing briefly the evolution of this topic in achieving such interest and popularity. |
BayesStore: Probabilistic Graphical Models as First Class Database Citizens Probabilistic Databases Seminar 2009
A method and system for controlling an electronic device uses a reading device and a specially formatted surface. The specially formatted surface includes a predefined address pattern and at least one field for use in performing a control function on the electronic device. By detecting a portion of the address pattern that is adjacent to the reading device, a position of the reading device can be determined. Furthermore, by repeatedly detecting portions of the address pattern, movement of the reading device relative to the address pattern can also be determined. When a detected position or movement is within a control field, a corresponding control function can be performed on the electronic device. |
/**
* A servlet that verifies a registrar's OTE status. Note that this is eventually consistent, so
* OT&E commands that have been run just previously to verification may not be picked up yet.
*/
@Action(
path = VerifyOteAction.PATH,
method = Action.Method.POST,
xsrfProtection = true,
xsrfScope = "admin")
public class VerifyOteAction implements Runnable, JsonAction {
public static final String PATH = "/_dr/admin/verifyOte";
@Inject JsonActionRunner jsonActionRunner;
@Inject VerifyOteAction() {}
@Override
public void run() {
jsonActionRunner.run(this);
}
@Override
@SuppressWarnings("unchecked")
public Map<String, Object> handleJsonRequest(Map<String, ?> json) {
final boolean summarize = Boolean.parseBoolean((String) json.get("summarize"));
return toMap(
(List<String>) json.get("registrars"),
new Function<String, Object>() {
@Nonnull
@Override
public Object apply(@Nonnull String registrar) {
return checkRegistrar(registrar, summarize);
}});
}
/** Checks whether the provided registrar has passed OT&E and returns relevant information. */
private String checkRegistrar(String registrarName, boolean summarize) {
HistoryEntryStats historyEntryStats =
new HistoryEntryStats().recordRegistrarHistory(registrarName);
List<String> failureMessages = historyEntryStats.findFailures();
String passedFraction = String.format(
"%2d/%2d", StatType.NUM_REQUIREMENTS - failureMessages.size(), StatType.NUM_REQUIREMENTS);
String status = failureMessages.isEmpty() ? "PASS" : "FAIL";
return summarize
? String.format(
"Num actions: %4d - Reqs passed: %s - Overall: %s",
historyEntryStats.statCounts.size(),
passedFraction,
status)
: String.format(
"%s\n%s\nRequirements passed: %s\nOverall OT&E status: %s\n",
historyEntryStats,
Joiner.on('\n').join(failureMessages),
passedFraction,
status);
}
private static final Predicate<EppInput> HAS_CLAIMS_NOTICE = new Predicate<EppInput>() {
@Override
public boolean apply(@Nonnull EppInput eppInput) {
LaunchCreateExtension launchCreate =
eppInput.getSingleExtension(LaunchCreateExtension.class);
return launchCreate != null && launchCreate.getNotice() != null;
}};
private static final Predicate<EppInput> HAS_FEE = new Predicate<EppInput>() {
@Override
public boolean apply(@Nonnull EppInput eppInput) {
return eppInput.getFirstExtensionOfClasses(
FEE_CREATE_COMMAND_EXTENSIONS_IN_PREFERENCE_ORDER) != null;
}};
private static final Predicate<EppInput> HAS_SEC_DNS = new Predicate<EppInput>() {
@Override
public boolean apply(@Nonnull EppInput eppInput) {
return (eppInput.getSingleExtension(SecDnsCreateExtension.class) != null)
|| (eppInput.getSingleExtension(SecDnsUpdateExtension.class) != null);
}};
private static final Predicate<EppInput> IS_SUNRISE = new Predicate<EppInput>() {
@Override
public boolean apply(@Nonnull EppInput eppInput) {
LaunchCreateExtension launchCreate =
eppInput.getSingleExtension(LaunchCreateExtension.class);
return launchCreate != null && !isNullOrEmpty(launchCreate.getSignedMarks());
}};
private static final Predicate<EppInput> IS_IDN = new Predicate<EppInput>() {
@Override
public boolean apply(@Nonnull EppInput eppInput) {
return ((DomainCommand.Create) ((ResourceCommandWrapper)
eppInput.getCommandWrapper().getCommand()).getResourceCommand())
.getFullyQualifiedDomainName().startsWith(ACE_PREFIX);
}};
private static final Predicate<EppInput> IS_SUBORDINATE = new Predicate<EppInput>() {
@Override
public boolean apply(@Nonnull EppInput eppInput) {
return !isNullOrEmpty(((HostCommand.Create) ((ResourceCommandWrapper)
eppInput.getCommandWrapper().getCommand()).getResourceCommand())
.getInetAddresses());
}};
private static Predicate<EppInput> isFlow(final Class<? extends Flow> flowClass) {
return new Predicate<EppInput>() {
@Override
public boolean apply(@Nonnull EppInput eppInput) {
try {
return flowClass.equals(getFlowClass(eppInput));
} catch (EppException e) {
throw new RuntimeException(e);
}
}};
}
/** Enum defining the distinct statistics (types of registrar actions) to record. */
public enum StatType {
CONTACT_CREATES(0, isFlow(ContactCreateFlow.class)),
CONTACT_DELETES(0, isFlow(ContactDeleteFlow.class)),
CONTACT_TRANSFER_APPROVES(0, isFlow(ContactTransferApproveFlow.class)),
CONTACT_TRANSFER_CANCELS(0, isFlow(ContactTransferCancelFlow.class)),
CONTACT_TRANSFER_REJECTS(0, isFlow(ContactTransferRejectFlow.class)),
CONTACT_TRANSFER_REQUESTS(0, isFlow(ContactTransferRequestFlow.class)),
CONTACT_UPDATES(0, isFlow(ContactUpdateFlow.class)),
DOMAIN_APPLICATION_CREATES(0, isFlow(DomainApplicationCreateFlow.class)),
DOMAIN_APPLICATION_CREATES_LANDRUSH(
1, isFlow(DomainApplicationCreateFlow.class), not(IS_SUNRISE)),
DOMAIN_APPLICATION_CREATES_SUNRISE(1, isFlow(DomainApplicationCreateFlow.class), IS_SUNRISE),
DOMAIN_APPLICATION_DELETES(2, isFlow(DomainApplicationDeleteFlow.class)),
DOMAIN_APPLICATION_UPDATES(2, isFlow(DomainApplicationUpdateFlow.class)),
DOMAIN_CREATES(0, isFlow(DomainCreateFlow.class)),
DOMAIN_CREATES_ASCII(1, isFlow(DomainCreateFlow.class), not(IS_IDN)),
DOMAIN_CREATES_IDN(1, isFlow(DomainCreateFlow.class), IS_IDN),
DOMAIN_CREATES_WITH_CLAIMS_NOTICE(1, isFlow(DomainCreateFlow.class), HAS_CLAIMS_NOTICE),
DOMAIN_CREATES_WITH_FEE(1, isFlow(DomainCreateFlow.class), HAS_FEE),
DOMAIN_CREATES_WITH_SEC_DNS(1, isFlow(DomainCreateFlow.class), HAS_SEC_DNS),
DOMAIN_CREATES_WITHOUT_SEC_DNS(0, isFlow(DomainCreateFlow.class), not(HAS_SEC_DNS)),
DOMAIN_DELETES(2, isFlow(DomainDeleteFlow.class)),
DOMAIN_RENEWS(0, isFlow(DomainRenewFlow.class)),
DOMAIN_RESTORES(1, isFlow(DomainRestoreRequestFlow.class)),
DOMAIN_TRANSFER_APPROVES(1, isFlow(DomainTransferApproveFlow.class)),
DOMAIN_TRANSFER_CANCELS(1, isFlow(DomainTransferCancelFlow.class)),
DOMAIN_TRANSFER_REJECTS(1, isFlow(DomainTransferRejectFlow.class)),
DOMAIN_TRANSFER_REQUESTS(1, isFlow(DomainTransferRequestFlow.class)),
DOMAIN_UPDATES(0, isFlow(DomainUpdateFlow.class)),
DOMAIN_UPDATES_WITH_SEC_DNS(1, isFlow(DomainUpdateFlow.class), HAS_SEC_DNS),
DOMAIN_UPDATES_WITHOUT_SEC_DNS(0, isFlow(DomainUpdateFlow.class), not(HAS_SEC_DNS)),
HOST_CREATES(0, isFlow(HostCreateFlow.class)),
HOST_CREATES_EXTERNAL(0, isFlow(HostCreateFlow.class), not(IS_SUBORDINATE)),
HOST_CREATES_SUBORDINATE(1, isFlow(HostCreateFlow.class), IS_SUBORDINATE),
HOST_DELETES(1, isFlow(HostDeleteFlow.class)),
HOST_UPDATES(1, isFlow(HostUpdateFlow.class)),
UNCLASSIFIED_FLOWS(0, Predicates.<EppInput>alwaysFalse());
/** The number of StatTypes with a non-zero requirement. */
private static final int NUM_REQUIREMENTS = FluentIterable.from(asList(values()))
.filter(new Predicate<StatType>() {
@Override
public boolean apply(@Nonnull StatType statType) {
return statType.requirement > 0;
}})
.size();
/** Required number of times registrars must complete this action. */
final int requirement;
/** Filters to determine if this action was performed by an EppInput. */
private Predicate<EppInput>[] filters;
@SafeVarargs
StatType(int requirement, Predicate<EppInput>... filters) {
this.requirement = requirement;
this.filters = filters;
}
/** Returns a more human-readable translation of the enum constant. */
String description() {
return Ascii.toLowerCase(this.name().replace('_', ' '));
}
/** An {@link EppInput} might match multiple actions, so check if this action matches. */
boolean matches(EppInput eppInput) {
return Predicates.and(filters).apply(eppInput);
}
}
/** Class to represent stats derived from HistoryEntry objects on actions taken by registrars. */
static class HistoryEntryStats {
/** Stores counts of how many times each action type was performed. */
Multiset<StatType> statCounts = HashMultiset.create();
/**
* Records data in the passed historyEntryStats object on what actions have been performed by
* the four numbered OT&E variants of the registrar name.
*/
HistoryEntryStats recordRegistrarHistory(String registrarName) {
ImmutableList.Builder<String> clientIds = new ImmutableList.Builder<>();
for (int i = 1; i <= 4; i++) {
clientIds.add(String.format("%s-%d", registrarName, i));
}
for (HistoryEntry historyEntry :
ofy().load().type(HistoryEntry.class).filter("clientId in", clientIds.build()).list()) {
try {
record(historyEntry);
} catch (EppException e) {
throw new RuntimeException(e);
}
}
return this;
}
/** Interprets the data in the provided HistoryEntry and increments counters. */
void record(HistoryEntry historyEntry) throws EppException {
byte[] xmlBytes = historyEntry.getXmlBytes();
// xmlBytes can be null on contact create and update for safe-harbor compliance.
//
// TODO(b/26161587): inspect the history entry itself to handle this properly.
if (xmlBytes == null) {
return;
}
final EppInput eppInput = unmarshal(EppInput.class, xmlBytes);
if (!statCounts.addAll(
FluentIterable.from(EnumSet.allOf(StatType.class))
.filter(
new Predicate<StatType>() {
@Override
public boolean apply(@Nonnull StatType statType) {
return statType.matches(eppInput);
}
})
.toList())) {
statCounts.add(StatType.UNCLASSIFIED_FLOWS);
}
}
/**
* Returns a list of failure messages describing any cases where the passed stats fail to
* meet the required thresholds, or the empty list if all requirements are met.
*/
List<String> findFailures() {
List<String> messages = new ArrayList<>();
for (StatType statType : StatType.values()) {
if (statCounts.count(statType) < statType.requirement) {
messages.add(String.format(
"Failure: %s %s found.",
(statType.requirement == 1 ? "No" : "Not enough"),
statType.description()));
}
}
return messages;
}
/** Returns a string showing all possible actions and how many times each was performed. */
@Override
public String toString() {
return FluentIterable.from(EnumSet.allOf(StatType.class))
.transform(
new Function<StatType, String>() {
@Nonnull
@Override
public String apply(@Nonnull StatType statType) {
return String.format(
"%s: %d", statType.description(), statCounts.count(statType));
}
})
.append(String.format("TOTAL: %d", statCounts.size()))
.join(Joiner.on("\n"));
}
}
} |
/**
* Returns the specified number of parses or fewer for the specified tokens. <br>
* <b>Note:</b> The nodes within
* the returned parses are shared with other parses and therefore their parent node references will not be consistent
* with their child node reference. {@link #setParents setParents} can be used to make the parents consistent
* with a partuicular parse, but subsequent calls to <code>setParents</code> can invalidate the results of earlier
* calls.<br>
* @param tokens A parse containing the tokens with a single parent node.
* @param numParses The number of parses desired.
* @return the specified number of parses for the specified tokens.
*/
public Parse[] parse(Parse tokens, int numParses) {
if (createDerivationString) tokens.setDerivation(new StringBuffer(100));
odh.clear();
ndh.clear();
parses.clear();
int i = 0;
int maxDerivationLength = 2 * tokens.getChildCount() + 3;
odh.add(tokens);
Parse guess = null;
double bestComplete = -100000;
while (parses.size() < M && i < maxDerivationLength) {
ndh = new TreeSet();
if (odh.size() > 0) {
int j = 0;
for (Iterator pi = odh.iterator(); pi.hasNext() && j < K; j++) {
Parse tp = (Parse) pi.next();
if (tp.getProb() < bestComplete) {
break;
}
if (guess == null && i == 2) {
guess = tp;
}
if (debugOn) {
System.out.print(i + " " + j + " "+tp.getProb());
tp.show();
System.out.println();
}
Parse[] nd = null;
if (0 == i) {
nd = advanceTags(tp);
}
else if (1 == i) {
if (ndh.size() < K) {
nd = advanceChunks(tp,bestComplete);
}
else {
nd = advanceChunks(tp,((Parse) ndh.last()).getProb());
}
}
else {
nd = advanceParses(tp, Q);
}
if (nd != null) {
for (int k = 0, kl = nd.length; k < kl; k++) {
if (nd[k].complete()) {
advanceTop(nd[k]);
if (nd[k].getProb() > bestComplete) {
bestComplete = nd[k].getProb();
}
parses.add(nd[k]);
}
else {
ndh.add(nd[k]);
}
}
}
else {
if (reportFailedParse) {
System.err.println("Couldn't advance parse "+i+" stage "+j+"!\n");
}
advanceTop(tp);
parses.add(tp);
}
}
i++;
odh = ndh;
}
else {
break;
}
}
if (parses.size() == 0) {
if (reportFailedParse) System.err.println("Couldn't find parse for: " + tokens);
return new Parse[] {guess};
}
else if (numParses == 1){
return new Parse[] {(Parse) parses.first()};
}
else {
List topParses = new ArrayList(numParses);
while(!parses.isEmpty() && topParses.size() < numParses) {
Parse tp = (Parse) parses.first();
topParses.add(tp);
parses.remove(tp);
}
return (Parse[]) topParses.toArray(new Parse[topParses.size()]);
}
} |
/**
* Clean up of the unit test Note: clean up also tests the delete operation of the repository
*/
@After
public void destroyTestData() {
eventRepos.delete(testEventId);
assertNull("deleted test event still exists in the database", eventRepos.findOne(testEventId));
} |
Oncogenes and Tumor Suppressor Genes in Cutaneous Malignant Melanoma
when corrected for hair color, skin type and holidays in sunny resorts. The wavelength dependence of the other steps in carcinogenesis need elucidation. Preliminary data, using mice, indicate that sunscreens give less protection against UVB-induced immune suppression than against the direct formation of DNA damage or skin edema as if the UVA wavelengths in the “UVB light source” were important in immune suppression (16). |
<filename>testing/cmd/bankdemo/db.go
package main
import (
"bytes"
"fmt"
"sync"
"github.com/golang/protobuf/jsonpb"
"github.com/golang/protobuf/ptypes"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
// In-memory database that is periodically saved to a JSON file.
type accounts struct {
AccountNumbersByCustomer map[string][]uint64
AccountsByNumber map[uint64]*account
AccountNumbers []uint64
Customers []string
LastAccountNum uint64
mu sync.RWMutex
}
func (a *accounts) openAccount(customer string, accountType Account_Type, initialBalanceCents int32) *Account {
a.mu.Lock()
defer a.mu.Unlock()
accountNums, ok := a.AccountNumbersByCustomer[customer]
if !ok {
// no accounts for this customer? it's a new customer
a.Customers = append(a.Customers, customer)
}
num := a.LastAccountNum + 1
a.LastAccountNum = num
a.AccountNumbers = append(a.AccountNumbers, num)
accountNums = append(accountNums, num)
a.AccountNumbersByCustomer[customer] = accountNums
var acct account
acct.AccountNumber = num
acct.BalanceCents = initialBalanceCents
acct.Transactions = append(acct.Transactions, &Transaction{
AccountNumber: num,
SeqNumber: 1,
Date: ptypes.TimestampNow(),
AmountCents: initialBalanceCents,
Desc: "initial deposit",
})
a.AccountsByNumber[num] = &acct
return &acct.Account
}
func (a *accounts) closeAccount(customer string, accountNumber uint64) error {
a.mu.Lock()
defer a.mu.Unlock()
acctNums := a.AccountNumbersByCustomer[customer]
found := -1
for i, num := range acctNums {
if num == accountNumber {
found = i
break
}
}
if found == -1 {
return status.Errorf(codes.NotFound, "you have no account numbered %d", accountNumber)
}
acct := a.AccountsByNumber[accountNumber]
if acct.BalanceCents != 0 {
return status.Errorf(codes.FailedPrecondition, "account %d cannot be closed because it has a non-zero balance: %s", accountNumber, dollars(acct.BalanceCents))
}
for i, num := range a.AccountNumbers {
if num == accountNumber {
a.AccountNumbers = append(a.AccountNumbers[:i], a.AccountNumbers[i+1:]...)
break
}
}
a.AccountNumbersByCustomer[customer] = append(acctNums[:found], acctNums[found+1:]...)
delete(a.AccountsByNumber, accountNumber)
return nil
}
func (a *accounts) getAccount(customer string, accountNumber uint64) (*account, error) {
a.mu.RLock()
defer a.mu.RUnlock()
acctNums := a.AccountNumbersByCustomer[customer]
for _, num := range acctNums {
if num == accountNumber {
return a.AccountsByNumber[num], nil
}
}
return nil, status.Errorf(codes.NotFound, "you have no account numbered %d", accountNumber)
}
func (a *accounts) getAllAccounts(customer string) []*Account {
a.mu.RLock()
defer a.mu.RUnlock()
accountNums := a.AccountNumbersByCustomer[customer]
var accounts []*Account
for _, num := range accountNums {
accounts = append(accounts, &a.AccountsByNumber[num].Account)
}
return accounts
}
type account struct {
Account
Transactions []*Transaction
mu sync.RWMutex
}
func (a *account) getTransactions() []*Transaction {
a.mu.RLock()
defer a.mu.RUnlock()
return a.Transactions
}
func (a *account) newTransaction(amountCents int32, desc string) (newBalance int32, err error) {
a.mu.Lock()
defer a.mu.Unlock()
bal := a.BalanceCents + amountCents
if bal < 0 {
return 0, status.Errorf(codes.FailedPrecondition, "insufficient funds: cannot withdraw %s when balance is %s", dollars(amountCents), dollars(a.BalanceCents))
}
a.BalanceCents = bal
a.Transactions = append(a.Transactions, &Transaction{
AccountNumber: a.AccountNumber,
Date: ptypes.TimestampNow(),
AmountCents: amountCents,
SeqNumber: uint64(len(a.Transactions) + 1),
Desc: desc,
})
return bal, nil
}
func (t *Transaction) MarshalJSON() ([]byte, error) {
var jsm jsonpb.Marshaler
var buf bytes.Buffer
if err := jsm.Marshal(&buf, t); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
func (t *Transaction) UnmarshalJSON(b []byte) error {
return jsonpb.Unmarshal(bytes.NewReader(b), t)
}
func (a *accounts) clone() *accounts {
var clone accounts
clone.AccountNumbersByCustomer = map[string][]uint64{}
clone.AccountsByNumber = map[uint64]*account{}
a.mu.RLock()
clone.Customers = a.Customers
a.mu.RUnlock()
for _, cust := range clone.Customers {
var acctNums []uint64
a.mu.RLock()
acctNums = a.AccountNumbersByCustomer[cust]
a.mu.RUnlock()
clone.AccountNumbersByCustomer[cust] = acctNums
clone.AccountNumbers = append(clone.AccountNumbers, acctNums...)
for _, acctNum := range acctNums {
a.mu.RLock()
acct := a.AccountsByNumber[acctNum]
a.mu.RUnlock()
acct.mu.RLock()
txns := acct.Transactions
acct.mu.RUnlock()
clone.AccountsByNumber[acctNum] = &account{Transactions: txns}
}
}
return &clone
}
func dollars(amountCents int32) string {
return fmt.Sprintf("$%02f", float64(amountCents)/100)
}
|
/**
* Fragment for showing tag details.
*/
public class TagDetailsFragment extends Fragment {
private static final String TAG = TagDetailsFragment.class.getSimpleName();
private final List<Subscription> subscriptions = new ArrayList<>();
private KnownTag knownTag;
private TagDetailsViewModel tagDetailsViewModel;
private TextView txtSerialNumber, txtVersion, txtBattery, txtAttached, txtTagStatus,
txtSelectAsCurrentTag, txtForgetTag;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
knownTag = TagDetailsFragmentArgs.fromBundle(getArguments()).getKnownTag();
tagDetailsViewModel =
new ViewModelProvider(
requireActivity(),
new ViewModelFactory(requireActivity().getApplication(), getNavController()))
.get(TagDetailsViewModel.class);
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_tag_details, container, false);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
initToolbar();
initUI(view);
getTagDetails();
showMessageWhenTagIsNotCurrent();
txtSerialNumber.setText(knownTag.pairingSerialNumber());
txtSelectAsCurrentTag.setOnClickListener(v -> {
tagDetailsViewModel
.selectAsCurrentTag(requireActivity(), knownTag,
intentSender -> ((MainActivity) requireActivity())
.startForResult(intentSender, COMPANION_DEVICE_REQUEST)
.map(result -> result.resultCode() == Activity.RESULT_OK));
showSnackBar(getString(R.string.tag_details_tag_selected, knownTag.displayName()));
});
txtForgetTag.setOnClickListener(v -> {
tagDetailsViewModel
.forgetTag(requireActivity(), knownTag, intentSender -> ((MainActivity) requireActivity())
.startForResult(intentSender, COMPANION_DEVICE_REQUEST)
.map(result -> result.resultCode() == Activity.RESULT_OK));
showSnackBar(getString(R.string.tag_details_tag_removed, knownTag.displayName()));
});
}
@Override
public void onDestroyView() {
for (Subscription subscription : subscriptions) {
subscription.unsubscribe();
}
subscriptions.clear();
super.onDestroyView();
}
private void initUI(View view) {
txtSerialNumber = view.findViewById(R.id.serialNumberValueTxt);
txtVersion = view.findViewById(R.id.versionNumberValueTxt);
txtBattery = view.findViewById(R.id.batteryValueTxt);
txtAttached = view.findViewById(R.id.attachStatusTxt);
txtTagStatus = view.findViewById(R.id.tagStatusTxt);
txtSelectAsCurrentTag = view.findViewById(R.id.currentTagTxt);
txtForgetTag = view.findViewById(R.id.forgetTagTxt);
}
private void getFirmwareVersion() {
subscriptions.add(
tagDetailsViewModel.getVersion().observe(version -> {
PrintLogger.d(TAG, "Received device info: " + version.toString());
txtVersion.setText(version.toString());
}, error -> {
if (error == null) {
return;
}
PrintLogger.e(TAG, "getFirmwareVersion: " + error.getMessage());
showSnackBar(error.getMessage());
}));
}
private void getBatteryStatus() {
subscriptions.add(
tagDetailsViewModel.getBatteryStatus()
.observe(notification -> {
PrintLogger.d(TAG, "Received battery status info: " + notification);
onBatteryStatus(notification);
}, error -> {
if (error == null) {
return;
}
PrintLogger.e(TAG, "getBatteryStatus: " + error.getMessage());
showSnackBar(error.getMessage());
}));
}
private void subscribeToNotifications() {
subscriptions.add(
tagDetailsViewModel
.getNotification()
.observe(notification -> {
PrintLogger.d(TAG, "Received notification: " + notification);
switch (notification.getType()) {
case BATTERY:
onBatteryStatus(notification.battery());
break;
case GEAR:
onGearState(notification.gear());
break;
}
}, error -> {
if (error == null) {
return;
}
PrintLogger.e(TAG, "subscribeToNotifications: " + error.getMessage());
showSnackBar(error.getMessage());
}));
}
private void onGearState(GearState gearState) {
if (gearState.getType() == GearState.Type.ATTACHED) {
txtAttached.setText(requireContext()
.getString(R.string.tag_details_tag_attached, gearState.attached().product().name()));
} else {
txtAttached.setText("No");
}
}
private void getTagDetails() {
if (tagDetailsViewModel.checkIfCurrentTag(knownTag)) {
txtAttached.setText("No");
txtTagStatus.setVisibility(View.VISIBLE);
txtSelectAsCurrentTag.setVisibility(View.GONE);
getFirmwareVersion();
getBatteryStatus();
subscribeToNotifications();
} else {
txtSelectAsCurrentTag.setVisibility(View.VISIBLE);
showSnackBar(getString(R.string.tag_details_tag_not_current));
}
}
private void onBatteryStatus(BatteryStatus batteryStatus) {
String chargingStateText =
requireContext()
.getString(
batteryStatus.chargingState() == ChargingState.CHARGING
? R.string.home_page_battery_charge_state_charging
: R.string.home_page_battery_charge_state_not_charging);
txtBattery.setText(
requireContext()
.getString(
R.string.tag_details_battery_info,
String.valueOf(batteryStatus.batteryLevel()),
chargingStateText));
txtTagStatus.setText("Current Tag");
txtTagStatus.setEnabled(true);
}
private void initToolbar() {
Toolbar toolbar = getView().findViewById(R.id.toolbar);
toolbar.setNavigationOnClickListener(v -> {
tagDetailsViewModel.backArrowClick();
});
((TextView)getView().findViewById(R.id.toolbar_title)).setText(knownTag.displayName());
}
private void showSnackBar(String text) {
Util.showSnackBar(getView(), text);
}
private NavController getNavController() {
return NavHostFragment.findNavController(this);
}
private void showMessageWhenTagIsNotCurrent() {
if (tagDetailsViewModel.checkIfCurrentTag(knownTag)) {
PrintLogger.d(TAG, knownTag.identifier() + " is current tag");
return;
}
Util.showSnackBar(getView(), getString(R.string.tag_details_tag_not_current));
}
} |
/**
* edma_resume - resumes dma on a paused channel
* @channel: on which edma_pause() has been called
*
* This re-enables EDMA hardware events on the specified channel.
*/
void edma_resume(unsigned channel)
{
unsigned ctlr;
ctlr = EDMA_CTLR(channel);
channel = EDMA_CHAN_SLOT(channel);
if (channel < edma_info[ctlr]->num_channels) {
unsigned int mask = (1 << (channel & 0x1f));
edma_shadow0_write_array(ctlr, SH_EESR, channel >> 5, mask);
}
} |
class BodyTypes:
""" Enum to represent the different body types """
Static = 0
Kinematic = 1
Dynamic = 2 |
<reponame>IT521/angular-web-components
/* eslint-disable */
/* tslint:disable */
/**
* This is an autogenerated file created by the Stencil compiler.
* It contains typing information for all components that exist in this project.
*/
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
import { SIZE } from "./components/awc-name/awc-name.types";
export namespace Components {
interface AwcButton {
/**
* Button color
*/
"color": 'blue' | 'green' | 'red' | 'black';
/**
* Margin top size
*/
"margin": 'none' | 'xsmall' | 'small' | 'medium' | 'large';
/**
* Button size
*/
"size": 'xsmall' | 'small' | 'medium' | 'large';
/**
* Button text
*/
"text": string;
}
interface AwcName {
/**
* First name
*/
"first": string;
/**
* Greeting
*/
"greeting": string;
/**
* Has Greeting
*/
"hasGreeting": boolean;
/**
* Has size button
*/
"hasSizeButton": boolean;
/**
* Last name
*/
"last": string;
/**
* Middle name
*/
"middle": string;
/**
* Text size
*/
"size": SIZE;
}
}
declare global {
interface HTMLAwcButtonElement extends Components.AwcButton, HTMLStencilElement {
}
var HTMLAwcButtonElement: {
prototype: HTMLAwcButtonElement;
new (): HTMLAwcButtonElement;
};
interface HTMLAwcNameElement extends Components.AwcName, HTMLStencilElement {
}
var HTMLAwcNameElement: {
prototype: HTMLAwcNameElement;
new (): HTMLAwcNameElement;
};
interface HTMLElementTagNameMap {
"awc-button": HTMLAwcButtonElement;
"awc-name": HTMLAwcNameElement;
}
}
declare namespace LocalJSX {
interface AwcButton {
/**
* Button color
*/
"color"?: 'blue' | 'green' | 'red' | 'black';
/**
* Margin top size
*/
"margin"?: 'none' | 'xsmall' | 'small' | 'medium' | 'large';
/**
* Button size
*/
"size"?: 'xsmall' | 'small' | 'medium' | 'large';
/**
* Button text
*/
"text"?: string;
}
interface AwcName {
/**
* First name
*/
"first"?: string;
/**
* Greeting
*/
"greeting"?: string;
/**
* Has Greeting
*/
"hasGreeting"?: boolean;
/**
* Has size button
*/
"hasSizeButton"?: boolean;
/**
* Last name
*/
"last"?: string;
/**
* Middle name
*/
"middle"?: string;
/**
* Text size
*/
"size"?: SIZE;
}
interface IntrinsicElements {
"awc-button": AwcButton;
"awc-name": AwcName;
}
}
export { LocalJSX as JSX };
declare module "@stencil/core" {
export namespace JSX {
interface IntrinsicElements {
"awc-button": LocalJSX.AwcButton & JSXBase.HTMLAttributes<HTMLAwcButtonElement>;
"awc-name": LocalJSX.AwcName & JSXBase.HTMLAttributes<HTMLAwcNameElement>;
}
}
}
|
class _sage_doc:
"""
Open Sage documentation in a web browser, from either the
command-line or the notebook.
- Type "browse_sage_doc.DOCUMENT()" to open the named document --
for example, "browse_sage_doc.tutorial()" opens the tutorial.
Available documents are
- tutorial: the Sage tutorial
- reference: the Sage reference manual
- constructions: "how do I construct ... in Sage?"
- developer: the Sage developer's guide.
- Type "browse_sage_doc(OBJECT, output=FORMAT, view=BOOL)" to view
the documentation for OBJECT, as in
"browse_sage_doc(identity_matrix, 'html'). ``output`` can be
either 'html' or 'rst': the form of the output. ``view`` is
only relevant if ``output`` is ``html``; in this case, if
``view`` is True (its default value), then open up the
documentation in a web browser. Otherwise, just output the
documentation as a string.
EXAMPLES::
sage: browse_sage_doc._open("reference", testing=True)[0] # optional - sagemath_doc_html, indirect doctest
'http://localhost:8000/doc/live/reference/index.html'
sage: browse_sage_doc(identity_matrix, 'rst')[-107:-47] # optional - sagemath_doc_html
'Full MatrixSpace of 3 by 3 sparse matrices over Integer Ring'
"""
def __init__(self):
"""
EXAMPLES::
sage: browse_sage_doc._base_url
'http://localhost:8000/doc/live/'
"""
self._base_url = "http://localhost:8000/doc/live/"
self._base_path = os.path.join(SAGE_DOC, "html", "en")
def __call__(self, obj, output='html', view=True):
r"""
Return the documentation for ``obj``.
INPUT:
- ``obj`` - a Sage object
- ``output`` - 'html', 'rst', or 'text': return documentation in this form
- ``view`` - only has an effect if output is 'html': in this
case, if ``view`` is ``True``, display the documentation in
a web browser. Otherwise, return the documentation as a
string.
EXAMPLES::
sage: browse_sage_doc(identity_matrix, 'rst')
"...**File:**...**Type:**...**Definition:** identity_matrix..."
sage: identity_matrix.__doc__ in browse_sage_doc(identity_matrix, 'rst')
True
sage: browse_sage_doc(identity_matrix, 'html', False) # optional - sphinx
'...div...File:...Type:...Definition:...identity_matrix...'
In the 'text' version, double colons have been replaced with
single ones (among other things)::
sage: '::' in browse_sage_doc(identity_matrix, 'rst')
True
sage: '::' in browse_sage_doc(identity_matrix, 'text') # optional - sphinx
False
"""
if output != 'html' and view:
view = False
s = ''
newline = "\n\n" # blank line to start new paragraph
try:
filename = sageinspect.sage_getfile(obj)
s += '**File:** %s' % filename
s += newline
except TypeError:
pass
obj_name = ''
locs = sys._getframe(1).f_locals
for var in locs:
if id(locs[var]) == id(obj):
obj_name = var
s += '**Type:** %s' % type(obj)
s += newline
s += '**Definition:** %s' % sageinspect.sage_getdef(obj, obj_name)
s += newline
s += '**Docstring:**'
s += newline
s += sageinspect.sage_getdoc(obj, obj_name, embedded=True)
# now s should be the reST version of the docstring
if output == 'html':
try:
from .sphinxify import sphinxify
except ImportError:
from html import escape
html = escape(s)
else:
html = sphinxify(s)
if view:
path = os.path.join(tmp_dir(), "temp.html")
filed = open(path, 'w')
static_path = os.path.join(SAGE_DOC, "html", "en", "_static")
if os.path.exists(static_path):
title = obj_name + ' - Sage ' + sage.version.version + ' Documentation'
template = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>%(title)s</title>
<link rel="stylesheet" href="%(static_path)s/default.css" type="text/css" />
<link rel="stylesheet" href="%(static_path)s/pygments.css" type="text/css" />
<style type="text/css">
<!--
div.body {
margin: 1.0em;
padding: 1.0em;
}
div.bodywrapper {
margin: 0;
}
-->
</style>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '%(version)s',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: false
};
</script>
<script type="text/javascript" src="%(static_path)s/jquery.js"></script>
<script type="text/javascript" src="%(static_path)s/doctools.js"></script>
<script type="text/javascript" src="%(static_path)s/mathjax_sage.js"></script>
<link rel="shortcut icon" href="%(static_path)s/favicon.ico" />
<link rel="icon" href="%(static_path)s/sageicon.png" type="image/x-icon" />
</head>
<body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
%(html)s
</div>
</div>
</div>
</div>
</body>
</html>"""
html = template % { 'html': html,
'static_path': static_path,
'title': title,
'version': sage.version.version }
filed.write(html)
filed.close()
os.system(browser() + " " + path)
else:
return html
elif output == 'rst':
return s
elif output == 'text':
try:
from .sphinxify import sphinxify
except ImportError:
return s
else:
return sphinxify(s, format='text')
else:
raise ValueError("output type {} not recognized".format(output))
def _open(self, name, testing=False):
"""
Open the document ``name`` in a web browser. This constructs
the appropriate URL and/or path name and passes it to the web
browser.
INPUT:
- ``name`` - string, name of the documentation
- ``testing`` - boolean (optional, default False): if True,
then just return the URL and path-name for this document;
don't open the web browser.
EXAMPLES::
sage: browse_sage_doc._open("reference", testing=True)[0] # optional - sagemath_doc_html
'http://localhost:8000/doc/live/reference/index.html'
sage: browse_sage_doc._open("tutorial", testing=True)[1] # optional - sagemath_doc_html
'.../html/en/tutorial/index.html'
"""
url = self._base_url + os.path.join(name, "index.html")
path = os.path.join(self._base_path, name, "index.html")
if not os.path.exists(path):
raise OSError("""The document '{0}' does not exist. Please build it
with 'sage -docbuild {0} html' and try again.""".format(name))
if testing:
return (url, path)
os.system(browser() + " " + path)
def tutorial(self):
"""
The Sage tutorial. To get started with Sage, start here.
EXAMPLES::
sage: tutorial() # indirect doctest, not tested
"""
self._open("tutorial")
def reference(self):
"""
The Sage reference manual.
EXAMPLES::
sage: reference() # indirect doctest, not tested
sage: manual() # indirect doctest, not tested
"""
self._open("reference")
manual = reference
def developer(self):
"""
The Sage developer's guide. Learn to develop programs for Sage.
EXAMPLES::
sage: developer() # indirect doctest, not tested
"""
self._open("developer")
def constructions(self):
"""
Sage constructions. Attempts to answer the question "How do I
construct ... in Sage?"
EXAMPLES::
sage: constructions() # indirect doctest, not tested
"""
self._open("constructions") |
<reponame>po4yka/elementary-education-projects
#include "structLogger.h"
/* ----- STEP-BY-STEP ----- */
void StructLogger::loopLatency() {
qDebug() << "Loop latency for step-by-step STARTED" << endl;
for( ; ; ) {
QApplication::processEvents();
if(stepLoopSwitcher == false) break;
}
qDebug() << "Loop latency for step-by-step ENDED" << endl;
stepLoopSwitcher = true;
}
void StructLogger::disableLoopLatency() {
stepLoopSwitcher = false;
}
void StructLogger::enableLoopLatency() {
stepLoopSwitcher = true;
}
bool StructLogger::getLogMode() const {
return logMode;
}
void StructLogger::setLogMode(bool value) {
logMode = value;
}
bool StructLogger::getStepByStepMode() const {
return stepByStepMode;
}
void StructLogger::setStepByStepMode(bool value) {
stepByStepMode = value;
}
|
<filename>src/Qir/Runtime/lib/QIR/QubitManager.cpp<gh_stars>0
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include "QubitManager.hpp"
#include "QirRuntime.hpp" // For quantum__rt__fail_cstr
#include <cstring> // For memcpy
namespace Microsoft
{
namespace Quantum
{
//
// Failing in case of errors
//
[[noreturn]] static void FailNow(const char* message)
{
__quantum__rt__fail_cstr(message);
}
static void FailIf(bool condition, const char* message)
{
if (condition)
{
__quantum__rt__fail_cstr(message);
}
}
//
// QubitListInSharedArray
//
CQubitManager::QubitListInSharedArray::QubitListInSharedArray(QubitIdType startId, QubitIdType endId,
QubitIdType* sharedQbitStatusArray)
: firstElement(startId)
, lastElement(endId)
{
FailIf(startId > endId || startId < 0 || endId == MaximumQubitCapacity,
"Incorrect boundaries in the linked list initialization.");
FailIf(sharedQbitStatusArray == nullptr, "Shared status array is not provided.");
for (QubitIdType i = startId; i < endId; i++)
{
sharedQbitStatusArray[i] = i + 1; // Current element points to the next element.
}
sharedQbitStatusArray[endId] = NoneMarker; // Last element ends the chain.
}
bool CQubitManager::QubitListInSharedArray::IsEmpty() const
{
return firstElement == NoneMarker;
}
void CQubitManager::QubitListInSharedArray::AddQubit(QubitIdType id, QubitIdType* sharedQbitStatusArray)
{
FailIf(id == NoneMarker, "Incorrect qubit id, cannot add it to the list.");
FailIf(sharedQbitStatusArray == nullptr, "Shared status array is not provided.");
// If the list is empty, we initialize it with the new element.
if (IsEmpty())
{
firstElement = id;
lastElement = id;
sharedQbitStatusArray[id] = NoneMarker; // List with a single elemenet in the chain.
return;
}
sharedQbitStatusArray[id] = firstElement; // The new element will point to the former first element.
firstElement = id; // The new element is now the first in the chain.
}
QubitIdType CQubitManager::QubitListInSharedArray::TakeQubitFromFront(QubitIdType* sharedQbitStatusArray)
{
FailIf(sharedQbitStatusArray == nullptr, "Shared status array is not provided.");
// First element will be returned. It is 'NoneMarker' if the list is empty.
QubitIdType result = firstElement;
// Advance list start to the next element if list is not empty.
if (!IsEmpty())
{
firstElement = sharedQbitStatusArray[firstElement]; // The second element will be the first.
}
// Drop pointer to the last element if list becomes empty.
if (IsEmpty())
{
lastElement = NoneMarker;
}
if (result != NoneMarker)
{
sharedQbitStatusArray[result] = AllocatedMarker;
}
return result;
}
void CQubitManager::QubitListInSharedArray::MoveAllQubitsFrom(QubitListInSharedArray& source,
QubitIdType* sharedQbitStatusArray)
{
FailIf(sharedQbitStatusArray == nullptr, "Shared status array is not provided.");
// No need to do anthing if source is empty.
if (source.IsEmpty())
{
return;
}
if (this->IsEmpty())
{
// If this list is empty, we'll just set it to the source list.
lastElement = source.lastElement;
}
else
{
// Attach source at the beginning of the list if both lists aren't empty.
sharedQbitStatusArray[source.lastElement] = firstElement; // The last element of the source chain will point
// to the first element of this chain.
}
firstElement = source.firstElement; // The first element from the source chain will be
// the first element of this chain.
// Remove all elements from source.
source.firstElement = NoneMarker;
source.lastElement = NoneMarker;
}
//
// RestrictedReuseArea
//
CQubitManager::RestrictedReuseArea::RestrictedReuseArea(QubitListInSharedArray freeQubits)
: FreeQubitsReuseProhibited() // Default costructor
, FreeQubitsReuseAllowed(freeQubits) // Default shallow copy.
{
}
//
// CRestrictedReuseAreaStack
//
void CQubitManager::CRestrictedReuseAreaStack::PushToBack(RestrictedReuseArea area)
{
FailIf(Count() >= std::numeric_limits<int32_t>::max(), "Too many nested restricted reuse areas.");
this->insert(this->end(), area);
}
CQubitManager::RestrictedReuseArea CQubitManager::CRestrictedReuseAreaStack::PopFromBack()
{
FailIf(this->empty(), "Cannot remove restricted reuse area from an empty set.");
RestrictedReuseArea result = this->back();
this->pop_back();
return result;
}
CQubitManager::RestrictedReuseArea& CQubitManager::CRestrictedReuseAreaStack::PeekBack()
{
return this->back();
}
int32_t CQubitManager::CRestrictedReuseAreaStack::Count() const
{
// The size should never exceed int32_t.
return static_cast<int32_t>(this->size());
}
//
// CQubitManager
//
CQubitManager::CQubitManager(QubitIdType initialQubitCapacity, bool mayExtendCap)
: mayExtendCapacity(mayExtendCap)
, qubitCapacity(initialQubitCapacity)
{
FailIf(qubitCapacity <= 0, "Qubit capacity must be positive.");
sharedQubitStatusArray = new QubitIdType[(size_t)qubitCapacity];
// These objects are passed by value (copies are created)
QubitListInSharedArray freeQubitsFresh(0, qubitCapacity - 1, sharedQubitStatusArray);
RestrictedReuseArea outermostArea(freeQubitsFresh);
freeQubitsInAreas.PushToBack(outermostArea);
freeQubitCount = qubitCapacity;
}
CQubitManager::~CQubitManager()
{
if (sharedQubitStatusArray != nullptr)
{
delete[] sharedQubitStatusArray;
sharedQubitStatusArray = nullptr;
}
// freeQubitsInAreas - direct member of the class, no need to delete.
}
// Although it is not necessary to pass area IDs to these functions, such support may be added for extra checks.
void CQubitManager::StartRestrictedReuseArea()
{
FailIf(freeQubitsInAreas.Count() <= 0, "Internal error! No reuse areas.");
RestrictedReuseArea areaAboutToBegin;
RestrictedReuseArea& currentArea = freeQubitsInAreas.PeekBack();
if (currentArea.FreeQubitsReuseAllowed.IsEmpty())
{
areaAboutToBegin.prevAreaWithFreeQubits = currentArea.prevAreaWithFreeQubits;
}
else
{
areaAboutToBegin.prevAreaWithFreeQubits = freeQubitsInAreas.Count() - 1;
}
freeQubitsInAreas.PushToBack(areaAboutToBegin);
}
void CQubitManager::NextRestrictedReuseSegment()
{
FailIf(freeQubitsInAreas.Count() <= 0, "Internal error! No reuse areas.");
FailIf(freeQubitsInAreas.Count() == 1, "NextRestrictedReuseSegment() without an active area.");
RestrictedReuseArea& currentArea = freeQubitsInAreas.PeekBack();
// When new segment starts, reuse of all free qubits in the current area becomes prohibited.
currentArea.FreeQubitsReuseProhibited.MoveAllQubitsFrom(currentArea.FreeQubitsReuseAllowed,
sharedQubitStatusArray);
}
void CQubitManager::EndRestrictedReuseArea()
{
FailIf(freeQubitsInAreas.Count() < 2, "EndRestrictedReuseArea() without an active area.");
RestrictedReuseArea areaAboutToEnd = freeQubitsInAreas.PopFromBack();
RestrictedReuseArea& containingArea = freeQubitsInAreas.PeekBack();
if (areaAboutToEnd.prevAreaWithFreeQubits < containingArea.prevAreaWithFreeQubits)
{
containingArea.prevAreaWithFreeQubits = areaAboutToEnd.prevAreaWithFreeQubits;
}
// When area ends, reuse of all free qubits from this area becomes allowed.
containingArea.FreeQubitsReuseAllowed.MoveAllQubitsFrom(areaAboutToEnd.FreeQubitsReuseProhibited,
sharedQubitStatusArray);
containingArea.FreeQubitsReuseAllowed.MoveAllQubitsFrom(areaAboutToEnd.FreeQubitsReuseAllowed,
sharedQubitStatusArray);
}
QubitIdType CQubitManager::Allocate()
{
QubitIdType newQubitId = AllocateQubitId();
FailIf(newQubitId == NoneMarker, "Not enough qubits.");
return newQubitId;
}
void CQubitManager::Allocate(QubitIdType* qubitsToAllocate, int32_t qubitCountToAllocate)
{
if (qubitCountToAllocate == 0)
{
return;
}
FailIf(qubitCountToAllocate < 0, "Cannot allocate negative number of qubits.");
FailIf(qubitsToAllocate == nullptr, "No array provided for qubits to be allocated.");
// Consider optimization for initial allocation of a large array at once
for (int32_t i = 0; i < qubitCountToAllocate; i++)
{
QubitIdType newQubitId = AllocateQubitId();
if (newQubitId == NoneMarker)
{
for (QubitIdType k = 0; k < i; k++)
{
Release(qubitsToAllocate[k]);
}
FailNow("Not enough qubits.");
}
qubitsToAllocate[i] = newQubitId;
}
}
void CQubitManager::Release(QubitIdType qubit)
{
FailIf(!IsValidQubit(qubit), "Qubit is not valid.");
ReleaseQubitId(qubit);
}
void CQubitManager::Release(QubitIdType* qubitsToRelease, int32_t qubitCountToRelease)
{
if (qubitCountToRelease == 0)
{
return;
}
FailIf(qubitsToRelease == nullptr, "No array provided with qubits to be released.");
for (int32_t i = 0; i < qubitCountToRelease; i++)
{
Release(qubitsToRelease[i]);
qubitsToRelease[i] = NoneMarker;
}
}
QubitIdType CQubitManager::Borrow()
{
// We don't support true borrowing/returning at the moment.
return Allocate();
}
void CQubitManager::Borrow(QubitIdType* qubitsToBorrow, int32_t qubitCountToBorrow)
{
// We don't support true borrowing/returning at the moment.
return Allocate(qubitsToBorrow, qubitCountToBorrow);
}
void CQubitManager::Return(QubitIdType qubit)
{
// We don't support true borrowing/returning at the moment.
Release(qubit);
}
void CQubitManager::Return(QubitIdType* qubitsToReturn, int32_t qubitCountToReturn)
{
// We don't support true borrowing/returning at the moment.
Release(qubitsToReturn, qubitCountToReturn);
}
void CQubitManager::Disable(QubitIdType qubit)
{
FailIf(!IsValidQubit(qubit), "Qubit is not valid.");
// We can only disable explicitly allocated qubits that were not borrowed.
FailIf(!IsExplicitlyAllocatedId(qubit), "Cannot disable qubit that is not explicitly allocated.");
sharedQubitStatusArray[qubit] = DisabledMarker;
disabledQubitCount++;
FailIf(disabledQubitCount <= 0, "Incorrect disabled qubit count.");
allocatedQubitCount--;
FailIf(allocatedQubitCount < 0, "Incorrect allocated qubit count.");
}
void CQubitManager::Disable(QubitIdType* qubitsToDisable, int32_t qubitCountToDisable)
{
if (qubitCountToDisable == 0)
{
return;
}
FailIf(qubitsToDisable == nullptr, "No array provided with qubits to be disabled.");
for (int32_t i = 0; i < qubitCountToDisable; i++)
{
Disable(qubitsToDisable[i]);
}
}
bool CQubitManager::IsValidId(QubitIdType id) const
{
return (id >= 0) && (id < qubitCapacity);
}
bool CQubitManager::IsDisabledId(QubitIdType id) const
{
return sharedQubitStatusArray[id] == DisabledMarker;
}
bool CQubitManager::IsExplicitlyAllocatedId(QubitIdType id) const
{
return sharedQubitStatusArray[id] == AllocatedMarker;
}
bool CQubitManager::IsFreeId(QubitIdType id) const
{
return sharedQubitStatusArray[id] >= 0;
}
bool CQubitManager::IsValidQubit(QubitIdType qubit) const
{
return IsValidId(qubit);
}
bool CQubitManager::IsDisabledQubit(QubitIdType qubit) const
{
return IsValidQubit(qubit) && IsDisabledId(qubit);
}
bool CQubitManager::IsExplicitlyAllocatedQubit(QubitIdType qubit) const
{
return IsValidQubit(qubit) && IsExplicitlyAllocatedId(qubit);
}
bool CQubitManager::IsFreeQubitId(QubitIdType id) const
{
return IsValidId(id) && IsFreeId(id);
}
void CQubitManager::EnsureCapacity(QubitIdType requestedCapacity)
{
FailIf(requestedCapacity <= 0, "Requested qubit capacity must be positive.");
if (requestedCapacity <= qubitCapacity)
{
return;
}
// We need to reallocate shared status array, but there's no need to adjust
// existing values (NonMarker or indexes in the array).
// Prepare new shared status array
auto* newStatusArray = new QubitIdType[(size_t)requestedCapacity];
memcpy(newStatusArray, sharedQubitStatusArray, (size_t)qubitCapacity * sizeof(newStatusArray[0]));
QubitListInSharedArray newFreeQubits(qubitCapacity, requestedCapacity - 1, newStatusArray);
// Set new data. All fresh new qubits are added to the free qubits in the outermost area.
freeQubitCount += requestedCapacity - qubitCapacity;
FailIf(freeQubitCount <= 0, "Incorrect free qubit count.");
delete[] sharedQubitStatusArray;
sharedQubitStatusArray = newStatusArray;
qubitCapacity = requestedCapacity;
freeQubitsInAreas[0].FreeQubitsReuseAllowed.MoveAllQubitsFrom(newFreeQubits, sharedQubitStatusArray);
}
QubitIdType CQubitManager::TakeFreeQubitId()
{
// First we try to take qubit from the current (innermost) area.
QubitIdType id = freeQubitsInAreas.PeekBack().FreeQubitsReuseAllowed.TakeQubitFromFront(sharedQubitStatusArray);
// Then, if no free qubits available for reuse, we scan outer areas (if they exist).
if (id == NoneMarker && freeQubitsInAreas.Count() >= 2)
{
int32_t areaIndex = freeQubitsInAreas.Count() - 1;
do
{
areaIndex = freeQubitsInAreas[(size_t)areaIndex].prevAreaWithFreeQubits;
id = freeQubitsInAreas[(size_t)areaIndex].FreeQubitsReuseAllowed.TakeQubitFromFront(
sharedQubitStatusArray);
} while ((areaIndex != 0) && (id == NoneMarker));
// We remember previous area where a free qubit was found or 0 if none were found.
freeQubitsInAreas.PeekBack().prevAreaWithFreeQubits = areaIndex;
}
if (id != NoneMarker)
{
FailIf(id < 0 || id >= qubitCapacity, "Internal Error: Allocated invalid qubit.");
allocatedQubitCount++;
FailIf(allocatedQubitCount <= 0, "Incorrect allocated qubit count.");
freeQubitCount--;
FailIf(freeQubitCount < 0, "Incorrect free qubit count.");
}
return id;
}
QubitIdType CQubitManager::AllocateQubitId()
{
QubitIdType newQubitId = TakeFreeQubitId();
if (newQubitId == NoneMarker && mayExtendCapacity)
{
QubitIdType newQubitCapacity = qubitCapacity * 2;
FailIf(newQubitCapacity <= qubitCapacity, "Cannot extend capacity.");
EnsureCapacity(newQubitCapacity);
newQubitId = TakeFreeQubitId();
}
return newQubitId;
}
void CQubitManager::ReleaseQubitId(QubitIdType id)
{
FailIf(id < 0 || id >= qubitCapacity, "Internal Error: Cannot release an invalid qubit.");
if (IsDisabledId(id))
{
// Nothing to do. Qubit will stay disabled.
return;
}
FailIf(!IsExplicitlyAllocatedId(id), "Attempt to free qubit that has not been allocated.");
// Released qubits are added to reuse area/segment in which they were released
// (rather than area/segment where they are allocated).
// Although counterintuitive, this makes code simple.
// This is reasonable because qubits should be allocated and released in the same segment. (This is not
// enforced)
freeQubitsInAreas.PeekBack().FreeQubitsReuseAllowed.AddQubit(id, sharedQubitStatusArray);
freeQubitCount++;
FailIf(freeQubitCount <= 0, "Incorrect free qubit count.");
allocatedQubitCount--;
FailIf(allocatedQubitCount < 0, "Incorrect allocated qubit count.");
}
} // namespace Quantum
} // namespace Microsoft
|
/**
* Retrieve person info through MatchIt
*
* Returns (unofficial) person information, this method returns the best match from the query parameters served. The information is delievered by Matchit. Valid query parameter combinations: name + dateOfBirth, name + socialSec, name + address, phonenumber
*/
@Test
public void retrievePersonInfoThroughMatchitTest() throws IdfyException, Exception {
String name = new String("123");
String socialSec = new String("123");
String dateOfBirth = new String("123");
String phonenumber = new String("123");
String address = new String("123");
PersonPersonInformation response = api.retrievePersonInfoThroughMatchit(name, socialSec, dateOfBirth, phonenumber, address);
assertNotNull(response);
} |
def format_input(self, *args, **kwargs):
input_type = kwargs.get('type', self.STR)
if input_type not in self.types:
raise InvalidInputType(input_type)
options = kwargs.get('options', None)
render_options = kwargs.get('render_options', True)
default = str(kwargs.get('default', ''))
condition = str(kwargs.get('condition', ''))
max_digits = self._to_int(kwargs.get('max_digits', None))
max_decimals = self._to_int(kwargs.get('max_decimals', None))
text, flags = '', ''
if len(args) == 0:
args = [text, flags]
elif len(args) == 1:
text = args[0]
else:
text, flags = args[0], args[1]
options = self._normalize_options(options, input_type)
valid_value = False
result = None
while not valid_value:
render_options = self._render_options(options, input_type, default, render_options)
result = str(
input(
self.get_formatted_text(*args, **kwargs)
+ self.get_formatted_text(render_options, flags)
)
)
if result == '':
result = default
if input_type == self.BOOL:
result, valid_value = self.check_boolean(result, options, condition)
elif input_type == self.INT:
result, valid_value = self.check_integer(result, condition, max_digits)
elif input_type == self.FLOAT:
result, valid_value = self.check_float(result, condition, max_digits, max_decimals)
else:
result, valid_value = self.check_string(result, options, condition)
return result |
#include <iostream>
#include <vector>
#include <limits>
int main()
{
int n;
std::cin >> n;
std::vector<long long> v(n);
for (int i = 0; i < n; ++i)
{
long long l;
std::cin >> l;
v[i] = l;
}
long long min = std::numeric_limits<long long>::max();
long long max = 0;
long long sum = 0;
for (auto l : v)
{
sum += l;
if (l > max) max = l;
if (l < min) min = l;
}
sum -= max;
long long la = max - sum + 1;
std::cout << la << std::endl;
}
|
A Supervised Classification of Children with Fragile X Syndrome and Controls Based on Kinematic and sEMG Parameters
Fragile X syndrome (FXS) is caused by pathologic expansions of the CGG repeat polymorphic region of the FMR1 gene. There are two main categories of FMR1 mutations, “premutation” and “full mutation”, that are associated with different clinical phenotypes, and somatic mosaicism can represent a strong FXS phenotype modulator. FXS is the leading cause of inherited intellectual disability and autism, and it is characterized by musculoskeletal manifestations such as flexible flat feet, joint laxity and hypotonia. The former have been associated with altered joint kinematics and muscle activity during gait. The aim of this study was to use gait analysis parameters to classify FXS children from healthy controls and, within FXS children with full mutation, to classify children with mosaicism. Seven supervised machine learning algorithms were applied to a dataset of joint kinematics and surface electromyographic signals collected on twenty FXS children and sixteen controls. Results showed that the k-NN algorithm outperformed in terms of accuracy (100%) in classifying FXS children from controls, while CN2 rule induction obtained the best accuracy (97%) in classifying FXS children with mosaicism. The proposed pipeline might be used for developing assisted decision-making systems aiming at identifying and treating the musculoskeletal alterations associated with FXS. |
Savers could be forced to pay inheritance tax while they are still alive, under a new drive against tax avoidance planned by the Government.
Ministers want to stop wealthy people benefiting from complicated schemes that allow them to dramatically reduce the amount they will owe after their death.
Under plans put out for consultation, HM Revenue & Customs would have powers to subject people minimising inheritance tax to “accelerated payment” laws, meaning they would be forced to pay up front if officials suspect them of using new schemes to avoid tax.
Experts have warned that under the rules, taxpayers will be treated as “guilty until proven innocent”.
Ministers are concerned that growing numbers of people are setting up trusts to shield their estates from inheritance tax.
These are established to effectively remove assets from their owners’ estates while they are alive so that, on their death, tax does not apply.
Different assets can be held in a trust, including property, financial assets such as shares and insurance policies that will pay out on death.
Unlike outright gifts, trusts allow donors to retain control of the assets so that their adult children or other beneficiaries cannot immediately spend the money.
The new rules will only apply to trusts the taxman believes are being used to avoid tax. However, there will be concerns that innocent people could be investigated and made to pay large sums before they are able to defend themselves.
The Telegraph disclosed in June that the number of families being hit with inheritance tax bills will rise by one third this year.
Treasury forecasts suggest that rising house prices and the recovering economy will push tens of thousands more people over the £325,000 threshold for paying the duty.
David Cameron under pressure to raise inheritance tax threshold
The latest disclosures will intensify pressure on David Cameron to make a manifesto commitment to raise the inheritance tax threshold.
The Tories pledged to raise the threshold from £325,000 to £1 million at the last election but the policy, which was credited with forcing Gordon Brown to delay plans for an early election, was abandoned after opposition by the Liberal Democrats.
Inheritance tax is levied at a rate of 40 per cent on the value of an estate above the threshold. Economists, tax experts and Tory MPs have called for reform of the tax, warning that it predominantly hits middle-class families. The new drive is the latest government intervention following a series of high-profile cases involving celebrities, including Gary Barlow, the Take That singer.
People accused of using avoidance schemes will be made to pay their tax up front while HMRC and the courts decide whether or not the arrangements are legal.
Experts have warned that it will lead to tens of thousands of potentially innocent people being forced to pay their taxes before they are due.
HMRC made clear that it does not want the new laws to affect trusts or schemes that “are used legitimately in many arrangements by the vast majority of people”.
Many of the schemes targeted are offshore trust arrangements. A spokesman for HMRC said “very small numbers” of wealthy people would be affected, with the focus on those who had taken “deliberate” action to avoid tax.
Nearly 3,500 tax avoidance schemes have been uncovered in the past decade, according to official figures.
Stuart Phillips, of the Private Office, a tax planning firm, said: “The concern is that the Revenue takes a highly aggressive stance, just like with the film schemes for which celebrities have been under scrutiny, and terrifies families who have been engaging in legitimate tax planning that has been used for many years.
“I’m apprehensive that large-scale action could have unintended consequences.”
[email protected]
- How to protect your wealth from the taxman: see updates in our weekly newsletter
Calculator: Calculate your inheritance tax bill with the Telegraph Inheritance Tax calculator |
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* vim: set ts=8 sts=2 et sw=2 tw=80:
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "gdb-tests.h"
#include "vm/Stack.h"
namespace js {
void GDBTestInitInterpreterRegs(InterpreterRegs& regs,
js::InterpreterFrame* fp_, JS::Value* sp,
uint8_t* pc) {
regs.fp_ = fp_;
regs.sp = sp;
regs.pc = pc;
}
void GDBTestInitAbstractFramePtr(AbstractFramePtr& frame,
InterpreterFrame* ptr) {
MOZ_ASSERT((uintptr_t(ptr) & AbstractFramePtr::TagMask) == 0);
frame.ptr_ = uintptr_t(ptr) | AbstractFramePtr::Tag_InterpreterFrame;
}
void GDBTestInitAbstractFramePtr(AbstractFramePtr& frame,
jit::BaselineFrame* ptr) {
MOZ_ASSERT((uintptr_t(ptr) & AbstractFramePtr::TagMask) == 0);
frame.ptr_ = uintptr_t(ptr) | AbstractFramePtr::Tag_BaselineFrame;
}
void GDBTestInitAbstractFramePtr(AbstractFramePtr& frame,
jit::RematerializedFrame* ptr) {
MOZ_ASSERT((uintptr_t(ptr) & AbstractFramePtr::TagMask) == 0);
frame.ptr_ = uintptr_t(ptr) | AbstractFramePtr::Tag_RematerializedFrame;
}
void GDBTestInitAbstractFramePtr(AbstractFramePtr& frame,
wasm::DebugFrame* ptr) {
MOZ_ASSERT((uintptr_t(ptr) & AbstractFramePtr::TagMask) == 0);
frame.ptr_ = uintptr_t(ptr) | AbstractFramePtr::Tag_WasmDebugFrame;
}
} // namespace js
FRAGMENT(Interpreter, Regs) {
struct FakeFrame {
js::InterpreterFrame frame;
JS::Value slot0;
JS::Value slot1;
JS::Value slot2;
} fakeFrame;
uint8_t fakeOpcode = uint8_t(JSOp::True);
js::InterpreterRegs regs;
js::GDBTestInitInterpreterRegs(regs, &fakeFrame.frame, &fakeFrame.slot2,
&fakeOpcode);
breakpoint();
use(regs);
}
FRAGMENT(Interpreter, AbstractFramePtr) {
js::AbstractFramePtr ifptr;
GDBTestInitAbstractFramePtr(ifptr,
(js::InterpreterFrame*)uintptr_t(0x8badf00));
js::AbstractFramePtr bfptr;
GDBTestInitAbstractFramePtr(bfptr,
(js::jit::BaselineFrame*)uintptr_t(0xbadcafe0));
js::AbstractFramePtr rfptr;
GDBTestInitAbstractFramePtr(
rfptr, (js::jit::RematerializedFrame*)uintptr_t(0xdabbad00));
js::AbstractFramePtr sfptr;
GDBTestInitAbstractFramePtr(sfptr,
(js::wasm::DebugFrame*)uintptr_t(0xcb98ad00));
breakpoint();
use(ifptr);
use(bfptr);
use(rfptr);
use(sfptr);
}
|
print('\033[33m-=-\033[m' * 20)
print('\033[33m************* Progressão aritmética(while) *************\033[m')
print('\033[33m-=-\033[m' * 20)
p = int(input('Insira o primeiro valor de uma PA: '))
r = int(input('Insira a razão da PA: '))
t = p
c = 1
while c <= 10:
print('{} →' .format(t), end=' ')
t += r
c += 1
print('Fim')
|
<gh_stars>0
{-# LANGUAGE RecordWildCards #-}
module FileDirectory where
import System.Directory(Permissions)
import Control.Monad.Cont (forM_)
import System.FilePath.Posix
import Data.List (isPrefixOf)
import Control.Monad.State (StateT)
import Control.Monad.Except (Except)
import qualified Data.ByteString.Char8 as BS
import Data.Time
import Utils
type TreeMonad = (StateT (FilesTree, FilePath) (Except String))
data FilesTree
-- | 'File' constructor implement file type object
= File { -- | 'path' field stores full path to 'File'
path :: FilePath,
-- | 'fileData' stores text of 'File' in 'ByteString'
fileData :: BS.ByteString,
-- | 'fileInfo' stores 'File' information
fileInfo :: FileInfo
}
-- | 'Dir' constructor implement folder type object
| Dir { -- | 'path' field stores full path to 'Dir'
path :: FilePath,
-- | 'children' field stores 'Dir' content
children :: [FilesTree],
-- | 'dirInfo' field stores 'Dir' information
dirInfo :: DirInfo
}
-- | 'CVS' constructor implement cvs file type object
| CVS { -- | 'path' field stores full path to 'CVS'
path :: FilePath,
-- | versionsInfo field stores 'CVS' file content
versionsInfo :: [CVSInfo]
} deriving (Eq, Show)
data CVSInfo
-- | 'CVSInfo' constructor implement cvs file information
= CVSInfo { -- | 'curPath' field stores full path to file at 'CVSInfo'
curPath :: FilePath,
-- | 'listFiles' field stores list of versions file
listFiles :: [(String, BS.ByteString)]
} deriving (Eq, Show)
data FileInfo
-- | 'FileInfo' constructor implement file information
= FileInfo { -- | 'filePath' field stores full path to file
filePath :: FilePath,
-- | 'filePerm' field stores full permissions of file
filePerm :: Permissions,
-- | 'ext' field stores type of file
ext :: String,
-- | 'fileTime' field stores file's last modification time
fileTime :: String,
-- | 'fileSize' field stores file size in Bytes
fileSize :: Int
} deriving (Eq, Show)
data DirInfo
-- | 'DirInfo' constructor implement folder information
= DirInfo { -- | 'dirPath' field stores full path to folder
dirPath :: FilePath,
-- | 'dirPerm' field stores full permissions of folder
dirPerm :: Permissions,
-- | 'dirSize' field stores folder size in Bytes
dirSize :: Int,
-- | 'dirCount' field stores count files at folder
dirCount :: Int
} deriving (Eq, Show)
-- | 'updateFileInfo' function update input 'FileInfo' with new time and text
updateFileInfo :: FileInfo -> UTCTime -> BS.ByteString -> FileInfo
updateFileInfo oldInfo curTime newText = oldInfo { fileTime = show curTime
, fileSize = BS.length newText
}
-- | 'getCountFiles' function returns count of files in folder content
getCountFiles :: [FilesTree] -> Int
getCountFiles = foldr (\ tree res -> getFilesInside tree + res) 0
where
getFilesInside :: FilesTree -> Int
getFilesInside File{..} = 1
getFilesInside Dir{..} = getCountFiles children
getFilesInside _ = 0
-- | 'updateDirInfo' function update folder info with new content
updateDirInfo :: DirInfo -> [FilesTree] -> DirInfo
updateDirInfo oldInfo children = oldInfo { dirSize = getDirSize children
, dirCount = getCountFiles children
}
-- | 'getDirSize' function returns size of folder content
getDirSize :: [FilesTree] -> Int
getDirSize = foldr (\ tree res -> res + getTreeSize tree) 0
-- | 'getTreeSize' function returns size of 'FilesTree'
getTreeSize :: FilesTree -> Int
getTreeSize Dir{..} = getDirSize children
getTreeSize File{..} = fileSize fileInfo
getTreeSize _ = 0
getTreePerm :: FilesTree -> Permissions
getTreePerm Dir{..} = dirPerm dirInfo
getTreePerm File{..} = filePerm fileInfo
getTreePerm _ = undefined
isDir :: FilesTree -> Bool
isDir Dir{..} = True
isDir _ = False
isFile :: FilesTree -> Bool
isFile File{..} = True
isFile _ = False
isTree :: FilesTree -> Bool
isTree CVS{..} = False
isTree _ = True
isCVS :: FilesTree -> Bool
isCVS = not . isTree
getTreeName :: FilesTree -> FilePath
getTreeName Dir{..} = takeBaseName path
getTreeName File{..} = takeFileName path
getTreeName CVS{..} = "cvs"
getCurrentTree :: FilesTree -> FilePath -> FilesTree
getCurrentTree curTree@Dir{..} fPath
| path == fPath = curTree
| otherwise = getNext fPath children
getCurrentTree _ _ = undefined
-- executable tree functions
-- | 'addToTree' function adds new 'FilesTree' to file system
addToTree :: (FilesTree, FilePath) -> FilesTree -> FilesTree
addToTree (curTree, curDir) file
| path curTree == curDir =
do
let newChildren = children curTree ++ [file]
curTree { children = newChildren
, dirInfo = updateDirInfo (dirInfo curTree) newChildren
}
| isDir curTree && path curTree `isPrefixOf` curDir =
do
let newChildren = map (\ child -> addToTree (child, curDir) file) (children curTree)
curTree { children = newChildren
, dirInfo = updateDirInfo (dirInfo curTree) newChildren
}
| otherwise = curTree
-- | 'addCVS' function initialize new cvs 'FilesTree' to file system
addCVS :: (FilesTree, FilePath) -> FilesTree -> FilesTree
addCVS (curTree, curDir) cvs
| path curTree == curDir =
do
let newChildren = children curTree ++ [cvs]
curTree { children = newChildren }
| isDir curTree && path curTree `isPrefixOf` curDir =
do
let newChildren = map (\ child -> addCVS (child, curDir) cvs) (children curTree)
curTree { children = newChildren }
| otherwise = curTree
-- | 'removeFromTree' function remove 'FilesTree' from file system
removeFromTree :: (FilesTree, FilePath) -> FilePath -> FilesTree
removeFromTree (curTree, curDir) file
| path curTree == curDir =
do
let newChildren = removeChild file (children curTree)
curTree { children = newChildren
, dirInfo = updateDirInfo (dirInfo curTree) newChildren
}
| isDir curTree && path curTree `isPrefixOf` curDir =
do
let newChildren = map (\child -> removeFromTree (child, curDir) file) (children curTree)
curTree { children = newChildren
, dirInfo = updateDirInfo (dirInfo curTree) newChildren
}
| otherwise = curTree
where
removeChild :: FilePath -> [FilesTree] -> [FilesTree]
removeChild _ [] = []
removeChild x (y:ys) | x == path y = removeChild x ys
| otherwise = y : removeChild x ys
-- | 'addCVSFile' function add new cvs 'FilesTree' to file system
addCVSFile :: (FilesTree, FilePath) -> FilePath -> FilesTree
addCVSFile (curTree, curDir) file
| path curTree == curDir =
do
let curFileData = getFileData file (children curTree)
let newChildren = addFile curFileData file (children curTree)
curTree { children = newChildren }
| isDir curTree && path curTree `isPrefixOf` curDir =
do
let newChildren = map (\child -> addCVSFile (child, curDir) file) (children curTree)
curTree { children = newChildren }
| otherwise = curTree
where
addFile :: BS.ByteString -> FilePath -> [FilesTree] -> [FilesTree]
addFile _ _ [] = []
addFile curFileData curPath (x:xs)
| isCVS x = (x {versionsInfo = versionsInfo x
++
[CVSInfo
{curPath = getCVSFileName x curPath,
listFiles = [("initial", curFileData)]}]})
: xs
| otherwise = x:addFile curFileData curPath xs
-- | 'removeCVSFile' function remove cvs 'FilesTree' from file system
removeCVSFile :: (FilesTree, FilePath) -> FilePath -> FilesTree
removeCVSFile (curTree, curDir) file
| path curTree == curDir =
do
let newChildren = removeFile file (children curTree)
curTree { children = newChildren }
| isDir curTree && path curTree `isPrefixOf` curDir =
do
let newChildren = map (\child -> removeCVSFile (child, curDir) file) (children curTree)
curTree { children = newChildren }
| otherwise = curTree
where
removeFile :: FilePath -> [FilesTree] -> [FilesTree]
removeFile _ [] = []
removeFile fPath (x:xs)
| isCVS x = (x {versionsInfo = remCVSFile (getCVSFileName x fPath) (versionsInfo x)}): xs
| otherwise = x:removeFile fPath xs
remCVSFile :: FilePath -> [CVSInfo] -> [CVSInfo]
remCVSFile _ [] = []
remCVSFile rPath (y:ys)
| curPath y == rPath = ys
| otherwise = y:remCVSFile rPath ys
-- | 'getFileData' function get file content
getFileData :: FilePath -> [FilesTree] -> BS.ByteString
getFileData _ [] = BS.empty
getFileData curPath (x:xs)
| curPath == path x = fileData x
| otherwise = getFileData curPath xs
-- | 'showTreeInfo' function return 'FilesTree' information
showTreeInfo :: FilesTree -> FilePath -> BS.ByteString
showTreeInfo curTree curPath
| path curTree == curPath =
BS.concat $ map BS.pack (printInfo curTree)
| isDir curTree && path curTree `isPrefixOf` curPath =
BS.concat $ map (`showTreeInfo` curPath) (children curTree)
| otherwise = BS.empty
where
printInfo :: FilesTree -> [String]
printInfo Dir{..} = do
let size = dirSize dirInfo
[ "Directory path: " ++ dirPath dirInfo ++ "\n"
, "Directory size: " ++ show size
++ " Byte" ++ (if size > 1 then "s\n" else "\n")
, "Count files: " ++ show (dirCount dirInfo) ++ "\n"
, show (dirPerm dirInfo) ++ "\n"
]
printInfo File{..} = do
let size = fileSize fileInfo
let formatType = if ext fileInfo == "" then
"File has no format\n"
else
"Format type: " ++ ext fileInfo ++ "\n"
[ "File path: " ++ filePath fileInfo ++ "\n"
, "File size: " ++ show size
++ " Byte" ++ (if size > 1 then "s\n" else "\n")
, formatType
, "File last modified time: " ++ show (fileTime fileInfo) ++ "\n"
, show (filePerm fileInfo) ++ "\n"
]
printInfo _ = []
-- | 'modifyFile' function modify file with new content in file system
modifyFile :: UTCTime -> (FilesTree, FilePath) -> FilePath -> String -> FilesTree
modifyFile curTime (curTree, curDir) file text
| path curTree == file =
do
let newText = addStrToBS text (fileData curTree)
curTree { fileData = newText
, fileInfo = updateFileInfo (fileInfo curTree) curTime newText
}
| isDir curTree && path curTree `isPrefixOf` curDir =
do
let newChildren = map (\child -> modifyFile curTime (child, curDir) file text) (children curTree)
curTree { children = newChildren
, dirInfo = updateDirInfo (dirInfo curTree) newChildren
}
| otherwise = curTree
findCVSDir :: (FilesTree, FilePath) -> FilePath -> String -> FilesTree
findCVSDir (curTree, curPath) fPath versionName
| curPath == path curTree = modifyCVSFile curTree fPath versionName
| isDir curTree && path curTree `isPrefixOf` curPath =
do
let newChildren = map (\child -> findCVSDir (child, curPath) fPath versionName) (children curTree)
curTree { children = newChildren }
| otherwise = curTree
openCVSVersion :: [FilesTree] -> FilePath -> String -> BS.ByteString
openCVSVersion children rPath versionName = BS.concat $ map (`openVersionInfo` rPath) children
where
openVersionInfo :: FilesTree -> FilePath -> BS.ByteString
openVersionInfo curTree fPath
| isCVS curTree = BS.concat $ map (\cur -> openVersion cur (getCVSFileName curTree fPath)) (versionsInfo curTree)
| otherwise = BS.empty
openVersion :: CVSInfo -> FilePath -> BS.ByteString
openVersion cur fPath
| curPath cur == fPath = BS.concat $ map (\pr -> if fst pr == versionName then snd pr else BS.empty) (listFiles cur)
| otherwise = BS.empty
modifyCVSFile :: FilesTree -> FilePath -> String -> FilesTree
modifyCVSFile curTree file versionName =
do
let curData = getFileData file (children curTree)
curTree { children = modifyCVSChildren (versionName, curData) file (children curTree) }
modifyCVSChildren :: (String, BS.ByteString) -> FilePath -> [FilesTree] -> [FilesTree]
modifyCVSChildren _ _ [] = []
modifyCVSChildren version curFilePath (x:xs)
| isCVS x = (x {versionsInfo = addFileVersion version (getCVSFileName x curFilePath) (versionsInfo x) }):xs
| otherwise = x : modifyCVSChildren version curFilePath xs
where
addFileVersion :: (String, BS.ByteString) -> FilePath -> [CVSInfo] -> [CVSInfo]
addFileVersion version fPath [] = []
addFileVersion version fPath (y:ys)
| curPath y == fPath = (y {listFiles = listFiles y ++ [version]}):ys
| otherwise = y : addFileVersion version fPath ys
getNext :: FilePath -> [FilesTree] -> FilesTree
getNext fPath (next:xs) = if isDir next && isPrefixOf (path next) fPath
then
getCurrentTree next fPath
else
getNext fPath xs
getNext _ [] = undefined
-- | 'hasNext' function returns 'FilesTree' from list with current path
hasNext :: FilePath -> [FilesTree] -> Maybe FilesTree
hasNext _ [] = Nothing
hasNext fPath (tr:xs) = if path tr == fPath
then Just tr
else hasNext fPath xs
getCVSFileName :: FilesTree -> FilePath -> FilePath
getCVSFileName x curPath = path x ++ "/" ++ takeFileName curPath
hasCVSFile :: FilePath -> [FilesTree] -> Bool
hasCVSFile _ [] = False
hasCVSFile curFilePath (x:xs)
| isCVS x = hasFileInCVS (getCVSFileName x curFilePath) (versionsInfo x)
| otherwise = hasCVSFile curFilePath xs
where
hasFileInCVS :: FilePath -> [CVSInfo] -> Bool
hasFileInCVS _ [] = False
hasFileInCVS fPath (y:ys)
| curPath y == fPath = True
| otherwise = hasFileInCVS fPath ys
findFileWithRes :: FilesTree -> FilePath -> BS.ByteString
findFileWithRes File{} _ = BS.empty
findFileWithRes CVS{} _ = BS.empty
findFileWithRes curTree@Dir{} name = mapper (children curTree)
where
mapper :: [FilesTree] -> BS.ByteString
mapper [] = BS.empty
mapper (child:lastC) =
do
let bs = mapper lastC
if isDir child then
BS.append bs (findFileWithRes child name)
else
if path curTree ++ "/" ++ name == path child then
addStrToBS (path child ++ "\n") bs
else
bs
printFT :: Int -> FilesTree -> IO()
printFT cnt File{..} = do
putStrLn $ duplicate "-" cnt ++ ">" ++ path
BS.putStrLn fileData
printFT cnt Dir{..} = do
putStrLn $ duplicate "-" cnt ++ ">" ++ path
forM_ children (printFT (cnt + 1))
printFT cnt CVS{..} = putStrLn $ duplicate "-" cnt ++ ">" ++ path ++ show versionsInfo
|
package ch.fhnw.digibp.demo.process.service;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.slf4j.Logger;
import javax.inject.Named;
/**
* Created by andreas.martin on 17.04.2017.
*/
@Named
public class PublishTweetService implements JavaDelegate {
private static final Logger log = org.slf4j.LoggerFactory.getLogger(PublishTweetService.class);
@Override
public void execute(DelegateExecution delegateExecution) throws Exception {
String tweet = (String) delegateExecution.getVariable("tweet");
log.info("\n######\n"
+ "NOW WE WOULD TWITTER: '" + tweet + "'" + "\n"
+ "Original content: " + tweet + "\n"
+ "\n######\n");
}
}
|
<filename>src/java/fr/paris/lutece/portal/business/user/AdminUserDAO.java
/*
* Copyright (c) 2002-2019, <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright notice
* and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice
* and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* License 1.0
*/
package fr.paris.lutece.portal.business.user;
import fr.paris.lutece.portal.business.rbac.AdminRole;
import fr.paris.lutece.portal.business.right.Right;
import fr.paris.lutece.portal.business.user.authentication.LuteceDefaultAdminUser;
import fr.paris.lutece.util.password.IPassword;
import fr.paris.lutece.util.password.IPasswordFactory;
import fr.paris.lutece.util.sql.DAOUtil;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.inject.Inject;
/**
* This class porvides Data Access methods for AdminUser objects
*/
public class AdminUserDAO implements IAdminUserDAO
{
// Constants
private static final String CONSTANT_AND_STATUS = " AND status = ?";
private static final String CONSTANT_AND_USER_LEVEL = " AND level_user = ?";
private static final String CONSTANT_ORDER_BY_LAST_NAME = " ORDER BY last_name ";
private static final String CONSTANT_PERCENT = "%";
private static final String SQL_QUERY_NEWPK = "SELECT max( id_user ) FROM core_admin_user ";
private static final String SQL_QUERY_INSERT = "INSERT INTO core_admin_user ( id_user , access_code, last_name , first_name, email, status, locale, level_user, accessibility_mode, password_max_valid_date, account_max_valid_date ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) ";
private static final String SQL_QUERY_SELECTALL = "SELECT id_user , access_code, last_name , first_name, email, status, locale, level_user, accessibility_mode, reset_password, password_max_valid_date, account_max_valid_date, last_login, workgroup_key FROM core_admin_user ORDER BY last_name ";
private static final String SQL_QUERY_SELECT_USER_FROM_USER_ID = "SELECT id_user , access_code, last_name , first_name, email, status, password, locale, level_user, reset_password, accessibility_mode, password_max_valid_date, account_max_valid_date, workgroup_key FROM core_admin_user WHERE id_user = ? ";
private static final String SQL_QUERY_SELECT_USER_FROM_ACCESS_CODE = "SELECT id_user, access_code, last_name, first_name, email, status, locale, level_user, reset_password, accessibility_mode, password_max_valid_date, last_login FROM core_admin_user WHERE access_code = ? ";
private static final String SQL_QUERY_SELECT_USER_FROM_EMAIL = "SELECT access_code FROM core_admin_user WHERE email = ? ";
private static final String SQL_QUERY_SELECT_RIGHTS_FROM_USER_ID = " SELECT a.id_right , a.name, a.admin_url , a.description , a.plugin_name, a.id_feature_group, a.icon_url, a.level_right, a.documentation_url, a.id_order, a.is_external_feature "
+ " FROM core_admin_right a , core_user_right b "
+ " WHERE a.id_right = b.id_right "
+ " AND b.id_user = ? "
+ " ORDER BY a.id_order ASC, a.id_right ASC ";
private static final String SQL_QUERY_UPDATE = "UPDATE core_admin_user SET access_code = ? , last_name = ? , first_name = ?, email = ?, status = ?, locale = ?, reset_password = ?, accessibility_mode = ?, password_max_valid_date = ? WHERE id_user = ? ";
private static final String SQL_QUERY_DELETE = "DELETE FROM core_admin_user WHERE id_user = ? ";
private static final String SQL_QUERY_INSERT_USER_RIGHT = "INSERT INTO core_user_right ( id_right, id_user ) VALUES ( ? , ? ) ";
private static final String SQL_QUERY_DELETE_ALL_USER_RIGHTS = "DELETE FROM core_user_right WHERE id_user = ? ";
private static final String SQL_QUERY_SELECT_ROLES_FROM_USER_ID = " SELECT a.role_key , a.role_description "
+ " FROM core_admin_role a , core_user_role b WHERE a.role_key = b.role_key " + " AND b.id_user = ? ORDER BY a.role_key ";
private static final String SQL_QUERY_INSERT_USER_ROLE = " INSERT INTO core_user_role ( role_key, id_user ) VALUES ( ? , ? ) ";
private static final String SQL_QUERY_DELETE_ALL_USER_ROLES = " DELETE FROM core_user_role WHERE id_user = ? ";
private static final String SQL_CHECK_ROLE_ATTRIBUTED = " SELECT id_user FROM core_user_role WHERE role_key = ?";
private static final String SQL_CHECK_ACCESS_CODE_IN_USE = " SELECT id_user FROM core_admin_user WHERE access_code = ?";
private static final String SQL_CHECK_EMAIL_IN_USE = " SELECT id_user FROM core_admin_user WHERE email = ?";
private static final String SQL_QUERY_INSERT_DEFAULT_USER = " INSERT INTO core_admin_user ( id_user, access_code, last_name, first_name, email, status, password, locale, level_user, accessibility_mode, reset_password, password_max_valid_date, account_max_valid_date, last_login, workgroup_key ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) ";
private static final String SQL_QUERY_UPDATE_DEFAULT_USER = " UPDATE core_admin_user SET access_code = ?, last_name = ?, first_name = ?, email = ?, status = ?, password = ?, locale = ?, reset_password = ?, accessibility_mode = ?, password_max_valid_date = ?, workgroup_key = ? WHERE id_user = ? ";
private static final String SQL_QUERY_UPDATE_DEFAULT_USER_IGNORE_PASSWORD = " UPDATE core_admin_user SET access_code = ?, last_name = ?, first_name = ?, email = ?, status = ?, locale = ?, reset_password = ?, accessibility_mode = ?, password_max_valid_date = ?, workgroup_key = ? WHERE id_user = ? ";
private static final String SQL_QUERY_SELECT_USERS_ID_BY_ROLES = " SELECT a.id_user , a.access_code, a.last_name , a.first_name, a.email, a.status, a.locale, a.accessibility_mode, a.password_max_valid_date "
+ " FROM core_admin_user a, core_user_role b WHERE a.id_user = b.id_user AND b.role_key = ? ";
private static final String SQL_QUERY_SELECT_USER_RIGHTS_OWN = " SELECT DISTINCT b.id_right FROM core_admin_right a , core_user_right b WHERE b.id_user = ? and a.id_right = b.id_right and a.level_right >= ?";
private static final String SQL_QUERY_SELECT_USER_RIGHTS_DELEGATED = " SELECT DISTINCT b.id_right FROM core_admin_right a , core_user_right b WHERE b.id_user = ? and a.id_right = b.id_right and a.level_right < ?";
private static final String SQL_QUERY_DELETE_USER_RIGHTS = " DELETE FROM core_user_right WHERE id_user = ? and id_right = ?";
private static final String SQL_QUERY_SELECT_USERS_BY_LEVEL = " SELECT a.id_user, a.access_code, a.last_name, a.first_name, a.email, a.status, a.locale, a.accessibility_mode "
+ " FROM core_admin_user a WHERE a.level_user = ? ";
private static final String SQL_QUERY_UPDATE_USERS_ROLE = "UPDATE core_user_role SET role_key = ? WHERE role_key = ?";
private static final String SQL_QUERY_SELECT_USER_ROLE = " SELECT id_user FROM core_user_role WHERE id_user = ? AND role_key = ? ";
private static final String SQL_QUERY_DELETE_ROLE_FOR_USER = " DELETE FROM core_user_role WHERE id_user = ? AND role_key = ? ";
private static final String SQL_QUERY_SELECT_USER_FROM_SEARCH = " SELECT id_user, access_code, last_name, first_name, email, status, locale, level_user, accessibility_mode "
+ " FROM core_admin_user WHERE access_code LIKE ? AND last_name LIKE ? AND email LIKE ? ";
private static final String SQL_QUERY_SELECT_USERS_BY_RIGHT = " SELECT u.id_user , u.access_code, u.last_name , u.first_name, u.email, u.status, u.locale, u.level_user, u.accessibility_mode "
+ " FROM core_admin_user u INNER JOIN core_user_right r ON u.id_user = r.id_user WHERE r.id_right = ? ";
private static final String SQL_QUERY_SELECT_USER_RIGHT = " SELECT id_user FROM core_user_right WHERE id_user = ? AND id_right = ? ";
private static final String SQL_SELECT_USER_PASSWORD_HISTORY = "SELECT password FROM core_user_password_history WHERE id_user = ? ORDER BY date_password_change desc";
private static final String SQL_COUNT_USER_PASSWORD_HISTORY = "SELECT COUNT(*) FROM core_user_password_history WHERE id_user = ? AND date_password_change > ?";
private static final String SQL_INSERT_PASSWORD_HISTORY = "INSERT INTO core_user_password_history (id_user, password) VALUES ( ?, ? ) ";
private static final String SQL_DELETE_PASSWORD_HISTORY = "DELETE FROM core_user_password_history WHERE id_user = ?";
private static final String SQL_SELECT_ANONYMIZATION_STATUS_USER_FILED = "SELECT field_name, anonymize from core_admin_user_anonymize_field";
private static final String SQL_UPDATE_ANONYMIZATION_STATUS_USER_FILED = "UPDATE core_admin_user_anonymize_field SET anonymize = ? WHERE field_name = ? ";
private static final String SQL_QUERY_SELECT_EXPIRED_USER_ID = "SELECT id_user FROM core_admin_user WHERE status = ?";
private static final String SQL_QUERY_SELECT_EXPIRED_LIFE_TIME_USER_ID = "SELECT id_user FROM core_admin_user WHERE account_max_valid_date < ? and status < ? ";
private static final String SQL_QUERY_SELECT_USER_ID_FIRST_ALERT = "SELECT id_user FROM core_admin_user WHERE nb_alerts_sent = 0 and status < ? and account_max_valid_date < ? ";
private static final String SQL_QUERY_SELECT_USER_ID_OTHER_ALERT = "SELECT id_user FROM core_admin_user "
+ "WHERE nb_alerts_sent > 0 and nb_alerts_sent <= ? and status < ? and (account_max_valid_date + nb_alerts_sent * ?) < ? ";
private static final String SQL_QUERY_SELECT_USER_ID_PASSWORD_EXPIRED = " SELECT id_user FROM core_admin_user WHERE password_max_valid_date < ? AND reset_password = 0 ";
private static final String SQL_QUERY_UPDATE_STATUS = " UPDATE core_admin_user SET status = ? WHERE id_user IN ( ";
private static final String SQL_QUERY_UPDATE_NB_ALERT = " UPDATE core_admin_user SET nb_alerts_sent = nb_alerts_sent + 1 WHERE id_user IN ( ";
private static final String SQL_QUERY_UPDATE_RESET_PASSWORD_LIST_ID = " UPDATE core_admin_user SET reset_password = 1 WHERE id_user IN ( ";
private static final String SQL_QUERY_UPDATE_REACTIVATE_ACCOUNT = " UPDATE core_admin_user SET nb_alerts_sent = 0, account_max_valid_date = ? WHERE id_user = ? ";
private static final String SQL_QUERY_UPDATE_DATE_LAST_LOGIN = " UPDATE core_admin_user SET last_login = ? WHERE id_user = ? ";
private static final String CONSTANT_CLOSE_PARENTHESIS = " ) ";
private static final String CONSTANT_COMMA = ", ";
@Inject
private IPasswordFactory _passwordFactory;
/**
* {@inheritDoc}
*/
@Override
public AdminUser load( int nUserId )
{
AdminUser user = null;
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_USER_FROM_USER_ID );
daoUtil.setInt( 1, nUserId );
daoUtil.executeQuery( );
if ( daoUtil.next( ) )
{
user = new AdminUser( );
user.setUserId( daoUtil.getInt( 1 ) );
user.setAccessCode( daoUtil.getString( 2 ) );
user.setLastName( daoUtil.getString( 3 ) );
user.setFirstName( daoUtil.getString( 4 ) );
user.setEmail( daoUtil.getString( 5 ) );
user.setStatus( daoUtil.getInt( 6 ) );
user.setLocale( new Locale( daoUtil.getString( 8 ) ) );
user.setUserLevel( daoUtil.getInt( 9 ) );
user.setPasswordReset( daoUtil.getBoolean( 10 ) );
user.setAccessibilityMode( daoUtil.getBoolean( 11 ) );
user.setPasswordMaxValidDate( daoUtil.getTimestamp( 12 ) );
long accountTime = daoUtil.getLong( 13 );
if ( accountTime > 0 )
{
user.setAccountMaxValidDate( new Timestamp( accountTime ) );
}
}
daoUtil.free( );
return user;
}
/**
* {@inheritDoc}
*/
@Override
public AdminUser selectUserByAccessCode( String strUserAccessCode )
{
AdminUser user = null;
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_USER_FROM_ACCESS_CODE );
daoUtil.setString( 1, strUserAccessCode );
daoUtil.executeQuery( );
if ( daoUtil.next( ) )
{
user = new AdminUser( );
user.setUserId( daoUtil.getInt( 1 ) );
user.setAccessCode( daoUtil.getString( 2 ) );
user.setLastName( daoUtil.getString( 3 ) );
user.setFirstName( daoUtil.getString( 4 ) );
user.setEmail( daoUtil.getString( 5 ) );
user.setStatus( daoUtil.getInt( 6 ) );
user.setLocale( new Locale( daoUtil.getString( 7 ) ) );
user.setUserLevel( daoUtil.getInt( 8 ) );
user.setPasswordReset( daoUtil.getBoolean( 9 ) );
user.setAccessibilityMode( daoUtil.getBoolean( 10 ) );
user.setPasswordMaxValidDate( daoUtil.getTimestamp( 11 ) );
Timestamp dateLastLogin = daoUtil.getTimestamp( 12 );
if ( ( dateLastLogin != null ) && !dateLastLogin.equals( AdminUser.DEFAULT_DATE_LAST_LOGIN ) )
{
user.setDateLastLogin( dateLastLogin );
}
}
daoUtil.free( );
return user;
}
/**
* {@inheritDoc}
*/
@Override
public String selectUserByEmail( String strEmail )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_USER_FROM_EMAIL );
daoUtil.setString( 1, strEmail );
daoUtil.executeQuery( );
String strAccessCode = null;
if ( daoUtil.next( ) )
{
strAccessCode = daoUtil.getString( 1 );
}
daoUtil.free( );
return strAccessCode;
}
/**
* {@inheritDoc}
*/
@Override
public Collection<AdminUser> selectUserList( )
{
Collection<AdminUser> userList = new ArrayList<AdminUser>( );
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECTALL );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
AdminUser user = new AdminUser( );
user.setUserId( daoUtil.getInt( 1 ) );
user.setAccessCode( daoUtil.getString( 2 ) );
user.setLastName( daoUtil.getString( 3 ) );
user.setFirstName( daoUtil.getString( 4 ) );
user.setEmail( daoUtil.getString( 5 ) );
user.setStatus( daoUtil.getInt( 6 ) );
user.setLocale( new Locale( daoUtil.getString( 7 ) ) );
user.setUserLevel( daoUtil.getInt( 8 ) );
user.setAccessibilityMode( daoUtil.getBoolean( 9 ) );
user.setPasswordReset( daoUtil.getBoolean( 10 ) );
user.setPasswordMaxValidDate( daoUtil.getTimestamp( 11 ) );
long accountTime = daoUtil.getLong( 12 );
if ( accountTime > 0 )
{
user.setAccountMaxValidDate( new Timestamp( accountTime ) );
}
Timestamp dateLastLogin = daoUtil.getTimestamp( 13 );
if ( ( dateLastLogin != null ) && !dateLastLogin.equals( AdminUser.DEFAULT_DATE_LAST_LOGIN ) )
{
user.setDateLastLogin( dateLastLogin );
}
user.setWorkgroupKey( daoUtil.getString( 14 ) );
userList.add( user );
}
daoUtil.free( );
return userList;
}
/**
* {@inheritDoc}
*/
@Override
public int newPrimaryKey( )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_NEWPK );
daoUtil.executeQuery( );
int nKey;
if ( !daoUtil.next( ) )
{
// if the table is empty
nKey = 1;
}
nKey = daoUtil.getInt( 1 ) + 1;
daoUtil.free( );
return nKey;
}
/**
* {@inheritDoc}
*/
@Override
public synchronized void insert( AdminUser user )
{
user.setUserId( newPrimaryKey( ) );
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT );
daoUtil.setInt( 1, user.getUserId( ) );
daoUtil.setString( 2, user.getAccessCode( ) );
daoUtil.setString( 3, user.getLastName( ) );
daoUtil.setString( 4, user.getFirstName( ) );
daoUtil.setString( 5, user.getEmail( ) );
daoUtil.setInt( 6, user.getStatus( ) );
daoUtil.setString( 7, user.getLocale( ).toString( ) );
daoUtil.setInt( 8, user.getUserLevel( ) );
daoUtil.setBoolean( 9, user.getAccessibilityMode( ) );
daoUtil.setTimestamp( 10, user.getPasswordMaxValidDate( ) );
if ( user.getAccountMaxValidDate( ) == null )
{
daoUtil.setLongNull( 11 );
}
else
{
daoUtil.setLong( 11, user.getAccountMaxValidDate( ).getTime( ) );
}
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public void store( AdminUser user )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_UPDATE );
daoUtil.setString( 1, user.getAccessCode( ) );
daoUtil.setString( 2, user.getLastName( ) );
daoUtil.setString( 3, user.getFirstName( ) );
daoUtil.setString( 4, user.getEmail( ) );
daoUtil.setInt( 5, user.getStatus( ) );
daoUtil.setString( 6, user.getLocale( ).toString( ) );
daoUtil.setBoolean( 7, user.isPasswordReset( ) );
daoUtil.setBoolean( 8, user.getAccessibilityMode( ) );
daoUtil.setTimestamp( 9, user.getPasswordMaxValidDate( ) );
daoUtil.setInt( 10, user.getUserId( ) );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public void delete( int nUserId )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE );
daoUtil.setInt( 1, nUserId );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public Map<String, Right> selectRightsListForUser( int nUserId )
{
Map<String, Right> rightsMap = new HashMap<String, Right>( );
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_RIGHTS_FROM_USER_ID );
daoUtil.setInt( 1, nUserId );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
Right right = new Right( );
right.setId( daoUtil.getString( 1 ) );
right.setNameKey( daoUtil.getString( 2 ) );
right.setUrl( daoUtil.getString( 3 ) );
right.setDescriptionKey( daoUtil.getString( 4 ) );
right.setPluginName( daoUtil.getString( 5 ) );
right.setFeatureGroup( daoUtil.getString( 6 ) );
right.setIconUrl( daoUtil.getString( 7 ) );
right.setLevel( daoUtil.getInt( 8 ) );
right.setDocumentationUrl( daoUtil.getString( 9 ) );
right.setOrder( daoUtil.getInt( 10 ) );
right.setExternalFeature( daoUtil.getBoolean( 11 ) );
rightsMap.put( right.getId( ), right );
}
daoUtil.free( );
return rightsMap;
}
/**
* {@inheritDoc}
*/
@Override
public void insertRightsListForUser( int nUserId, String strRightId )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT_USER_RIGHT );
daoUtil.setString( 1, strRightId );
daoUtil.setInt( 2, nUserId );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public void deleteAllRightsForUser( int nUserId )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE_ALL_USER_RIGHTS );
daoUtil.setInt( 1, nUserId );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public Map<String, AdminRole> selectRolesListForUser( int nUserId )
{
Map<String, AdminRole> rolesMap = new HashMap<String, AdminRole>( );
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_ROLES_FROM_USER_ID );
daoUtil.setInt( 1, nUserId );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
AdminRole role = new AdminRole( );
role.setKey( daoUtil.getString( 1 ) );
role.setDescription( daoUtil.getString( 2 ) );
rolesMap.put( role.getKey( ), role );
}
daoUtil.free( );
return rolesMap;
}
/**
* {@inheritDoc}
*/
@Override
public void insertRolesListForUser( int nUserId, String strRoleKey )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT_USER_ROLE );
daoUtil.setString( 1, strRoleKey );
daoUtil.setInt( 2, nUserId );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public void deleteAllRolesForUser( int nUserId )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE_ALL_USER_ROLES );
daoUtil.setInt( 1, nUserId );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public boolean checkRoleAttributed( String strRoleKey )
{
boolean bInUse = false;
DAOUtil daoUtil = new DAOUtil( SQL_CHECK_ROLE_ATTRIBUTED );
daoUtil.setString( 1, strRoleKey );
daoUtil.executeQuery( );
if ( daoUtil.next( ) )
{
bInUse = true;
}
daoUtil.free( );
return bInUse;
}
/**
* {@inheritDoc}
*/
@Override
public int checkAccessCodeAlreadyInUse( String strAccessCode )
{
int nIdUser = -1;
DAOUtil daoUtil = new DAOUtil( SQL_CHECK_ACCESS_CODE_IN_USE );
daoUtil.setString( 1, strAccessCode );
daoUtil.executeQuery( );
if ( daoUtil.next( ) )
{
nIdUser = daoUtil.getInt( 1 );
}
daoUtil.free( );
return nIdUser;
}
/**
* {@inheritDoc}
*/
@Override
public int checkEmailAlreadyInUse( String strEmail )
{
int nIdUser = -1;
DAOUtil daoUtil = new DAOUtil( SQL_CHECK_EMAIL_IN_USE );
daoUtil.setString( 1, strEmail );
daoUtil.executeQuery( );
if ( daoUtil.next( ) )
{
nIdUser = daoUtil.getInt( 1 );
}
daoUtil.free( );
return nIdUser;
}
// ////////////////////////////////////////////////////////////////
// for no-module mode
/**
* {@inheritDoc}
*/
@Override
public void insert( LuteceDefaultAdminUser user )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT_DEFAULT_USER );
user.setUserId( newPrimaryKey( ) );
daoUtil.setInt( 1, user.getUserId( ) );
daoUtil.setString( 2, user.getAccessCode( ) );
daoUtil.setString( 3, user.getLastName( ) );
daoUtil.setString( 4, user.getFirstName( ) );
daoUtil.setString( 5, user.getEmail( ) );
daoUtil.setInt( 6, user.getStatus( ) );
daoUtil.setString( 7, user.getPassword( ).getStorableRepresentation( ) );
daoUtil.setString( 8, user.getLocale( ).toString( ) );
daoUtil.setInt( 9, user.getUserLevel( ) );
daoUtil.setBoolean( 10, user.getAccessibilityMode( ) );
daoUtil.setBoolean( 11, user.isPasswordReset( ) );
daoUtil.setTimestamp( 12, user.getPasswordMaxValidDate( ) );
if ( user.getAccountMaxValidDate( ) == null )
{
daoUtil.setLongNull( 13 );
}
else
{
daoUtil.setLong( 13, user.getAccountMaxValidDate( ).getTime( ) );
}
daoUtil.setTimestamp( 14, user.getDateLastLogin( ) );
daoUtil.setString( 15, user.getWorkgroupKey( ) );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public void store( LuteceDefaultAdminUser user, PasswordUpdateMode passwordMode )
{
String query = SQL_QUERY_UPDATE_DEFAULT_USER_IGNORE_PASSWORD;
if ( PasswordUpdateMode.UPDATE.equals( passwordMode ) )
{
query = SQL_QUERY_UPDATE_DEFAULT_USER;
}
DAOUtil daoUtil = new DAOUtil( query );
int nArgIndex = 1;
daoUtil.setString( nArgIndex++, user.getAccessCode( ) );
daoUtil.setString( nArgIndex++, user.getLastName( ) );
daoUtil.setString( nArgIndex++, user.getFirstName( ) );
daoUtil.setString( nArgIndex++, user.getEmail( ) );
daoUtil.setInt( nArgIndex++, user.getStatus( ) );
if ( PasswordUpdateMode.UPDATE.equals( passwordMode ) )
{
daoUtil.setString( nArgIndex++, user.getPassword( ).getStorableRepresentation( ) );
}
daoUtil.setString( nArgIndex++, user.getLocale( ).toString( ) );
daoUtil.setBoolean( nArgIndex++, user.isPasswordReset( ) );
daoUtil.setBoolean( nArgIndex++, user.getAccessibilityMode( ) );
daoUtil.setTimestamp( nArgIndex++, user.getPasswordMaxValidDate( ) );
daoUtil.setString( nArgIndex++, user.getWorkgroupKey( ) );
daoUtil.setInt( nArgIndex++, user.getUserId( ) );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public LuteceDefaultAdminUser loadDefaultAdminUser( int nUserId )
{
LuteceDefaultAdminUser user = new LuteceDefaultAdminUser( );
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_USER_FROM_USER_ID );
daoUtil.setInt( 1, nUserId );
daoUtil.executeQuery( );
try
{
if ( daoUtil.next( ) )
{
user.setUserId( daoUtil.getInt( 1 ) );
user.setAccessCode( daoUtil.getString( 2 ) );
user.setLastName( daoUtil.getString( 3 ) );
user.setFirstName( daoUtil.getString( 4 ) );
user.setEmail( daoUtil.getString( 5 ) );
user.setStatus( daoUtil.getInt( 6 ) );
user.setPassword( <PASSWORD>( daoUtil.getString( 7 ) ) );
Locale locale = new Locale( daoUtil.getString( 8 ) );
user.setLocale( locale );
user.setUserLevel( daoUtil.getInt( 9 ) );
user.setPasswordReset( daoUtil.getBoolean( 10 ) );
user.setAccessibilityMode( daoUtil.getBoolean( 11 ) );
user.setWorkgroupKey( daoUtil.getString( 14 ) );
}
}
finally
{
daoUtil.free( );
}
return user;
}
/**
* {@inheritDoc}
*/
@Override
public Collection<AdminUser> selectUsersByRole( String strRoleKey )
{
Collection<AdminUser> userList = new ArrayList<AdminUser>( );
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_USERS_ID_BY_ROLES );
daoUtil.setString( 1, strRoleKey );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
AdminUser user = new AdminUser( );
user.setUserId( daoUtil.getInt( 1 ) );
user.setAccessCode( daoUtil.getString( 2 ) );
user.setLastName( daoUtil.getString( 3 ) );
user.setFirstName( daoUtil.getString( 4 ) );
user.setEmail( daoUtil.getString( 5 ) );
user.setStatus( daoUtil.getInt( 6 ) );
user.setLocale( new Locale( daoUtil.getString( 7 ) ) );
user.setAccessibilityMode( daoUtil.getBoolean( 8 ) );
user.setPasswordMaxValidDate( daoUtil.getTimestamp( 9 ) );
userList.add( user );
}
daoUtil.free( );
return userList;
}
/**
* {@inheritDoc}
*/
@Override
public Collection<AdminUser> selectUsersByLevel( int nIdLevel )
{
Collection<AdminUser> userList = new ArrayList<AdminUser>( );
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_USERS_BY_LEVEL );
daoUtil.setInt( 1, nIdLevel );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
AdminUser user = new AdminUser( );
user.setUserId( daoUtil.getInt( 1 ) );
user.setAccessCode( daoUtil.getString( 2 ) );
user.setLastName( daoUtil.getString( 3 ) );
user.setFirstName( daoUtil.getString( 4 ) );
user.setEmail( daoUtil.getString( 5 ) );
user.setStatus( daoUtil.getInt( 6 ) );
user.setLocale( new Locale( daoUtil.getString( 7 ) ) );
user.setAccessibilityMode( daoUtil.getBoolean( 8 ) );
userList.add( user );
}
daoUtil.free( );
return userList;
}
/**
* Select rights by user, by user level and by type (Delegated or own)
*
* @param nUserId
* the id of the user
* @param nUserLevel
* the id of the user level
* @param bDelegated
* true if select concern delegated rights
* @return collection of id rights
*/
private Collection<String> selectIdRights( int nUserId, int nUserLevel, boolean bDelegated )
{
String strSqlQuery = bDelegated ? SQL_QUERY_SELECT_USER_RIGHTS_DELEGATED : SQL_QUERY_SELECT_USER_RIGHTS_OWN;
Collection<String> idRightList = new ArrayList<String>( );
DAOUtil daoUtil = new DAOUtil( strSqlQuery );
daoUtil.setInt( 1, nUserId );
daoUtil.setInt( 2, nUserLevel );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
idRightList.add( daoUtil.getString( 1 ) );
}
daoUtil.free( );
return idRightList;
}
/**
* Deletes rights by user and by id right
*
* @param nUserId
* the user id
* @param idRightList
* the list of rights to delete
*/
private void deleteRightsForUser( int nUserId, Collection<String> idRightList )
{
for ( String strIdRight : idRightList )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE_USER_RIGHTS );
daoUtil.setInt( 1, nUserId );
daoUtil.setString( 2, strIdRight );
daoUtil.executeUpdate( );
daoUtil.free( );
}
}
/**
* {@inheritDoc}
*/
@Override
public void deleteAllOwnRightsForUser( int nUserId, int nUserLevel )
{
Collection<String> idRightList = selectIdRights( nUserId, nUserLevel, false );
deleteRightsForUser( nUserId, idRightList );
}
/**
* {@inheritDoc}
*/
@Override
public void deleteAllDelegatedRightsForUser( int nUserId, int nUserLevel )
{
Collection<String> idRightList = selectIdRights( nUserId, nUserLevel, true );
deleteRightsForUser( nUserId, idRightList );
}
/**
* {@inheritDoc}
*/
@Override
public void storeUsersRole( String strOldRoleKey, AdminRole role )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_UPDATE_USERS_ROLE );
daoUtil.setString( 1, role.getKey( ) );
daoUtil.setString( 2, strOldRoleKey );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public boolean hasRole( int nUserId, String strRoleKey )
{
boolean bHasRole = false;
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_USER_ROLE );
daoUtil.setInt( 1, nUserId );
daoUtil.setString( 2, strRoleKey );
daoUtil.executeQuery( );
if ( daoUtil.next( ) )
{
bHasRole = true;
}
daoUtil.free( );
return bHasRole;
}
/**
* {@inheritDoc}
*/
@Override
public void deleteRoleForUser( int nUserId, String strRoleKey )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE_ROLE_FOR_USER );
daoUtil.setInt( 1, nUserId );
daoUtil.setString( 2, strRoleKey );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public Collection<AdminUser> selectUsersByFilter( AdminUserFilter auFilter )
{
Collection<AdminUser> userList = new ArrayList<AdminUser>( );
DAOUtil daoUtil;
String query = SQL_QUERY_SELECT_USER_FROM_SEARCH;
if ( auFilter.getStatus( ) != -1 )
{
query += CONSTANT_AND_STATUS;
}
if ( auFilter.getUserLevel( ) != -1 )
{
query += CONSTANT_AND_USER_LEVEL;
}
query += CONSTANT_ORDER_BY_LAST_NAME;
daoUtil = new DAOUtil( query );
daoUtil.setString( 1, CONSTANT_PERCENT + auFilter.getAccessCode( ) + CONSTANT_PERCENT );
daoUtil.setString( 2, CONSTANT_PERCENT + auFilter.getLastName( ) + CONSTANT_PERCENT );
daoUtil.setString( 3, CONSTANT_PERCENT + auFilter.getEmail( ) + CONSTANT_PERCENT );
if ( auFilter.getStatus( ) != -1 )
{
daoUtil.setInt( 4, auFilter.getStatus( ) );
if ( auFilter.getUserLevel( ) != -1 )
{
daoUtil.setInt( 5, auFilter.getUserLevel( ) );
}
}
else
{
if ( auFilter.getUserLevel( ) != -1 )
{
daoUtil.setInt( 4, auFilter.getUserLevel( ) );
}
}
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
AdminUser user = new AdminUser( );
user.setUserId( daoUtil.getInt( 1 ) );
user.setAccessCode( daoUtil.getString( 2 ) );
user.setLastName( daoUtil.getString( 3 ) );
user.setFirstName( daoUtil.getString( 4 ) );
user.setEmail( daoUtil.getString( 5 ) );
user.setStatus( daoUtil.getInt( 6 ) );
user.setLocale( new Locale( daoUtil.getString( 7 ) ) );
user.setUserLevel( daoUtil.getInt( 8 ) );
user.setAccessibilityMode( daoUtil.getBoolean( 9 ) );
userList.add( user );
}
daoUtil.free( );
return userList;
}
/**
* {@inheritDoc}
*/
@Override
public Collection<AdminUser> selectUsersByRight( String strIdRight )
{
Collection<AdminUser> userList = new ArrayList<AdminUser>( );
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_USERS_BY_RIGHT );
daoUtil.setString( 1, strIdRight );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
AdminUser user = new AdminUser( );
user.setUserId( daoUtil.getInt( 1 ) );
user.setAccessCode( daoUtil.getString( 2 ) );
user.setLastName( daoUtil.getString( 3 ) );
user.setFirstName( daoUtil.getString( 4 ) );
user.setEmail( daoUtil.getString( 5 ) );
user.setStatus( daoUtil.getInt( 6 ) );
user.setLocale( new Locale( daoUtil.getString( 7 ) ) );
user.setUserLevel( daoUtil.getInt( 8 ) );
user.setAccessibilityMode( daoUtil.getBoolean( 9 ) );
userList.add( user );
}
daoUtil.free( );
return userList;
}
/**
* {@inheritDoc}
*/
@Override
public boolean hasRight( int nUserId, String strIdRight )
{
boolean bHasRight = false;
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_USER_RIGHT );
daoUtil.setInt( 1, nUserId );
daoUtil.setString( 2, strIdRight );
daoUtil.executeQuery( );
if ( daoUtil.next( ) )
{
bHasRight = true;
}
daoUtil.free( );
return bHasRight;
}
/**
* {@inheritDoc}
*/
@Override
public void deleteRightForUser( int nUserId, String strIdRight )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE_USER_RIGHTS );
daoUtil.setInt( 1, nUserId );
daoUtil.setString( 2, strIdRight );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public List<IPassword> selectUserPasswordHistory( int nUserID )
{
List<IPassword> listPasswordHistory = new ArrayList<IPassword>( );
DAOUtil daoUtil = new DAOUtil( SQL_SELECT_USER_PASSWORD_HISTORY );
daoUtil.setInt( 1, nUserID );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
listPasswordHistory.add( _passwordFactory.getPassword( daoUtil.getString( 1 ) ) );
}
daoUtil.free( );
return listPasswordHistory;
}
/**
* {@inheritDoc}
*/
@Override
public int countUserPasswordHistoryFromDate( Timestamp minDate, int nUserId )
{
int nNbRes = 0;
DAOUtil daoUtil = new DAOUtil( SQL_COUNT_USER_PASSWORD_HISTORY );
daoUtil.setInt( 1, nUserId );
daoUtil.setTimestamp( 2, minDate );
daoUtil.executeQuery( );
if ( daoUtil.next( ) )
{
nNbRes = daoUtil.getInt( 1 );
}
daoUtil.free( );
return nNbRes;
}
/**
* {@inheritDoc}
*/
@Override
public void insertNewPasswordInHistory( IPassword password, int nUserId )
{
DAOUtil daoUtil = new DAOUtil( SQL_INSERT_PASSWORD_HISTORY );
daoUtil.setInt( 1, nUserId );
daoUtil.setString( 2, password.getStorableRepresentation( ) );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public void removeAllPasswordHistoryForUser( int nUserId )
{
DAOUtil daoUtil = new DAOUtil( SQL_DELETE_PASSWORD_HISTORY );
daoUtil.setInt( 1, nUserId );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public Map<String, Boolean> selectAnonymizationStatusUserStaticField( )
{
DAOUtil daoUtil = new DAOUtil( SQL_SELECT_ANONYMIZATION_STATUS_USER_FILED );
daoUtil.executeQuery( );
Map<String, Boolean> resultMap = new HashMap<String, Boolean>( );
while ( daoUtil.next( ) )
{
resultMap.put( daoUtil.getString( 1 ), daoUtil.getBoolean( 2 ) );
}
daoUtil.free( );
return resultMap;
}
/**
* {@inheritDoc}
*/
@Override
public void updateAnonymizationStatusUserStaticField( String strFieldName, boolean bAnonymizeFiled )
{
DAOUtil daoUtil = new DAOUtil( SQL_UPDATE_ANONYMIZATION_STATUS_USER_FILED );
daoUtil.setBoolean( 1, bAnonymizeFiled );
daoUtil.setString( 2, strFieldName );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public List<Integer> findAllExpiredUserId( )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_EXPIRED_USER_ID );
daoUtil.setInt( 1, AdminUser.EXPIRED_CODE );
List<Integer> listIdExpiredUser = new ArrayList<Integer>( );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
listIdExpiredUser.add( daoUtil.getInt( 1 ) );
}
daoUtil.free( );
return listIdExpiredUser;
}
/**
* {@inheritDoc}
*/
@Override
public List<Integer> getIdUsersWithExpiredLifeTimeList( Timestamp currentTimestamp )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_EXPIRED_LIFE_TIME_USER_ID );
daoUtil.setLong( 1, currentTimestamp.getTime( ) );
daoUtil.setInt( 2, AdminUser.EXPIRED_CODE );
List<Integer> listIdExpiredUser = new ArrayList<Integer>( );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
listIdExpiredUser.add( daoUtil.getInt( 1 ) );
}
daoUtil.free( );
return listIdExpiredUser;
}
/**
* {@inheritDoc}
*/
@Override
public List<Integer> getIdUsersToSendFirstAlert( Timestamp alertMaxDate )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_USER_ID_FIRST_ALERT );
daoUtil.setInt( 1, AdminUser.EXPIRED_CODE );
daoUtil.setLong( 2, alertMaxDate.getTime( ) );
List<Integer> listIdUserFirstAlert = new ArrayList<Integer>( );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
listIdUserFirstAlert.add( daoUtil.getInt( 1 ) );
}
daoUtil.free( );
return listIdUserFirstAlert;
}
/**
* {@inheritDoc}
*/
@Override
public List<Integer> getIdUsersToSendOtherAlert( Timestamp alertMaxDate, Timestamp timeBetweenAlerts, int maxNumberAlerts )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_USER_ID_OTHER_ALERT );
daoUtil.setInt( 1, maxNumberAlerts );
daoUtil.setInt( 2, AdminUser.EXPIRED_CODE );
daoUtil.setLong( 3, timeBetweenAlerts.getTime( ) );
daoUtil.setLong( 4, alertMaxDate.getTime( ) );
List<Integer> listIdUserFirstAlert = new ArrayList<Integer>( );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
listIdUserFirstAlert.add( daoUtil.getInt( 1 ) );
}
daoUtil.free( );
return listIdUserFirstAlert;
}
/**
* {@inheritDoc}
*/
@Override
public List<Integer> getIdUsersWithExpiredPasswordsList( Timestamp currentTimestamp )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT_USER_ID_PASSWORD_EXPIRED );
daoUtil.setTimestamp( 1, currentTimestamp );
List<Integer> idUserPasswordExpiredlist = new ArrayList<Integer>( );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
idUserPasswordExpiredlist.add( daoUtil.getInt( 1 ) );
}
daoUtil.free( );
return idUserPasswordExpiredlist;
}
/**
* {@inheritDoc}
*/
@Override
public void updateUserStatus( List<Integer> listIdUser, int nNewStatus )
{
if ( ( listIdUser != null ) && ( listIdUser.size( ) > 0 ) )
{
StringBuilder sbSQL = new StringBuilder( );
sbSQL.append( SQL_QUERY_UPDATE_STATUS );
for ( int i = 0; i < listIdUser.size( ); i++ )
{
if ( i > 0 )
{
sbSQL.append( CONSTANT_COMMA );
}
sbSQL.append( listIdUser.get( i ) );
}
sbSQL.append( CONSTANT_CLOSE_PARENTHESIS );
DAOUtil daoUtil = new DAOUtil( sbSQL.toString( ) );
daoUtil.setInt( 1, nNewStatus );
daoUtil.executeUpdate( );
daoUtil.free( );
}
}
/**
* {@inheritDoc}
*/
@Override
public void updateNbAlert( List<Integer> listIdUser )
{
if ( ( listIdUser != null ) && ( listIdUser.size( ) > 0 ) )
{
StringBuilder sbSQL = new StringBuilder( );
sbSQL.append( SQL_QUERY_UPDATE_NB_ALERT );
for ( int i = 0; i < listIdUser.size( ); i++ )
{
if ( i > 0 )
{
sbSQL.append( CONSTANT_COMMA );
}
sbSQL.append( listIdUser.get( i ) );
}
sbSQL.append( CONSTANT_CLOSE_PARENTHESIS );
DAOUtil daoUtil = new DAOUtil( sbSQL.toString( ) );
daoUtil.executeUpdate( );
daoUtil.free( );
}
}
/**
* {@inheritDoc}
*/
@Override
public void updateChangePassword( List<Integer> listIdUser )
{
if ( ( listIdUser != null ) && ( listIdUser.size( ) > 0 ) )
{
StringBuilder sbSQL = new StringBuilder( );
sbSQL.append( SQL_QUERY_UPDATE_RESET_PASSWORD_LIST_ID );
for ( int i = 0; i < listIdUser.size( ); i++ )
{
if ( i > 0 )
{
sbSQL.append( CONSTANT_COMMA );
}
sbSQL.append( listIdUser.get( i ) );
}
sbSQL.append( CONSTANT_CLOSE_PARENTHESIS );
DAOUtil daoUtil = new DAOUtil( sbSQL.toString( ) );
daoUtil.executeUpdate( );
daoUtil.free( );
}
}
/**
* {@inheritDoc}
*/
@Override
public void updateUserExpirationDate( int nIdUser, Timestamp newExpirationDate )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_UPDATE_REACTIVATE_ACCOUNT );
if ( newExpirationDate == null )
{
daoUtil.setLongNull( 1 );
}
else
{
daoUtil.setLong( 1, newExpirationDate.getTime( ) );
}
daoUtil.setInt( 2, nIdUser );
daoUtil.executeUpdate( );
daoUtil.free( );
}
/**
* {@inheritDoc}
*/
@Override
public void updateDateLastLogin( int nIdUser, Timestamp dateLastLogin )
{
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_UPDATE_DATE_LAST_LOGIN );
daoUtil.setTimestamp( 1, dateLastLogin );
daoUtil.setInt( 2, nIdUser );
daoUtil.executeUpdate( );
daoUtil.free( );
}
}
|
def writeIsosurfaceMesh_povray(self, field, value, frame):
from string import Template
nodes = self.nodes[(field, value)]
elements = self.elements[(field, value)]
normals = self.normals[(field, value)]
normal_indices = self.normal_indices[(field, value)]
pov_filename = "{field:s}_{value:f}_{frame:04d}.pov".format(
field=field,
value=value,
frame=self.nFrames)
self.comm.beginSequential()
if self.comm.isMaster():
pov = open(pov_filename, "w")
dx = np.array(self.domain.L) * 0.02
nll = np.array(self.domain.x) - dx
fur = np.array(self.domain.L) + dx
fur[2] = self.domain.L[2] - dx[2]
pov.write("""#version 3.7;
#include "proteus.inc"
""")
if not self.writeBoundary:
pov.write(Template("""
object
{
difference
{
box {
<$nll_x,$nll_y,$nll_z>, // Near lower left corner
<$fur_x,$fur_y,$fur_z> // Far upper right corner
}
box {
<$domain_nll_x,$domain_nll_y,$domain_nll_z>, // Near lower left corner
<$domain_fur_x,$domain_fur_y,$domain_fur_z> // Far upper right corner
}
}//difference of perturbed bounding box and boundary
matrix < 1.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 1.000000,
0.000000, 0.000000, 0.000000 >
tank_material()
}//object
""").substitute(nll_x=nll[0],
nll_y=nll[1],
nll_z=nll[2],
fur_x=fur[0],
fur_y=fur[1],
fur_z=fur[2],
domain_nll_x=self.domain.x[0],
domain_nll_y=self.domain.x[1],
domain_nll_z=self.domain.x[2],
domain_fur_x=self.domain.L[0],
domain_fur_y=self.domain.L[1],
domain_fur_z=self.domain.L[2]))
pov.flush()
if self.writeBoundary:
pov.write(Template("""
object
{
//difference
//{
// box {
// <$nll_x,$nll_y,$nll_z>, // Near lower left corner
// <$fur_x,$fur_y,$fur_z> // Far upper right corner
// }
union
{
""").substitute(nll_x=nll[0],
nll_y=nll[1],
nll_z=nll[2],
fur_x=fur[0],
fur_y=fur[1],
fur_z=fur[2]))
pov.flush()
else:
pov = open(pov_filename, "a")
if self.writeBoundary:
povScene = """mesh2 {
vertex_vectors {"""
pov.write(povScene)
pov.write("{0:d},\n".format(len(self.boundaryNodes)))
for n in self.boundaryNodes:
pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(
*self.nodeArray[n]))
pov.write("}\n")
pov.write("""face_indices {
""")
pov.write("{0:d},\n".format(
np.count_nonzero(self.elementBoundaryMaterialTypes)))
for ebN in self.exteriorElementBoundariesArray:
if self.elementBoundaryMaterialTypes[ebN] > 0:
bnt = tuple(
[self.g2b[n] for n
in self.elementBoundaryNodesArray[ebN]])
pov.write("<{0:d},{1:d},{2:d}>,\n".format(*bnt))
pov.write("}\n")
pov.write("//inside_vector on\n}//mesh\n")
pov.flush()
pov.close()
self.comm.endSequential()
self.comm.barrier()
self.comm.beginSequential()
pov = open(pov_filename, "a")
if self.comm.isMaster():
pov.write("""}//union of meshes
//}//difference of perturbed bounding box and boundary
matrix < 1.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 1.000000,
0.000000, 0.000000, 0.000000 >
tank_material()
}//object
""")
povScene = """mesh2 {
vertex_vectors {"""
pov.write(povScene)
pov.write("{0:d},\n".format(len(nodes)))
for n in nodes:
pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(*n))
pov.write(""" }
normal_vectors {
""")
pov.write("{0:d},\n".format((len(normals))))
for n in normals:
pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(*n))
pov.write(""" }
face_indices {
""")
pov.write("{0:d},\n".format(len(elements)))
for e in elements:
pov.write("<{0:d}, {1:d}, {2:d}>,\n".format(*e))
pov.write(""" }
normal_indices {
""")
pov.write("{0:d},\n".format(len(normal_indices)))
for ni in normal_indices:
pov.write("<{0:d}, {1:d}, {2:d}>,\n".format(*ni))
pov.write(""" }
matrix < 1.000000, 0.000000, 0.000000,
0.000000, 1.000000, 0.000000,
0.000000, 0.000000, 1.000000,
0.000000, 0.000000, 0.000000 >
isosurface_material()
}
""")
pov.flush()
pov.close()
self.comm.endSequential() |
/**
* Cures the poisoning with the given power rune.
*
* @param powerRune
* a power rune representing the strength of the cure. Can't be
* null.
*/
public void cure(final PowerRune powerRune) {
Validate.notNull(powerRune, "The given power rune is null");
this.strength = Math.max(0, strength - powerRune.getPowerLevel());
} |
<filename>sec4/function/main.go
// Function, and function variatic
package main
import "fmt"
func main() {
a := 15.0
b := 9.0
o1 := "+"
o2 := "-"
o3 := "*"
o4 := "/"
// Call a function
fmt.Printf("%.2f %s %.2f = %.2f\n", a, o1, b, compute(a, o1, b))
fmt.Printf("%.2f %s %.2f = %.2f\n", a, o2, b, compute(a, o2, b))
fmt.Printf("%.2f %s %.2f = %.2f\n", a, o3, b, compute(a, o3, b))
fmt.Printf("%.2f %s %.2f = %.2f\n", a, o4, b, compute(a, o4, b))
sum := sumNums(1, 2, 3, 4, 5, 5, 6, 7, 8, 9)
fmt.Println("Sum of 1,2,3,4,5,6,7,8,9 =", sum)
}
func compute(a float64, x string, b float64) (result float64) {
switch x {
case "+":
result = a + b
case "-":
result = a - b
case "*":
result = a * b
case "/":
result = a / b
default:
fmt.Println("Sorry I can only compute basic (+, -, *, and /), please enter the right operation.")
}
return result
}
// Variatic function, sumNums will add a list of numbers, and return a total
func sumNums(n ...int) int {
var sum int
for _, x := range n {
sum += x
}
return sum
}
|
<gh_stars>0
import * as React from 'react';
// mui custom styling :
import { withStyles } from '@material-ui/core/styles';
import { Theme } from '@material-ui/core/styles';
import { StyleRulesCallback } from '@material-ui/core/';
import Fab from '@material-ui/core/Fab';
import CheckBox from '@material-ui/icons/CheckBox'
// local imports
// import styles from '../../styles/page-styles/DefaultPageMuiStyles'
const styles : StyleRulesCallback = (theme: Theme) => ({
fab: {
margin: theme.spacing.unit,
color: "#799ab6",
width: 30,
height: 30,
minHeight:30,
background: "#808080",
"&:hover": {
color: '#003087',
}
},
checkBox: {
fontSize: 17,
}
});
function FabSearchBtn(props: any) {
const { classes, handleClick } = props;
return (
<div>
<Fab
color="primary"
aria-label="Add"
className={classes.fab}
onClick={handleClick}
>
<CheckBox className={classes.checkBox}/>
</Fab>
</div>
);
}
export default withStyles(styles)(FabSearchBtn);
// {/* className={classnames(classes.button, classes.overlayTop, classes.smallButton)} */}
|
Adam Cochrane
Israeli forces began a ground invasion of Gazalast night, Thursday. Tanks and infantry units crossed into northern Gaza, supported by heavy bombing.
They killed at least 11 Palestinians overnight, including one five month old baby, with the death toll rising to 27 by Friday afternoon.
The bulk of the Gaza strip was also thrown into darkness as Israel cut off the electricity before going in.
Apache helicopters, drones and F16s attacked from the air, gunboats launched bombs from the sea and tanks fired from just outside the border.
At the time of writing one Israeli soldier has been killed, though reports suggest that this was as a result of friendly fire.
The ground invasion is the first since January 2009, when some 1,400 Palestinians were killed.
Israeli leaders claim that the ground offensive is aimed at destroying tunnels used by Palestinian fighters. Last night 13 of them managed to enter southern Israel using one of these tunnels before being stopped by bombing from Israeli aircraft.
Israeli Prime Minister Benjamin Netanyahu even claimed today that Israel’s was a “moral army” and that “We do not want to harm even one innocent civilian. Not even one.”
But more than 260 Palestinians have been killed since Israel began what it calls “Operation Protective Edge”–at least 80 per cent of whom are civilians. This is in addition to more than 2,000 Palestinians who have been wounded.
This is far from an even contest. Israel is the fourth military power in the world and Gaza does not have an army or navy.
Gaza has been under siege since 2007 with Israel controlling its land, sea and air borders.
Israel and its supporters have made much of a shortlived “humanitarian” ceasefire proposed byEgypt on Tuesday. It offered nothing to the people of Gaza but effective surrender.
Hamas, the Islamist faction that runs Gaza since elections in 2006, demanded and end to the siege of Gaza, an opening of the borders and the release of political prisoners who were freed in a prisoner exchange but recently rearrested.
Hamas leader Khaled Meshal said, “We won’t accept an agreement that prolongs the suffering of our people anymore. In Gaza, for the past seven years of siege, its 1.8 million people have been living in a prison.”
The people of Gaza are defiant in the face of Israeli terror, but they need solidarity. Mass demonstrations are taking place around the world on a daily basis, with large turnouts expected on the streets of London and Glasgow tomorrow.
This piece was reprinted by RINF Independent News with permission or license. |
Racing Dragons and Remembering Aliens: Benefits of Playing Number and Working Memory Games on Kindergartners' Numerical Knowledge.
Sources that contribute to variation in mathematical achievement include both numerical knowledge and general underlying cognitive processing abilities. The current study tested the benefits of tablet-based training games that targeted each of these areas for improving the mathematical knowledge of kindergarten-age children. We hypothesized that playing a number-based game targeting numerical magnitude knowledge would improve children's broader numerical skills. We also hypothesized that the benefits of playing a working memory (WM) game would transfer to children's numerical knowledge given its important underlying role in mathematics achievement. Kindergarteners from diverse backgrounds (n = 148; 52% girls; Mage = 71.87 months) were randomly assigned to either play a number-based game, a WM game, or a control game on a tablet for 10 sessions. Structural equation modeling (SEM) was used to model children's learning gains in mathematics and WM across time. Overall, our results suggest that playing the number game improved kindergarten children's numerical knowledge at the latent level, and these improvements remained stable as assessed one month later. However, children in the WM group did not improve their numerical knowledge compared to children in the control condition. Playing both the number game and WM game improved children's WM at the latent level. Importantly, the WM group continued to improve their WM for at least a month after playing the games. The results demonstrate that computerized games that target both domain-specific and domain-general skills can benefit a broad range of kindergarten-aged children. |
/**
* Reset the board. All the cards are turned face-down and are
* shuffled. The undo stack and the number of moves are cleared.
*/
public void reset() {
for ( Card card : cards ) {
if ( card.isFaceUp() ) {
card.toggleFace( true );
}
}
Collections.shuffle( cards );
this.undoStack = new ArrayList<>();
this.moveCount = 0;
announce( null );
} |
<filename>pkg/msgs/shape_msgs/package.go
//autogenerated:yes
//nolint:golint
// Package shape_msgs contains message definitions.
package shape_msgs
|
b = input()
n = len(b)
if len(b)<7 or '1' not in b:
print ('no')
else:
first = b.index('1')
print (('no','yes')[first < (n-6) and b[first+1:].count('0')>=6]) |
<filename>src/core/selection/helpers/move-the-node-along-the-edge-outward.ts
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2022 <NAME>. All rights reserved. https://xdsoft.net
*/
/**
* @module selection
*/
import type { Nullable } from 'jodit/types';
import { Dom } from 'jodit/core/dom';
export function moveTheNodeAlongTheEdgeOutward(
node: Node,
start: boolean,
root: HTMLElement
): void {
let item: Nullable<Node> = node;
while (item && item !== root) {
const sibling = Dom.findSibling(item, start);
if (sibling) {
return;
}
item = item.parentElement;
if (item && item !== root) {
start ? Dom.before(item, node) : Dom.after(item, node);
}
}
return;
}
|
US price of EpiPen for allergic reactions skyrockets
By Brad Dixon
12 August 2016
The price of the EpiPen, relied on by millions to treat severe allergic reactions, has increased by 450 percent in the United States since 2004. The price surge has made it more difficult for patients to afford the potentially life-saving device, leading many to hold on to expired EpiPens or turn to the riskier method of administering the hormone epinephrine using manual syringes.
While a two-pack of EpiPens cost about $100 in 2004 (adjusting for inflation), it now costs over $600. Some emergency medical services pay upwards of $900 for the drug device from medical supply companies. The EpiPens must be replaced each year when they expire.
The EpiPen Auto-Injector, marketed by the pharmaceutical company Mylan, is used to treat anaphylaxis, a severe and potentially deadly allergic reaction to food, medication or insect bites. The device uses a spring-loaded needle to quickly deliver a controlled dosage of epinephrine (also known as adrenaline). The device was developed in the mid-1970s by engineers at the Bethesda, Maryland-based company, Survival Technology, and first introduced in 1980.
The administration of epinephrine is the treatment of choice for anaphylaxis, and it is recommended that individuals with a history of severe allergic reactions carry an EpiPen.
An estimated 2 to 5 percent of the population experience anaphylaxis over the course of their lifetime, according to a 2014 study in the Journal of Allergy and Clinical Immunology. A survey published in the journal Pediatrics in 2011 found that 8 percent of the children had a food allergy, while nearly 40 percent of these individuals had a history of severe reactions.
An estimated 200,000 people visit emergency rooms each year due to food allergies, while nearly 10,000 end up staying in a hospital. When deaths do occur, it is almost always associated with not having access to epinephrine.
The dramatic price hikes of the EpiPen by Mylan, however, have made it increasingly difficult for working class families, even those with health insurance, to have access to the device.
Dr. Michael Pistiner, an allergist and member of the American Academy of Allergy, Asthma & Immunology in Milwaukee, Wisconsin, has observed these difficulties among his patients.
“I am hearing some of the families are opting to carry expired auto-injectors,” Pistiner told Milwaukee Public Radio, “or, if they have a high deductible sometimes they say do they really want their auto-injector, and do they really need it?”
Amie Vialet De Montbel, a mother living in Troy, Virginia, has a young son who is severely allergic to milk. When she went to fill a prescription for two 2-packs of EpiPens, she was shocked by the $1,212 price tag. “I don’t even pay that much for my mortgage,” she told Stat News. Since her health insurance has a $4,000 deductible, she would have to cover the entire cost. She had to turn down the potentially life-saving device. Her older son currently carries an expired EpiPen.
In response to the price increases, patients, such as Vialet De Montbel, and emergency responders are increasingly resorting to the use of manual syringes instead of EpiPens, reports an article last month in Stat News. This substitution raises a number of safety concerns.
“Anyone using this approach would require extensive medical training to do it effectively and safely, without contamination or accidental intravenous injection,” Dr. James Baker, Jr., CEO and chief medical officer of Food Allergy Research & Education, told Stat News.
At least 10 states have pushed for training EMT’s to give epinephrine injections using manual syringes to reduce costs.
An article published by Bloomberg in September of last year shed light on how Mylan transformed the EpiPen into a real moneymaker, bringing in annual revenue of $1 billion, which constitutes 40 percent of the company’s profits.
Mylan acquired the EpiPen through its purchase of Merck’s generic division in 2007. Led by the company’s CEO Heather Bresch, Mylan’s marketing strategy combined branding with a massive public awareness campaign, which sought to get EpiPens stocked in schools and other places. The company hired consultants who had worked with Medtronic to make defibrillators widely available in public places.
With support from Bresch’s father, Senator Joe Manchin (Democrat-W.Va.), new federal guidelines were established recommending patients with severe allergic reactions be prescribed two doses, and the FDA revised the drug’s label to allow its use by anyone at risk, not just those who had already experienced anaphylaxis.
In response to the high-profile death of a student at a Virginia school in 2013, Congress passed legislation encouraging states to stock public schools with epinephrine devices, which is now a requirement in 47 states.
To popularize the brand, Mylan spent $35.2 million on EpiPen TV ads in 2014, compared to $4.8 million spent in 2008. It also issued free EpiPens, which have to be replaced each year, to 59,000 schools. As a result, EpiPen use has grown by 67 percent since 2008. Over 3.6 million prescriptions were written for EpiPen last year.
As Mylan captured more of the epinephrine market, while simultaneously expanding the market through public awareness campaigns, it drove up the price of a 2-pack of EpiPens to over $600.
The price increases “reflect the multiple, important product features and the value the product provides,” Mylan told Stat News, while declining to state what exactly these product features were.
To counter backlash from patients and the public, Mylan offers a savings program that it refers to as the “$0 co-pay card.” However, it only covers $100, leaving patients who have insurance plans with high deductibles, increasingly common under Obamacare, to pick up the remainder.
When Nicole Smith, the founder of an online support community for families with allergies, went to fill a prescription for a 2-pack of EpiPens at Walgreens for her child, she was astounded by the price: $600, or $500 with Mylan’s “$0 co-pay card.”
The price is “higher than some people’s homeowners insurance, higher than renter insurance by far,” Smith told MarketWatch. “With the cost of them, you’re not going to buy one for each place” where your child might need one. “You’re hoping the diaper bag goes everywhere that kid goes.”
Smith says that she has heard of people driving to Canada where Mylan’s EpiPen is sold at pharmacies for only $131.
Although the EpiPen has been available since 1980, it still faces little competition. When doctors write prescriptions, they are generally for the most well-known product, EpiPen. Patients cannot substitute generic alternatives with the prescription because the FDA says the devices are not similar enough. Moreover, these generic alternatives, Adrenaclick and Auvi-Q, are priced similar to EpiPen.
Since its introduction in 2013, Sanofi’s Auvi-Q has only captured 10 percent of epinephrine prescriptions, compared to the 85 percent share held by Mylan’s EpiPen. In 2015, Sanofi had to recall its product in the US and Canada due to a potential inaccurate dosage delivery. Since then, Sanofi has indicated that it may abandon the product completely, leaving Mylan with 95 percent of the market.
This will continue into the near future as the FDA rejected Teva Pharmaceutical’s generic EpiPen earlier this year, delaying the launch until at least 2017.
Mylan Pharmaceuticals was founded in West Virginia in 1961. The company focused on manufacturing over-the-counter products and soon switched to the production of generic pharmaceuticals. The company began to diversify in the mid-1990s, acquiring the pharmaceutical firm Bertek Inc. in 1993.
In 2000, the company agreed to pay $147 million in order to settle charges by the Federal Trade Commission that Mylan had illegally restricted trade. The company had set up exclusive licensing agreements in 1998 that allowed it to monopolize the market for the raw materials necessary for two widely prescribed anti-anxiety drugs, clorazepate and lorazepam, and then respectively raised their prices from $11.36 a bottle to $377 and from $7 to $190.
“What makes this behavior even more unconscionable,” Betty D. Montgomery, the attorney general of Ohio, told the New York Times in 2000, “is that these drugs, especially lorazepam, are antianxiety medications frequently prescribed for nursing homes and hospice patients, including those suffering from long-term debilitating conditions such as Alzheimer’s disease.”
“We continue to believe we acted properly,” Milan Puskar, the company’s CEO, stated at the time.
The company continued to grow through mergers and acquisitions. In 2007, it acquired a controlling interest in Matrix Laboratories, an Active Pharmaceutical Ingredients supplier, and the generics division of Merck KGaA, which included the EpiPen. More recently, it acquired the generics division of Abbott Laboratories for $5.3 billion in 2015 and purchased the Swiss drug maker Meda in a $9.9 billion deal earlier this month.
The company, which is now incorporated in the Netherlands, is expected by financial experts to pull in $12 billion in annual revenue as a result of its acquisition of Meda.
Heather Bresch, who became the company’s CEO in 2012, took home $25.8 million in total compensation in 2014, according to FiercePharma. After the company distributed free EpiPens to schools in a bid to expand the product’s market, she told the New York Times in 2012, “I think this goes to the heart of being able to do good and do well.”
The author also recommends:
Significant price hikes for insulin and top selling US drugs
[14 April 2016]
US drug prices doubled since 2011
[18 March 2016]
Please enable JavaScript to view the comments powered by Disqus. |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
String w = sc.nextLine().toUpperCase();
String t = sc.nextLine();
int w_count = 0;
while(!t.equals("END_OF_TEXT")){
String t_array[] = t.split(" ");
w_count += seek_word_in_w(w, t_array);
t = sc.nextLine();
}
System.out.println(w_count);
}
public static int seek_word_in_w(String w, String []t_array){
int w_count = 0;
for (String t_word: t_array){
if (t_word.toUpperCase().equals(w)){
w_count++;
}
}
return w_count;
}
}
|
<reponame>sawantaditi24/Competitive-Programming<filename>Interviewbit/Strings/MultiplyStrings.py
class Solution:
# @param A : string
# @param B : string
# @return a strings
def multiply(self, A, B):
return int(A) * int(B) |
// GetAPIConfig gets a mock API configuration from the disk.
func (mgr *Manager) GetAPIConfig(fileInfo os.FileInfo) (*APIConfig, error) {
dir := fileInfo.Name()
if !fileInfo.IsDir() || !isAPI(dir) {
return nil, errors.New("not a mock API directory")
}
apiConfig, err := mgr.getAPIConfigFromDir(dir)
if err != nil {
return nil, err
}
return apiConfig, nil
} |
<reponame>zzh8829/OSPP
#ifndef _FONT_H_
#define _FONT_H_
#include "system.h"
#include "graphics.h"
extern uint32_t font_w, font_h;
extern uint32_t* font_glyph[128];
surface_t* font_render(char* str,color_t color);
void font_init();
#endif |
/**
* figure out if there is a read that covers the genotype even partially but
* rejects it
*
* @param genotypeID
* @return
*/
private boolean rejectedByARead(GenotypeID genotypeID)
{
for (MappedRead read : reads)
{
Set<GenotypeID> readGenotypes = read.getGenotypes();
if (read.contig.equals(genotypeID.contig)
&& read.start <= genotypeID.position
&& read.end >= genotypeID.endPosition)
{
if (!readGenotypes.contains(genotypeID))
{
return true;
}
}
else
{
GenotypeID partial = genotypeID.partialGenotype(read.contig,
read.start, read.end);
if (partial == null)
{
continue;
}
else if (!readGenotypes.contains(partial))
{
return true;
}
}
}
return false;
} |
//+---------------------------------------------------------------------------
//
// Member: OnExitTree
//
// Synopsis: An adorned element is leaving the tree. Up to us to do the right thing here.
//
//----------------------------------------------------------------------------
HRESULT
CControlTracker::OnExitTree(
IMarkupPointer* pIStart,
IMarkupPointer* pIEnd,
IMarkupPointer* pIContentStart,
IMarkupPointer* pIContentEnd )
{
HRESULT hr = S_OK;
SP_IDisplayPointer spDispCtlTemp;
int i;
for(i = NumberOfSelectedItems()-1; i >= 0; i--)
{
if ( Between( _aryControlElements[i]->pIElementStart, pIStart, pIEnd ) ||
Between( _aryControlElements[i]->pIElementStart, pIContentStart, pIContentEnd ) )
{
if( _aryGrabAdorners[i]->IsPrimary() && ! _pPrimary )
{
IFC( GetEditor()->CreateMarkupPointer( & _pPrimary ));
IFC( _pPrimary->MoveToPointer( _aryControlElements[i]->pIElementStart ));
}
IFC( RemoveItem( i ));
}
}
if( NumberOfSelectedItems() > 0 )
{
hr = S_OK;
goto Cleanup;
}
IFC( _pManager->GetDisplayServices()->CreateDisplayPointer(&spDispCtlTemp) );
IFC( spDispCtlTemp->SetDisplayGravity(DISPLAY_GRAVITY_NextLine) );
if (_pPrimary)
{
IFC( spDispCtlTemp->MoveToMarkupPointer(_pPrimary, NULL) );
}
else
{
SP_IHTMLCaret spCaret;
Verify( S_OK == GetDisplayServices()->GetCaret( &spCaret ) );
IFC( spCaret->MoveDisplayPointerToCaret(spDispCtlTemp));
}
hr = THR( _pManager->SetCurrentTracker( TRACKER_TYPE_Caret, spDispCtlTemp, spDispCtlTemp ) );
Assert( IsDormant());
Assert( ! _pPrimary );
Cleanup:
RRETURN( hr );
} |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import random
import base
from docker_registry.core import compat
json = compat.json
class TestImages(base.TestCase):
def test_unset_nginx_accel_redirect_layer(self):
image_id = self.gen_random_string()
layer_data = self.gen_random_string(1024)
self.upload_image(image_id, parent_id=None, layer=layer_data)
resp = self.http_client.get('/v1/images/{0}/layer'.format(image_id))
self.assertEqual(layer_data, resp.data)
def test_nginx_accel_redirect_layer(self):
image_id = self.gen_random_string()
layer_data = self.gen_random_string(1024)
self.upload_image(image_id, parent_id=None, layer=layer_data)
import docker_registry.images as images
# ensure the storage mechanism is LocalStorage or this test is bad
self.assertTrue(images.store.scheme == 'file',
'Store must be LocalStorage')
# set the nginx accel config
accel_header = 'X-Accel-Redirect'
accel_prefix = '/registry'
images.cfg._config['nginx_x_accel_redirect'] \
= accel_prefix
layer_path = 'images/{0}/layer'.format(image_id)
try:
resp = self.http_client.get('/v1/%s' % layer_path)
self.assertTrue(accel_header in resp.headers)
expected = '%s/%s' % (accel_prefix, layer_path)
self.assertEqual(expected, resp.headers[accel_header])
self.assertEqual('', resp.data)
finally:
images.cfg._config.pop('nginx_x_accel_redirect')
def test_simple(self):
image_id = self.gen_random_string()
parent_id = self.gen_random_string()
layer_data = self.gen_random_string(1024)
self.upload_image(parent_id, parent_id=None, layer=layer_data)
self.upload_image(image_id, parent_id=parent_id, layer=layer_data)
# test fetching the ancestry
resp = self.http_client.get('/v1/images/{0}/ancestry'.format(image_id))
# Note(dmp): unicode patch XXX not applied assume requests does the job
ancestry = json.loads(resp.data)
self.assertEqual(len(ancestry), 2)
self.assertEqual(ancestry[0], image_id)
self.assertEqual(ancestry[1], parent_id)
def test_notfound(self):
resp = self.http_client.get('/v1/images/{0}/json'.format(
self.gen_random_string()))
self.assertEqual(resp.status_code, 404, resp.data)
def test_bytes_range(self):
image_id = self.gen_random_string()
layer_data = self.gen_random_string(1024)
b = random.randint(0, len(layer_data) / 2)
bytes_range = (b, random.randint(b + 1, len(layer_data) - 1))
headers = {'Range': 'bytes={0}-{1}'.format(*bytes_range)}
self.upload_image(image_id, parent_id=None, layer=layer_data)
url = '/v1/images/{0}/layer'.format(image_id)
resp = self.http_client.get(url, headers=headers)
expected_data = layer_data[bytes_range[0]:bytes_range[1] + 1]
received_data = resp.data
msg = 'expected size: {0}; got: {1}'.format(len(expected_data),
len(received_data))
self.assertEqual(expected_data, received_data, msg)
|
/// Generates a number of scrambled 1D sample values using the Gray
/// code-based sampling machinery.
pub fn van_der_corput(
n_samples_per_pixel_sample: i32,
n_pixel_samples: i32,
samples: &mut [Float],
rng: &mut Rng,
) {
let scramble: u32 = rng.uniform_uint32();
let c_van_der_corput: [u32; 32] = [
0x80000000, 0x40000000, 0x20000000, 0x10000000, 0x8000000, 0x4000000, 0x2000000, 0x1000000,
0x800000, 0x400000, 0x200000, 0x100000, 0x80000, 0x40000, 0x20000, 0x10000, 0x8000, 0x4000,
0x2000, 0x1000, 0x800, 0x400, 0x200, 0x100, 0x80, 0x40, 0x20, 0x10, 0x8, 0x4, 0x2, 0x1,
];
let total_samples: i32 = n_samples_per_pixel_sample * n_pixel_samples;
gray_code_sample_1d(c_van_der_corput, total_samples as u32, scramble, samples);
// randomly shuffle 1D sample points
for i in 0..n_pixel_samples as usize {
shuffle(
&mut samples[(i * n_samples_per_pixel_sample as usize)..],
n_samples_per_pixel_sample as u32,
1,
rng,
);
}
shuffle(
&mut samples[..],
n_pixel_samples as u32,
n_samples_per_pixel_sample as u32,
rng,
);
} |
// ParseLog parses ethereum log JSON
func ParseLog(data string, c *check.C) *types.Log {
var log = new(types.Log)
err := log.UnmarshalJSON([]byte(data))
c.Assert(err, check.IsNil)
return log
} |
// signedHTTPPost performs an HTTP post on behalf of Actor with the
// request-target, date, host and digest headers signed
// with the actor's private key.
func (a *Actor) signedHTTPPost(content map[string]interface{}, to string) (err error) {
b, err := json.Marshal(content)
if err != nil {
log.Info("Can't marshal JSON")
log.Info(err)
return
}
postSigner, _, _ := httpsig.NewSigner([]httpsig.Algorithm{httpsig.RSA_SHA256}, "SHA-256", []string{"(request-target)", "date", "host", "digest"}, httpsig.Signature)
byteCopy := make([]byte, len(b))
copy(byteCopy, b)
buf := bytes.NewBuffer(byteCopy)
req, err := http.NewRequest("POST", to, buf)
if err != nil {
log.Info(err)
return
}
iri, err := url.Parse(to)
if err != nil {
log.Error("cannot parse url for POST, check your syntax")
return err
}
req.Header.Add("Accept-Charset", "utf-8")
req.Header.Add("Date", time.Now().UTC().Format("Mon, 02 Jan 2006 15:04:05")+" GMT")
req.Header.Add("User-Agent", userAgent+" "+version)
req.Header.Add("Host", iri.Host)
req.Header.Add("Accept", "application/activity+json; charset=utf-8")
req.Header.Add("Content-Type", "application/activity+json; charset=utf-8")
err = postSigner.SignRequest(a.privateKey, a.publicKeyID, req, byteCopy)
if err != nil {
log.Info(err)
return
}
resp, err := client.Do(req)
if err != nil {
log.Info(err)
return
}
defer resp.Body.Close()
if !isSuccess(resp.StatusCode) {
responseData, _ := ioutil.ReadAll(resp.Body)
err = fmt.Errorf("POST request to %s failed (%d): %s\nResponse: %s \nRequest: %s \nHeaders: %s", to, resp.StatusCode, resp.Status, FormatJSON(responseData), FormatJSON(byteCopy), FormatHeaders(req.Header))
log.Info(err)
return
}
responseData, _ := ioutil.ReadAll(resp.Body)
log.Errorf("POST request to %s succeeded (%d): %s \nResponse: %s \nRequest: %s \nHeaders: %s", to, resp.StatusCode, resp.Status, FormatJSON(responseData), FormatJSON(byteCopy), FormatHeaders(req.Header))
return
} |
////////////////////////////////////////////////////////////////////////////////
// Method utility functions
////////////////////////////////////////////////////////////////////////////////
func (st *State) mustGetDeal(rt Runtime, dealID abi.DealID) *DealProposal {
proposals, err := AsDealProposalArray(adt.AsStore(rt), st.Proposals)
if err != nil {
rt.Abortf(exitcode.ErrIllegalState, "get proposal: %v", err)
}
proposal, err := proposals.Get(dealID)
if err != nil {
rt.Abortf(exitcode.ErrIllegalState, "get proposal: %v", err)
}
return proposal
} |
import { IBuildedParamsCollection, IParamsResource } from '../interfaces';
import { Resource } from '../resource';
import { DocumentCollection } from '../document-collection';
export declare class Base {
static ParamsResource: IParamsResource;
static ParamsCollection: IBuildedParamsCollection;
static newCollection<R extends Resource = Resource>(): DocumentCollection<R>;
static isObjectLive(ttl: number, last_update: number): boolean;
static forEach<T extends {
[keyx: string]: any;
}>(collection: T, fc: (object: any, key?: string | number) => void): void;
}
|
Interfacial properties for real rough MEMS/NEMS surfaces by incorporating the electrostatic and Casimir effects–a theoretical study
This paper studied the adhesive properties of real rough micro/nano‐electromechanical systems (MEMS/NEMS) surfaces by considering the electrostatic force and the Casimir force theoretically, and an improved model has been proposed. A statistical approach for characterizing surface topography was used by taking the surface standard deviation, the asperity density and the radius of curvature into account. The effects of surface roughness on the electrostatic force and the Casimir force were analysed individually, and a comparison between the proposed model and existing models has been conducted. The whole adhesive force increases with the surface standard deviation, and the prediction by the proposed model becomes more in agreement with the one by existing models when the surface standard deviation is increased. The contribution of the Casimir force to the total adhesive force tends to vanish when the surface standard deviation is relatively large. The electrostatic force and the Casimir force contribute more to the total adhesive forces calculated based on the proposed model with the increase of the asperity density and the radius of curvature. Copyright © 2009 John Wiley & Sons, Ltd. |
def operator(self, name: str) -> "MockObj":
if name == "ref":
return MockObj(f"{self.base} &", "")
if name == "ptr":
return MockObj(f"{self.base} *", "")
if name == "const_ptr":
return MockObj(f"{self.base} *const", "")
if name == "const":
return MockObj(f"const {self.base}", "")
raise ValueError("Expected one of ref, ptr, const_ptr, const.") |
Spread the love
On Thursday, the Virginia-based Treatment Advocacy Center, an organization dedicated to eliminating the barriers faced by those with severe mental illnesses, released a jaw-dropping report. In their report titled, Overlooked in the Undercounted: The Role of Mental Illness in Fatal Law Enforcement Encounters, researchers discovered that people with an untreated mental illness are 16 times more likely to be killed during an interaction with police than anyone else.
According to the study, by all accounts – official and unofficial – a minimum of 1 in 4 fatal police encounters ends the life of an individual with severe mental illness.
Where official government data regarding police shootings and mental illness have been analyzed – in one U.S. city and several other Western countries – the findings indicate that mental health disorders are a factor in as many as 1 in 2 fatal law enforcement encounters.
This startling number highlights a critical problem with police and how they handle incidents with the mentally ill.
“If this were any other medical condition, people would be up in arms,” John Snook, the report’s co-author and executive director of the Treatment Advocacy Center said. “What we need to do is treat the person before the police are ever called. This is a mental illness, but we respond by calling the police and arresting a person.”
One would assume that since these numbers are so great, police have taken action and are training their officers to interact with the mentally ill. However, one would be wrong.
As the Free Thought Project has pointed out in the past, the overwhelming majority of time spent by police during training is devoted to shooting their weapons. Very little time is set aside for training in de-escalation tactics, and most departments receive zero training in dealing with the mentally ill.
Of course, the police responded to the study by playing the role of victim. “Police are being forced to be mental health counselors without training,” said Jim Pasco, executive director of the national Fraternal Order of Police, the largest police organization in the country.
Instead of addressing the problem by training police, Pasco invokes public pity, which is ignorant – and deadly.
Research shows that in instances involving officers who’ve been properly trained to deal with the mentally ill, the chances of that officer killing the individual are far less than an untrained cop.
In Miami-Dade County, about 4,600 officers have been trained in crisis intervention (CIT), Steven Leifman, an associate administrative judge in Florida’s Miami-Dade County Court, told USA Today. Before the program began, police were involved in the shooting of someone with mental illness about once a month. In the five years since the training began, there have been only four or five such shootings, he said.
In spite of this staggering decrease in police killing the mentally ill, cops across the country remain unconcerned with receiving CIT classes. Instead of training in how to resolve situations peacefully, they are learning how to defend themselves in court after they kill someone.
The power of police training can work wonders in all aspects of police work, as illustrated by the Round Rock police department in Austin, Texas. A simple 8-hour course turned their officers from dog killing machines to officers who stopped killing dogs. But for some reason, police continue to refuse to be trained.
“I am terrified to call the police when it involves my son,” said Candie Dalton, of Englewood, Colorado, whose 20-year-old son has schizophrenia.
According to Dalton, her son’s interactions with police have left him terrified of law enforcement. Dalton explained to USA Today that once, her son was the victim of a home invasion robbery. When her son was unable to articulate what had happened, police accused him of selling his possessions for drug money. Officers then arrested him because of an unpaid speeding ticket.
Luckily he wasn’t killed.
Unfortunately, countless other mentally ill people are not as fortunate and are killed by police on a near daily basis. Being pregnant, or unarmed and naked, or even being a child is not a defense from police officers who are untrained in interacting with the mentally ill. |
Rectus abdominis muscle strains in tennis players
Rectus abdominis muscle strains are common and debilitating injuries among competitive tennis players. Eccentric overload, followed by forced contraction of the non-dominant rectus abdominis during the cocking phase of the service motion is the accepted injury mechanism. A tennis-specific rehabilitation program emphasising eccentrics and plyometric strengthening of the abdominal wall muscles, contributes to the complete functional recovery in tennis players, and could help reduce recurrences. |
/**
* Base class of for all Smithy model nodes.
*
* <p>When loading a Smithy model the data is loaded from the source model
* file into a tree of nodes. These nodes represent the unvalidated
* structure of the model document.
*/
public abstract class Node implements FromSourceLocation, ToNode {
private static final JsonFactory JSON_FACTORY = new JsonFactory();
private static final DefaultNodeFactory NODE_FACTORY = new DefaultNodeFactory(JSON_FACTORY);
private final SourceLocation sourceLocation;
/**
* This is intentionally package-private to make Node a closed set
* of concrete classes and prevent it from being extended outside
* of this package.
*
* @param sourceLocation Where the node was sourced from.
*/
Node(SourceLocation sourceLocation) {
this.sourceLocation = Objects.requireNonNull(sourceLocation);
}
/**
* Attempts to parse the given JSON string and return a Node.
*
* @param json JSON text to parse.
* @return Returns the parsed Node on success.
* @throws ModelSyntaxException if the JSON text is invalid.
*/
public static Node parse(String json) {
return parse(json, "");
}
/**
* Attempts to parse the given JSON string and File Name and return a Node.
*
* @param json JSON text to parse.
* @param file Filename corresponding to json text
* @return Returns the parsed Node on success.
* @throws ModelSyntaxException if the JSON text is invalid.
*/
public static Node parse(String json, String file) {
return NODE_FACTORY.createNode(file, json);
}
/**
* Attempts to parse the given JSON string and File Name and return a Node.
*
* <p>This parser allows for comments in the JSON.
*
* @param json JSON text to parse.
* @param file Filename corresponding to json text
* @return Returns the parsed Node on success.
* @throws ModelSyntaxException if the JSON text is invalid.
*/
public static Node parseJsonWithComments(String json, String file) {
JsonFactory factory = new JsonFactory();
factory.enable(JsonParser.Feature.ALLOW_COMMENTS);
return new DefaultNodeFactory(factory).createNode(file, json);
}
/**
* Attempts to parse the given JSON string and return a Node.
*
* <p>This parser allows for comments in the JSON.
*
* @param json JSON text to parse.
* @return Returns the parsed Node on success.
* @throws ModelSyntaxException if the JSON text is invalid.
*/
public static Node parseJsonWithComments(String json) {
return parseJsonWithComments(json, "");
}
/**
* Writes the contents of a Node to a pretty-printed JSON string.
*
* <p>Use {@link DefaultNodeWriter} directly to customize the output,
* write directly to a file, etc.
*
* @param node Node to write.
* @return Returns the serialized Node.
*/
public static String prettyPrintJson(Node node) {
StringWriter writer = new StringWriter();
return printJson(node, createJsonParser(writer).setPrettyPrinter(new NodePrettyPrinter()), writer);
}
/**
* Writes the contents of a Node to a non-pretty-printed JSON string.
*
* @param node Node to write.
* @return Returns the serialized Node.
*/
public static String printJson(Node node) {
StringWriter writer = new StringWriter();
return printJson(node, createJsonParser(writer), writer);
}
private static JsonGenerator createJsonParser(StringWriter writer) {
try {
return JSON_FACTORY.createGenerator(writer);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
private static String printJson(Node node, JsonGenerator generator, StringWriter writer) {
try {
DefaultNodeWriter nodeWriter = new DefaultNodeWriter(generator);
node.accept(nodeWriter);
generator.close();
return writer.toString();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
/**
* Create a {@link StringNode} from a String value.
*
* @param value Value to create a node from.
* @return Returns the created StringNode.
*/
public static StringNode from(String value) {
return new StringNode(value, SourceLocation.none());
}
/**
* Create a {@link NumberNode} from a Number value.
*
* @param number Value to create a node from.
* @return Returns the created NumberNode.
*/
public static NumberNode from(Number number) {
return new NumberNode(number, SourceLocation.none());
}
/**
* Create a {@link BooleanNode} from a boolean value.
*
* @param value Value to create a node from.
* @return Returns the created BooleanNode.
*/
public static BooleanNode from(boolean value) {
return new BooleanNode(value, SourceLocation.none());
}
/**
* Creates an {@link ArrayNode} from a Collection of Node values.
*
* @param values String values to add to the ArrayNode.
* @return Returns the created ArrayNode.
*/
public static ArrayNode fromNodes(List<Node> values) {
return new ArrayNode(values, SourceLocation.none());
}
/**
* Creates an {@link ArrayNode} from a variadic list of Node values.
*
* @param values String values to add to the ArrayNode.
* @return Returns the created ArrayNode.
*/
public static ArrayNode fromNodes(Node... values) {
return fromNodes(Arrays.asList(values));
}
/**
* Creates an {@link ArrayNode} from a Collection of String values.
*
* @param values String values to add to the ArrayNode.
* @return Returns the created ArrayNode.
*/
public static ArrayNode fromStrings(Collection<String> values) {
return fromNodes(values.stream().map(Node::from).collect(Collectors.toList()));
}
/**
* Creates an {@link ArrayNode} from a variadic list of String values.
*
* @param values String values to add to the ArrayNode.
* @return Returns the created ArrayNode.
*/
public static ArrayNode fromStrings(String... values) {
return fromStrings(Arrays.asList(values));
}
/**
* Creates an {@link ObjectNode.Builder}.
*
* @return Returns the ObjectNode builder.
*/
public static ObjectNode.Builder objectNodeBuilder() {
return new ObjectNode.Builder();
}
/**
* Creates an empty {@link ObjectNode}.
* @return Returns the ObjectNode.
*/
public static ObjectNode objectNode() {
return ObjectNode.EMPTY;
}
/**
* Creates an {@link ObjectNode} from the given map of Nodes.
* @param values Values to add to the object node.
* @return Returns the created ObjectNode.
*/
public static ObjectNode objectNode(Map<StringNode, Node> values) {
return new ObjectNode(values, SourceLocation.none());
}
/**
* Creates an empty {@link ArrayNode}.
* @return Returns the ArrayNode.
*/
public static ArrayNode arrayNode() {
return ArrayNode.EMPTY;
}
/**
* Creates an {@link ArrayNode} from a variadic list of Nodes.
* @param nodes Nodes to add to the array.
* @return Returns the created ArrayNode.
*/
public static ArrayNode arrayNode(Node... nodes) {
return new ArrayNode(Arrays.asList(nodes), SourceLocation.none());
}
/**
* Creates a {@link NullNode}.
* @return Returns the NullNode.
*/
public static NullNode nullNode() {
return new NullNode(SourceLocation.none());
}
/**
* Expects an array of strings and returns the loaded strings.
*
* @param descriptor Name of the property being loaded.
* @param node Node to load.
* @return Returns the loaded strings.
* @throws SourceException on error.
*/
public static List<String> loadArrayOfString(String descriptor, Node node) {
return node.expectArrayNode("Expected `" + descriptor + "` to be an array of strings. Found {type}.")
.getElements().stream()
.map(element -> element.expectStringNode(
"Each element of `" + descriptor + "` must be a string. Found {type}."))
.map(StringNode::getValue)
.collect(Collectors.toList());
}
/**
* Testing helper used to compare two Nodes for equivalence.
*
* <p>Compares two Node values and throws if they aren't equal. The
* thrown exception contains a message that shows the differences
* between the two Nodes as returned by {@link #diff(ToNode, ToNode)}.
*
* @param actual Node to use as the starting node.
* @param expected Node to compare against.
* @throws ExpectationNotMetException if the nodes are not equivalent.
*/
public static void assertEquals(ToNode actual, ToNode expected) {
Node actualNode = actual.toNode();
Node expectedNode = expected.toNode();
if (!actualNode.equals(expectedNode)) {
throw new ExpectationNotMetException(String.format(
"Actual node did not match expected Node.%nActual:%n%s%nExpected:%n%s%nDiff: %s",
Node.prettyPrintJson(actualNode),
Node.prettyPrintJson(expectedNode),
String.join(System.lineSeparator(), diff(actualNode, expectedNode))), actualNode);
}
}
/**
* Computes the differences between two Nodes as a String.
*
* @param actual Node to use as the starting node.
* @param expected Node to compare against.
* @return Returns the differences as a String.
*/
public static List<String> diff(ToNode actual, ToNode expected) {
return NodeDiff.diff(actual, expected);
}
/**
* Gets the type of the node.
*
* @return Returns the node type.
*/
public abstract NodeType getType();
/**
* Accepts a visitor with the node.
*
* @param visitor Visitor to dispatch to.
* @param <R> visitor return type.
* @return Returns the accepted result.
*/
public abstract <R> R accept(NodeVisitor<R> visitor);
/**
* Checks if this node is an object type.
*
* @return Returns true if this node is an object type.
*/
public final boolean isObjectNode() {
return getType() == NodeType.OBJECT;
}
/**
* Checks if this node is an array type.
*
* @return Returns true if this node is an array type.
*/
public final boolean isArrayNode() {
return getType() == NodeType.ARRAY;
}
/**
* Checks if this node is a string type.
*
* @return Returns true if this node is a string type.
*/
public final boolean isStringNode() {
return getType() == NodeType.STRING;
}
/**
* Checks if this node is a number type.
*
* @return Returns true if this node is a number type.
*/
public final boolean isNumberNode() {
return getType() == NodeType.NUMBER;
}
/**
* Checks if this node is a boolean type.
*
* @return Returns true if this node is a boolean type.
*/
public final boolean isBooleanNode() {
return getType() == NodeType.BOOLEAN;
}
/**
* Checks if this node is a null type.
*
* @return Returns true if this node is a null type.
*/
public final boolean isNullNode() {
return getType() == NodeType.NULL;
}
/**
* Gets the node as an ObjectNode if it is an object.
*
* @return Returns the optional object node.
*/
public Optional<ObjectNode> asObjectNode() {
return Optional.empty();
}
/**
* Gets the node as an ArrayNode if it is an array.
*
* @return Returns the optional array node.
*/
public Optional<ArrayNode> asArrayNode() {
return Optional.empty();
}
/**
* Gets the node as an StringNode if it is an string.
*
* @return Returns the optional StringNode.
*/
public Optional<StringNode> asStringNode() {
return Optional.empty();
}
/**
* Gets the node as an BooleanNode if it is an boolean.
*
* @return Returns the optional BooleanNode.
*/
public Optional<BooleanNode> asBooleanNode() {
return Optional.empty();
}
/**
* Gets the node as an NumberNode if it is an number.
*
* @return Returns the optional NumberNode.
*/
public Optional<NumberNode> asNumberNode() {
return Optional.empty();
}
/**
* Gets the node as an NullNode if it is a null.
*
* @return Returns the optional NullNode.
*/
public Optional<NullNode> asNullNode() {
return Optional.empty();
}
/**
* Casts the current node to an {@code ObjectNode}.
*
* @return Returns an object node.
* @throws ExpectationNotMetException when the node is not an {@code ObjectNode}.
*/
public final ObjectNode expectObjectNode() {
return expectObjectNode(null);
}
/**
* Casts the current node to an {@code ObjectNode}, throwing
* {@link ExpectationNotMetException} when the node is the wrong type.
*
* @param message Error message to use if the node is of the wrong type.
* @return Returns an object node.
* @throws ExpectationNotMetException when the node is not an {@code ObjectNode}.
*/
public ObjectNode expectObjectNode(String message) {
throw new ExpectationNotMetException(expandMessage(message, NodeType.OBJECT.toString()), this);
}
/**
* Casts the current node to an {@code ArrayNode}.
*
* @return Returns an array node.
* @throws ExpectationNotMetException when the node is not an {@code ArrayNode}.
*/
public final ArrayNode expectArrayNode() {
return expectArrayNode(null);
}
/**
* Casts the current node to an {@code ArrayNode}, throwing
* {@link ExpectationNotMetException} when the node is the wrong type.
*
* @param message Error message to use if the node is of the wrong type.
* @return Returns an array node.
* @throws ExpectationNotMetException when the node is the wrong type.
*/
public ArrayNode expectArrayNode(String message) {
throw new ExpectationNotMetException(expandMessage(message, NodeType.ARRAY.toString()), this);
}
/**
* Casts the current node to a {@code StringNode}.
*
* @return Returns a string node.
* @throws ExpectationNotMetException when the node is the wrong type.
*/
public final StringNode expectStringNode() {
return expectStringNode(null);
}
/**
* Casts the current node to a {@code StringNode}, throwing
* {@link ExpectationNotMetException} when the node is the wrong type.
*
* @param message Error message to use if the node is of the wrong type.
* @return Returns a string node.
* @throws ExpectationNotMetException when the node is the wrong type.
*/
public StringNode expectStringNode(String message) {
throw new ExpectationNotMetException(expandMessage(message, NodeType.STRING.toString()), this);
}
/**
* Casts the current node to a {@code NumberNode}.
*
* @return Returns a number node.
* @throws ExpectationNotMetException when the node is the wrong type.
*/
public final NumberNode expectNumberNode() {
return expectNumberNode(null);
}
/**
* Casts the current node to a {@code NumberNode}, throwing
* {@link ExpectationNotMetException} when the node is the wrong type.
*
* @param message Error message to use if the node is of the wrong type.
* @return Returns a number node.
* @throws ExpectationNotMetException when the node is the wrong type.
*/
public NumberNode expectNumberNode(String message) {
throw new ExpectationNotMetException(expandMessage(message, NodeType.NUMBER.toString()), this);
}
/**
* Casts the current node to a {@code BooleanNode}.
*
* @return Returns a boolean node.
* @throws ExpectationNotMetException when the node is the wrong type.
*/
public final BooleanNode expectBooleanNode() {
return expectBooleanNode(null);
}
/**
* Casts the current node to a {@code BooleanNode}, throwing
* {@link ExpectationNotMetException} when the node is the wrong type.
*
* @param message Error message to use if the node is of the wrong type.
* @return Returns a boolean node.
* @throws ExpectationNotMetException when the node is the wrong type.
*/
public BooleanNode expectBooleanNode(String message) {
throw new ExpectationNotMetException(expandMessage(message, NodeType.BOOLEAN.toString()), this);
}
/**
* Casts the current node to a {@code NullNode}.
*
* @return Returns a null node.
* @throws ExpectationNotMetException when the node is the wrong type.
*/
public final NullNode expectNullNode() {
return expectNullNode(null);
}
/**
* Casts the current node to a {@code NullNode}, throwing
* {@link ExpectationNotMetException} when the node is the wrong type.
*
* @param message Error message to use if the node is of the wrong type.
* @return Returns a null node.
* @throws ExpectationNotMetException when the node is the wrong type.
*/
public NullNode expectNullNode(String message) {
throw new ExpectationNotMetException(expandMessage(message, NodeType.NULL.toString()), this);
}
@Override
public final SourceLocation getSourceLocation() {
return sourceLocation;
}
@Override
public final Node toNode() {
return this;
}
private String expandMessage(String message, String expectedType) {
return (message == null
? format("Expected %s, but found {type}.", expectedType)
: message).replace("{type}", getType().toString());
}
/**
* Returns a node with sorted keys and sorted keys of all nested object
* nodes.
*
* @return Returns the node in which all object nodes have sorted keys.
*/
public final Node withDeepSortedKeys() {
return withDeepSortedKeys(Comparator.comparing(StringNode::getValue));
}
/**
* Returns a node with sorted keys and sorted keys of all nested object
* nodes using a custom comparator.
*
* @param keyComparator Compares keys.
* @return Returns the node in which all object nodes have sorted keys.
*/
public final Node withDeepSortedKeys(Comparator<StringNode> keyComparator) {
return sortNode(this, keyComparator);
}
private static Node sortNode(Node node, Comparator<StringNode> keyComparator) {
return node.accept(new NodeVisitor.Default<Node>() {
@Override
protected Node getDefault(Node node) {
return node;
}
@Override
public Node objectNode(ObjectNode node) {
Map<StringNode, Node> members = new TreeMap<>(keyComparator);
node.getMembers().forEach((k, v) -> members.put(k, sortNode(v, keyComparator)));
return new ObjectNode(members, node.getSourceLocation());
}
@Override
public Node arrayNode(ArrayNode node) {
return node.getElements().stream()
.map(element -> sortNode(element, keyComparator))
.collect(ArrayNode.collect(node.getSourceLocation()));
}
});
}
} |
<gh_stars>0
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ANDROID_WEBVIEW_BROWSER_GPU_MEMORY_BUFFER_IMPL_H_
#define ANDROID_WEBVIEW_BROWSER_GPU_MEMORY_BUFFER_IMPL_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "ui/gfx/size.h"
#include "ui/gl/gpu_memory_buffer.h"
struct AwDrawGLFunctionTable;
namespace android_webview {
class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer {
public:
static void SetAwDrawGLFunctionTable(AwDrawGLFunctionTable* table);
GpuMemoryBufferImpl(gfx::Size size);
virtual ~GpuMemoryBufferImpl();
// methods from GpuMemoryBuffer
virtual void Map(gfx::GpuMemoryBuffer::AccessMode mode,
void** vaddr) OVERRIDE;
virtual void Unmap() OVERRIDE;
virtual void* GetNativeBuffer() OVERRIDE;
virtual uint32 GetStride() OVERRIDE;
private:
int buffer_id_;
gfx::Size size_;
DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferImpl);
};
} // namespace android_webview
#endif // ANDROID_WEBVIEW_BROWSER_GPU_MEMORY_BUFFER_IMPL_H_
|
import Axios from "axios";
import child_process from "child_process";
export async function fetchBuffer(Host: string, Header?: {[key: string]: string}): Promise<Buffer> {
let Headers = {...(Header||{})};
return await Axios.get(Host, {
headers: Headers,
responseEncoding: "binary",
responseType: "arraybuffer"
}).then(async res => Buffer.from(res.data));
}
export async function RAW_TEXT(Host: string, Header?: {[key: string]: string}): Promise<string> {
if (/minecraft\.net/.test(Host)) {
const curlData = child_process.execFileSync("curl", ["-s", "-L", "-H", "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36", Host], {stdio: "pipe"}).toString("utf8");
return curlData;
}
const Data = await fetchBuffer(Host, Header);
return String(Data.toString("utf8"));
}
export async function getJson(Host: string, Header?: {[key: string]: string}): Promise<any> {
const Data = await fetchBuffer(Host, Header);
return JSON.parse(Data.toString("utf8"));
}
export async function HTML_URLS(Host: string, Header?: {[key: string]: string}) {
return (await RAW_TEXT(Host, Header)).split(/["'<>]/gi).filter(Line => /^.*:\/\//.test(Line.trim()));
}
type githubRelease = {
url: string;
assets_url: string;
upload_url: string;
html_url: string;
id: number;
tarball_url: string;
zipball_url: string;
body: string;
author: {
login: string;
id: number;
node_id: string;
avatar_url: string;
gravatar_id: string;
url: string;
html_url: string;
followers_url: string;
following_url: string;
gists_url: string;
starred_url: string;
subscriptions_url: string;
organizations_url: string;
repos_url: string;
events_url: string;
received_events_url: string;
type: string;
site_admin: boolean;
};
node_id: string;
tag_name: string;
target_commitish: string;
name: string;
draft: boolean;
prerelease: boolean;
created_at: string;
published_at: string;
assets: Array<{
url: string;
id: number;
node_id: string;
name: string;
label: string;
content_type: string;
state: string;
size: number;
download_count: number;
created_at: string;
updated_at: string;
browser_download_url: string;
uploader: {
login: string;
id: number;
node_id: string;
avatar_url: string;
gravatar_id: string;
url: string;
html_url: string;
followers_url: string;
following_url: string;
gists_url: string;
starred_url: string;
subscriptions_url: string;
organizations_url: string;
repos_url: string;
events_url: string;
received_events_url: string;
type: string;
site_admin: boolean;
};
}>;
};
export async function GithubRelease(Repository: string): Promise<Array<githubRelease>> {
if (!Repository) throw new Error("Repository is required");
return JSON.parse(await RAW_TEXT(`https://api.github.com/repos/${Repository}/releases?per_page=100`));
}
|
#ifndef SENSOR_MANAGER_H_
#define SENSOR_MANAGER_H_
#include <ros/ros.h>
class SensorManager
{
public:
SensorManager(ros::NodeHandle& n, double hz);
~SensorManager(){};
void spin();
private:
double delta_t_;
double internal_timer_;
bool facing_obstacle_;
ros::Publisher bumper_publisher_;
ros::Publisher laser_publisher_;
ros::Publisher wheel_drop_publisher_;
int8_t read_bumper();
int8_t read_laser();
int8_t read_wheels();
};
#endif /*SENSOR_MANAGER_H_*/
|
// Copyright 2020 The searKing Author. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package resilience
//go:generate stringer -type TaskState -trimprefix=TaskState
//go:generate jsonenums -type TaskState
type TaskState int
const (
TaskStateNew TaskState = iota // Task state for a task which has not yet started.
TaskStateRunning // Task state for a running task. A task in the running state is executing in the Go routine but it may be waiting for other resources from the operating system such as processor.
TaskStateDoneErrorHappened // Task state for a terminated state. The task has completed execution with some errors happened
TaskStateDoneNormally // Task state for a terminated state. The task has completed execution normally
TaskStateDormancy // Task state for a terminated state. The task has completed execution normally and will be started if New's called
TaskStateDeath // Task state for a terminated state. The task has completed execution normally and will never be started again
TaskStateButt
)
|
#include "Window.h"
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
Window::Window(int width, int height, std::string title) {
this->width = width;
this->height = height;
this->title = title;
this->game_start = false;
this->game_over = false;
this->game_restart = false;
window = createWindow(width, height, title);
if (!window) {
throw "Unable to create a window. ";
}
setupGui();
int my_image_width = 0;
int my_image_height = 0;
this->my_image_texture = 0;
bool ret = LoadTextureFromFile("textures/mainpage.jpg", &my_image_texture, &my_image_width, &my_image_height);
IM_ASSERT(ret);
this->my_image_logo = 0;
ret = LoadTextureFromFile("textures/logo.png", &my_image_logo, &my_image_width, &my_image_height);
IM_ASSERT(ret);
}
Window::~Window() {
// cleanup Gui
cleanupGui();
// Destroy the window.
glfwDestroyWindow(window);
// Terminate GLFW.
glfwTerminate();
}
GLFWwindow* Window::createWindow(int width, int height, std::string title)
{
// Initialize GLFW.
if (!glfwInit())
{
std::cerr << "Failed to initialize GLFW" << std::endl;
return NULL;
}
// 4x antialiasing.
glfwWindowHint(GLFW_SAMPLES, 4);
#ifdef __APPLE__
// Apple implements its own version of OpenGL and requires special treatments
// to make it uses modern OpenGL.
// Ensure that minimum OpenGL version is 3.3
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
// Enable forward compatibility and allow a modern OpenGL context
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
#endif
// Create the GLFW window.
GLFWwindow* window = glfwCreateWindow(width, height, title.c_str(), NULL, NULL);
// unresizable window
glfwSetWindowSizeLimits(window, this->width, this->height, this->width, this->height);
// Check if the window could not be created.
if (!window)
{
std::cerr << "Failed to open GLFW window." << std::endl;
glfwTerminate();
return NULL;
}
// Make the context of the window.
glfwMakeContextCurrent(window);
#ifndef __APPLE__
// On Windows and Linux, we need GLEW to provide modern OpenGL functionality.
// Initialize GLEW.
if (glewInit())
{
std::cerr << "Failed to initialize GLEW" << std::endl;
return NULL;
}
#endif
// Set swap interval to 1.
glfwSwapInterval(0);
return window;
}
GLFWwindow* Window::getWindow() {
return this->window;
}
void Window::setGameStart(bool start){
game_start = start;
}
void Window::setGameOver(bool over){
game_over = over;
}
void Window::setId(int player_id){
user_id = player_id;
}
void Window::setPlayerNum(int num){
player_num = num;
}
void Window::setTime(std::string t){
time = t;
}
void Window::setScore(int s){
score = s;
}
void Window::setOppoScore(int os) {
oppo_score = os;
}
bool Window::getRestart(){
return game_restart;
}
void Window::updateWindow() {
// Gets events, including input such as keyboard and mouse or window resizing
glfwPollEvents();
// Swap buffers.
glfwSwapBuffers(window);
}
void Window::displayCallback()
{
// feed inputs to dear imgui, start new frame
if(game_start && !game_over){
game_restart = false;
std::string player_type = "uninitialize";
std::string player_team = "uninitialize";
std::string opponent_team = "uninitialize";
ImGui::Begin("Player Info");
if(user_id == 1 || user_id == 2){
player_type = "Sphere Player";
}
else if(user_id == 3 || user_id == 4){
player_type = "Terrain Player";
}
else{
//std::cout << "unrecognized id" << std::endl;
}
if(user_id == 1 || user_id == 3){
player_team = "Team Yellow";
opponent_team = "Team Blue";
}
else if(user_id == 2 || user_id == 4){
player_team = "Team Blue";
opponent_team = "Team Yellow";
}
else{
//std::cout << "unrecognized id" << std::endl;
}
ImGui::SetWindowFontScale(1.8);
ImGui::Text("Player Type: %s", player_type.c_str());
ImGui::Text("Player Team: %s", player_team.c_str());
ImGui::End();
ImGui::Begin("Time");
ImGui::SetWindowFontScale(1.8);
ImGui::Text("Remaining time: %s", time.c_str());
ImGui::End();
ImGui::Begin("Score Board");
ImGui::SetWindowFontScale(1.8);
if (player_team.compare("Team Yellow") == 0) {
ImGui::Text("->%s score<-: %d", player_team.c_str(), score);
ImGui::Text(" %s score : %d", opponent_team.c_str(), oppo_score);
}
else {
ImGui::Text("->%s score<-: %d", player_team.c_str(), score);
ImGui::Text(" %s score : %d", opponent_team.c_str(), oppo_score);
}
ImGui::End();
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.0f, 0.0f, 0.0f, 0.0f));
ImGui::Begin("Gaia");
ImGui::Image((void*)(intptr_t)my_image_logo, ImVec2(200, 100));
ImGui::PopStyleColor();
ImGui::End();
}
else if(game_over){
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.1f, 0.1f, 0.12f, 1.0f));
ImGui::Begin("Times out");
ImGui::Image((void*)(intptr_t)my_image_texture, ImVec2(1800, 1000));
ImGui::PopStyleColor();
ImGui::End();
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.0f, 0.0f, 0.0f, 0.0f));
ImGui::Begin("Game Over!");
ImGui::SetWindowFontScale(1.8);
ImGui::NewLine();
if (score > oppo_score) {
ImGui::Text("You Win!!!");
ImGui::Text("Your final score is: %d", score);
}
else if (score < oppo_score) {
ImGui::Text("You Lose!!!");
ImGui::Text("Your final score is: %d", score);
}
else{
ImGui::Text("It's a Tie!!!");
ImGui::Text("Your final score is: %d", score);
}
ImGui::NewLine();
ImGui::Text("Thanks for playing!");
ImGui::NewLine();
if(ImGui::Button("Restart")){
game_restart = true;
}
if(ImGui::Button("Quit")){
glfwSetWindowShouldClose(window, GL_TRUE);
}
if(game_restart){
ImGui::NewLine();
ImGui::Text("Waiting for other players...");
}
ImGui::PopStyleColor();
ImGui::End();
}
else if(!game_start){
game_restart = false;
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.1f, 0.1f, 0.12f, 1.0f));
ImGui::Begin("Welcome");
std::string player_type = "uninitialize";
std::string player_team = "uninitialize";
if(user_id == 1 || user_id == 2){
player_type = "Sphere Player";
}
else if(user_id == 3 || user_id == 4){
player_type = "Terrain Player";
}
else{
//std::cout << "unrecognized id" << std::endl;
}
if(user_id == 1 || user_id == 3){
player_team = "Team Yellow";
}
else if(user_id == 2 || user_id == 4){
player_team = "Team Blue";
}
else{
//std::cout << "unrecognized id" << std::endl;
}
if(player_num == 0){
player_num = user_id;
}
ImGui::Image((void*)(intptr_t)my_image_texture, ImVec2(1800, 1000));
ImGui::PopStyleColor();
ImGui::End();
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.0f, 0.0f, 0.0f, 0.0f));
ImGui::Begin("Welcome to Gaia");
ImGui::SetWindowFontScale(1.8);
ImGui::NewLine();
ImGui::Text("Waiting for players to join...");
ImGui::NewLine();
ImGui::Text("You are: %s", player_type.c_str());
ImGui::Text("Your team: %s", player_team.c_str());
ImGui::NewLine();
ImGui::Text("Current players joined: %d", player_num);
ImGui::PopStyleColor();
ImGui::End();
}
}
std::pair<int, int> Window::getFrameBufferSize() {
int width = this->width;
int height = this->height;
#ifdef __APPLE__
// In case your Mac has a retina display.
glfwGetFramebufferSize(window, &width, &height);
#endif
return std::pair<int, int>(width, height);
}
void Window::setupGui() {
// Setup Dear ImGui context
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO &io = ImGui::GetIO();
// Setup Platform/Renderer bindings
ImGui_ImplGlfw_InitForOpenGL(window, true);
const char* glsl_version = "#version 330";
ImGui_ImplOpenGL3_Init(glsl_version);
// Setup Dear ImGui style
ImGui::StyleColorsDark();
}
bool Window::LoadTextureFromFile(const char* filename, GLuint* out_texture, int* out_width, int* out_height)
{
// Load from file
int image_width = 0;
int image_height = 0;
unsigned char* image_data = stbi_load(filename, &image_width, &image_height, NULL, 4);
if (image_data == NULL)
return false;
// Create a OpenGL texture identifier
GLuint image_texture;
glGenTextures(1, &image_texture);
glBindTexture(GL_TEXTURE_2D, image_texture);
// Setup filtering parameters for display
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Upload pixels into texture
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image_width, image_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, image_data);
stbi_image_free(image_data);
*out_texture = image_texture;
*out_width = image_width;
*out_height = image_height;
return true;
}
void Window::cleanupGui() {
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplGlfw_Shutdown();
ImGui::DestroyContext();
}
|
This will probably cause some friction.
Sadie Robinson, 29, allegedly tried to burn down the Warrensburg, N.Y. apartment she shares with her boyfriend, Peter Moody, and their two children by placing a can of WD-40 lubricant in the oven at 400 degrees, WNYT reported.
Police say Robinson attempted to set the fire Monday morning, while Moody was asleep in the apartment, Hudson Valley YNN reports. Steven Stockdale, a lieutenant with the Warren County Sheriff’s Criminal Investigations Unit, told the station that after turning on the oven, Robinson fled with the children -- ages 15 months and 3 months -- and headed to the airport.
Moody told deputies he awoke to find the home completely filled with smoke, and quickly realized his girlfriend and children were missing.
Deputies located Robinson a few hours later, attempting to get on a plane to Florida with the kids. According to the North Country Gazette, she had purchased the tickets -- and also withdrawn $2,500 cash -- with an IRS refund card she had stolen from Moody.
Lt. Stockade told the Post Star that the can could have ignited if the temperature had gotten hot enough.
“It does have a flashpoint and could have caused an explosion,” he said.
Stockdale also noted that authorities believe Robinson tried to set the fire because of "a problem in their relationship."
Moody suffered no injuries in the incident, and damages to the home are minimal. |
package carry;
import org.json.JSONObject;
public interface OnSuccessListener
{
public void onSuccess(JSONObject results);
}
|
package org.interonet.mercury.domain.ldm.pool;
import org.interonet.mercury.domain.ldm.task.LDMTaskReturn;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Future;
public class LDMTaskFuturePool {
Logger logger = LoggerFactory.getLogger(LDMTaskFuturePool.class);
private List<Future<LDMTaskReturn>> futureTaskList = new ArrayList<>();
synchronized public boolean submit(Future<LDMTaskReturn> futureTask) {
return futureTaskList.add(futureTask);
}
synchronized public List<Future<LDMTaskReturn>> consumeAllFinishedTask() {
List<Future<LDMTaskReturn>> list = new ArrayList<>();
for (Future<LDMTaskReturn> futureTask : futureTaskList) {
if (futureTask.isDone())
list.add(futureTask);
}
futureTaskList.removeAll(list);
return list;
}
synchronized public int getPoolSize() {
return futureTaskList.size();
}
}
|
/*
* Interrupt handler.
*
* This routine will call the corresponding ISR for the
* requested interrupt vector. HAL code must call this
* routine with scheduler locked.
*/
void
irq_handler(int vector)
{
struct irq *irq;
int rc;
irq = irq_table[vector];
if (irq == NULL) {
DPRINTF(("Random interrupt ignored\n"));
return;
}
ASSERT(irq->isr != NULL);
irq->count++;
rc = (*irq->isr)(irq->data);
if (rc == INT_CONTINUE) {
ASSERT(irq->ist != IST_NONE);
irq->istreq++;
sched_wakeup(&irq->istevt);
ASSERT(irq->istreq != 0);
}
} |
/**
* A method to test that removal of a HistoryItem that isn't already in the list. This is an edge case test, which
* should just be ignored silently, but it's worth testing just to ensure no 'ugly' undesired behaviour occurs, such
* as exceptions being thrown.
*
* @throws Exception an exception that is not expected to be thrown, but if thrown, will cause the method to be
* marked as 'failed' in the JUnit tests panel, indicating the user to an evident issue in the test.
*/
@Test
public void testRemoveNonexistentItem() throws Exception {
historyManager.removeItem(historyItem);
} |
// Rest API handle user-app termination call-back notification
func appTerminationNotificationCallback(w http.ResponseWriter, r *http.Request) {
var notification asc.AppTerminationNotification
decoder := json.NewDecoder(r.Body)
err := decoder.Decode(¬ification)
if err != nil {
log.Error(err.Error())
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
log.Info("Received user-app termination notification")
appActivityLogs = append(appActivityLogs, "Received user-app termination notification")
w.WriteHeader(http.StatusOK)
terminateNotification = true
demoAppInfo.MecTerminated = true
Terminate()
} |
/**
* 持久化 function 的 Hook
* 在某些场景中,你可能会需要用 useCallback 记住一个回调,
* 但由于内部函数必须经常重新创建,记忆效果不是很好,导致子组件重复 render。
* 对于超级复杂的子组件,重新渲染会对性能造成影响。通过 usePersistFn,可以保证函数地址永远不会变化。
*/
import { useCallback, useRef } from 'react';
export type noop = (...args: any[]) => any;
function usePersistFn<T extends noop>(fn: T) {
/**
* 声明当前ref;
*/
const ref = useRef<any>(() => {
throw new Error('Cannot call function while rendering.');
});
// 将fn赋值给ref
ref.current = fn;
// 定一个地址不边的function
const persistFn = useCallback(((...args) => ref.current(...args)) as T, [ref]);
return persistFn;
}
export default usePersistFn;
|
def parse_oltpbench_data(results_dir):
env_metadata = _parse_jenkins_env_vars()
files_metadata, timestamp, benchmark_type, parameters, metrics = parse_oltpbench_files(
results_dir)
metadata = {**env_metadata, **files_metadata}
return metadata, timestamp, benchmark_type, parameters, metrics |
// work out the correct spelling to use in the Token object being created by new_token()
// the spelling is a valid token and kind is its kind
string correct_spelling(TokenKind kind,string spelling)
{
if(kind==tk_label){
return spelling.substr(1, spelling.length()-2);
}else{
return spelling;
}
} |
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Volumes/Personal/Documents/raspi-config/client-framework/build/j2oSources/com/google/common/xml/XmlEscapers.java
//
#include "J2ObjC_header.h"
#pragma push_macro("INCLUDE_ALL_ComGoogleCommonXmlXmlEscapers")
#ifdef RESTRICT_ComGoogleCommonXmlXmlEscapers
#define INCLUDE_ALL_ComGoogleCommonXmlXmlEscapers 0
#else
#define INCLUDE_ALL_ComGoogleCommonXmlXmlEscapers 1
#endif
#undef RESTRICT_ComGoogleCommonXmlXmlEscapers
#if __has_feature(nullability)
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wnullability-completeness"
#endif
#if !defined (ComGoogleCommonXmlXmlEscapers_) && (INCLUDE_ALL_ComGoogleCommonXmlXmlEscapers || defined(INCLUDE_ComGoogleCommonXmlXmlEscapers))
#define ComGoogleCommonXmlXmlEscapers_
@class ComGoogleCommonEscapeEscaper;
@interface ComGoogleCommonXmlXmlEscapers : NSObject
#pragma mark Public
+ (ComGoogleCommonEscapeEscaper *)xmlAttributeEscaper;
+ (ComGoogleCommonEscapeEscaper *)xmlContentEscaper;
@end
J2OBJC_STATIC_INIT(ComGoogleCommonXmlXmlEscapers)
FOUNDATION_EXPORT ComGoogleCommonEscapeEscaper *ComGoogleCommonXmlXmlEscapers_xmlContentEscaper();
FOUNDATION_EXPORT ComGoogleCommonEscapeEscaper *ComGoogleCommonXmlXmlEscapers_xmlAttributeEscaper();
J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonXmlXmlEscapers)
#endif
#if __has_feature(nullability)
#pragma clang diagnostic pop
#endif
#pragma pop_macro("INCLUDE_ALL_ComGoogleCommonXmlXmlEscapers")
|
<reponame>gabrielklein/ESP-EFTCore<filename>src/module/MLedRGB.h
//
// This class is used to get current time.
//
#ifndef EFT_MLEDRGB_H
#define EFT_MLEDRGB_H
#include <Arduino.h>
#include <WiFiUdp.h>
#include <ESP8266WiFi.h>
#include "../comm/IComm.h"
#include "../comm/ServerUtil.h"
namespace eft {
class MLedRGB : public IComm {
public:
MLedRGB(int pinR,int pinG,int pinB);
~MLedRGB();
void setup(String nameAP, String nameFX, Config *config);
String commType();
void commFx(JsonObject *o, JsonArray *ja);
void commWebServer(ESP8266WebServer *webServer, MQTT *mqtt);
void loop();
void servRGB();
void mqttRGB(String mess);
void rgb(bool r, bool g, bool b);
private:
ESP8266WebServer *webServer;
MQTT *mqtt;
String nameFX;
int pinR;
int pinG;
int pinB;
int pinStatusR = 0;
int pinStatusG = 0;
int pinStatusB = 0;
};
}
#endif
|
# '''
# Created on Feb 2, 2014
#
# @author: Chris
#
# TODO:
# - test no argparse module
# - test argparse in main
# - test argparse in try/catch
# -
#
# '''
#
# import os
# import ast
# import unittest
# from gooey.python_bindings import source_parser
#
#
# basic_pyfile = \
# '''
# import os
#
# def say_jello():
# print "Jello!"
#
# def main():
# print "hello!"
# parser = ArgumentParser(description='Example Argparse Program', formatter_class=RawDescriptionHelpFormatter)
# parser.add_argument("filename", help="filename")
# parser.add_argument("-r", "--recursive", dest="recurse", action="store_true",
# help="recurse into subfolders [default: %(default)s]")
# parser.add_argument("-v", "--verbose", dest="verbose", action="count",
# help="set verbosity level [default: %(default)s]")
# parser.add_argument("-i", "--include", action="append",
# help="only include paths matching this regex pattern. Note: exclude is given preference over include. [default: %(default)s]",
# metavar="RE")
# parser.add_argument("-m", "--mycoolargument", help="mycoolargument")
# parser.add_argument("-e", "--exclude", dest="exclude",
# help="exclude paths matching this regex pattern. [default: %(default)s]", metavar="RE")
# parser.add_argument('-V', '--version', action='version')
# parser.add_argument('-T', '--tester', choices=['yes', 'no'])
# parser.add_argument(dest="paths", help="paths to folder(s) with source file(s) [default: %(default)s]",
# metavar="path", nargs='+')
#
# if __name__ == '__main__':
# main()
# '''
#
#
#
# class TestSourceParser(unittest.TestCase):
# PATH = os.path.join(os.path.dirname(__file__), 'examples')
#
# def module_path(self, name):
# return os.path.join(self.PATH, name)
#
# def setUp(self):
# self._mockapp = self.module_path('examples.py')
# self._module_with_noargparse = self.module_path('module_with_no_argparse.py')
# self._module_with_arparse_in_try = self.module_path('TODO.py')
# self._module_with_argparse_in_main = self.module_path('example_argparse_souce_in_main.py')
#
# def test_should_throw_parser_exception_if_no_argparse_found_in_module(self):
# with self.assertRaises(source_parser.ParserError):
# source_parser.parse_source_file(self._module_with_noargparse)
#
#
# def test_find_main(self):
# example_source = '''
# def main(): pass
# '''
# nodes = ast.parse(example_source)
# main_node = source_parser.find_main(nodes)
# self.assertEqual('main', main_node.name)
#
#
# def test_find_main_throws_exception_if_not_found(self):
# example_source = '''
# def some_cool_function_that_is_not_main(): pass
# '''
# with self.assertRaises(source_parser.ParserError):
# nodes = ast.parse(example_source)
# main_node = source_parser.find_main(nodes)
# self.assertEqual('main', main_node.name)
#
#
# def test_find_try_blocks_finds_all_tryblock_styles(self):
# example_source = '''
# try: a = 1
# except: pass
#
# try: pass
# finally: pass
#
# try: pass
# except: pass
# else: pass
# '''
# nodes = ast.parse(example_source)
# try_blocks = source_parser.find_try_blocks(nodes)
# self.assertEqual(3, len(try_blocks))
#
#
# def test_find_try_blocks_returns_empty_if_no_blocks_present(self):
# example_source = 'def main(): pass'
# nodes = ast.parse(example_source)
# result = source_parser.find_try_blocks(nodes)
# self.assertEqual(list(), result)
#
# def test_find_argparse_located_object_when_imported_by_direct_name(self):
# example_source = '''
# def main():
# parser = ArgumentParser(description='Example Argparse Program', formatter_class=RawDescriptionHelpFormatter)
# '''
# nodes = ast.parse(example_source)
# main_node = source_parser.find_main(nodes)
# self.assertEqual('main', main_node.name)
# containing_block = source_parser.find_block_containing_argparse([main_node])
# self.assertTrue(containing_block is not None)
#
# def test_find_argparse_located_object_when_access_through_module_dot_notation(self):
# example_source = '''
# def main():
# parser = argparse.ArgumentParser(description='Example Argparse Program', formatter_class=RawDescriptionHelpFormatter)
# '''
# nodes = ast.parse(example_source)
# main_node = source_parser.find_main(nodes)
# self.assertEqual('main', main_node.name)
# containing_block = source_parser.find_block_containing_argparse([main_node])
# self.assertTrue(containing_block is not None)
#
# def test_find_argparse_locates_assignment_stmnt_in_main(self):
# nodes = ast.parse(source_parser._openfile(self._module_with_argparse_in_main))
# main_node = source_parser.find_main(nodes)
# self.assertEqual('main', main_node.name)
# containing_block = source_parser.find_block_containing_argparse([main_node])
# self.assertTrue(containing_block is not None)
# self.assertEqual('main', containing_block.name)
#
#
# def test_find_argparse_locates_assignment_stmnt_in_try_block(self):
# nodes = ast.parse(source_parser._openfile(self._module_with_arparse_in_try))
# main_node = source_parser.find_main(nodes)
# self.assertEqual('main', main_node.name)
# try_nodes = source_parser.find_try_blocks(main_node)
# self.assertTrue(len(try_nodes) > 0)
# containing_block = source_parser.find_block_containing_argparse([main_node] + try_nodes)
# self.assertEqual(ast.TryExcept, type(containing_block))
#
#
# def test_find_argparse_throws_exception_if_not_found(self):
# with self.assertRaises(source_parser.ParserError):
# nodes = ast.parse(source_parser._openfile(self._module_with_noargparse))
# main_node = source_parser.find_main(nodes)
# self.assertEqual('main', main_node.name)
# try_nodes = source_parser.find_try_blocks(main_node)
# containing_block = source_parser.find_block_containing_argparse([main_node] + try_nodes)
#
#
# def test_has_instantiator_returns_true_if_object_found(self):
# source = '''
# parser = ArgumentParser(description='Example Argparse Program', formatter_class=RawDescriptionHelpFormatter)
# parser.add_argument("filename", help="filename")
# '''
# nodes = ast.parse(source)
# self.assertTrue(source_parser.has_instantiator(nodes.body[0], 'ArgumentParser'))
#
#
# def test_has_instantiator_returns_false_if_object_not_found(self):
# source = '''
# parser = NopeParser(description='Example Argparse Program', formatter_class=RawDescriptionHelpFormatter)
# parser.add_argument("filename", help="filename")
# '''
# nodes = ast.parse(source)
# self.assertFalse(source_parser.has_instantiator(nodes.body[0], 'ArgumentParser'))
#
# def test_has_assignment_returns_true_if_object_found(self):
# source = '''
# parser = ArgumentParser(description='Example Argparse Program', formatter_class=RawDescriptionHelpFormatter)
# parser.add_argument("filename", help="filename")
# '''
# nodes = ast.parse(source)
# self.assertTrue(source_parser.has_assignment(nodes.body[1], 'add_argument'))
#
# def test_has_assignment_returns_false_if_object_not_found(self):
# source = '''
# parser = ArgumentParser(description='Example Argparse Program', formatter_class=RawDescriptionHelpFormatter)
# parser.add_argument("filename", help="filename")
# '''
# nodes = ast.parse(source)
# self.assertFalse(source_parser.has_instantiator(nodes.body[1], 'add_argument'))
#
# def test_parser_identifies_import_module(self):
# source = '''
# import os
# import itertools
# from os import path
# '''
# import _ast
# nodes = ast.parse(source)
# module_imports = source_parser.get_nodes_by_instance_type(nodes, _ast.Import)
# self.assertEqual(2, len(module_imports))
#
# def test_parser_identifies_import_from(self):
# source = '''
# import os
# import itertools
# from os import path
# from gooey.gooey_decorator import Gooey
# '''
# import _ast
# nodes = ast.parse(source)
# from_imports = source_parser.get_nodes_by_instance_type(nodes, _ast.ImportFrom)
# self.assertEqual(2, len(from_imports))
#
#
# def test_get_indent_return_indent_amount_for_tabs_and_spaces(self):
# spaced_lines = ["def main"," def main"," def main"," def main"]
# expected_indent = ["", " ", " ", " "]
# for line, expected in zip(spaced_lines, expected_indent):
# self.assertEqual(expected, source_parser.get_indent(line))
#
# # def test_parse_source_file__file_with_argparse_in_main__succesfully_finds_and_returns_ast_obejcts(self):
# # ast_objects = source_parser.parse_source_file(self._module_with_argparse_in_main)
# # for obj in ast_objects:
# # self.assertTrue(type(obj) in (ast.Assign, ast.Expr))
# #
# # def test_parse_source_file__file_with_argparse_in_try_block__succesfully_finds_and_returns_ast_obejcts(self):
# # ast_objects = source_parser.parse_source_file(self._module_with_arparse_in_try)
# # for obj in ast_objects:
# # self.assertTrue(type(obj) in (ast.Assign, ast.Expr))
#
#
# if __name__ == "__main__":
# #import sys;sys.argv = ['', 'Test.testName']
# unittest.main()
#
|
#include <iostream>
using namespace std;
int raw,col,x,y,z;
int main()
{
int r=3,c=3;
int matrix[5][5];
for(int i=0; i<5 ; i++)
{
for(int j=0; j<5 ;j++)
{
cin>>matrix[i][j];
}
}
for(int i=0; i<5;i++)
{
for(int j=0 ; j<5 ;j++ )
{
if(matrix[i][j]==1)
{
col=i+1;
raw=j+1;
}
}
}
if(c>=col)
{
x=c-col;
}
else
{
x=col-c;
if(x<0)
x*=-1;
}
if(r>=raw)
{
y=r-raw;
}
else
{
y=raw-r;
if(y<0)
y*=-1;
}
z=x+y;
cout<<z;
return 0;
}
|
/******************************************************************************
This routine reads an entire GIF into core, hanging all its state info off
the GifFileType pointer. Call DGifOpenFileName() or DGifOpenFileHandle()
first to initialize I/O. Its inverse is EGifSpew().
*******************************************************************************/
int
DGifSlurp(GifFileType *GifFile)
{
size_t ImageSize;
GifRecordType RecordType;
SavedImage *sp;
GifByteType *ExtData;
int ExtFunction;
GifFile->ExtensionBlocks = NULL;
GifFile->ExtensionBlockCount = 0;
do {
if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR)
return (GIF_ERROR);
switch (RecordType) {
case IMAGE_DESC_RECORD_TYPE:
if (DGifGetImageDesc(GifFile) == GIF_ERROR)
return (GIF_ERROR);
sp = &GifFile->SavedImages[GifFile->ImageCount - 1];
if (sp->ImageDesc.Width < 0 && sp->ImageDesc.Height < 0 &&
sp->ImageDesc.Width > (INT_MAX / sp->ImageDesc.Height)) {
return GIF_ERROR;
}
ImageSize = sp->ImageDesc.Width * sp->ImageDesc.Height;
if (ImageSize > (SIZE_MAX / sizeof(GifPixelType))) {
return GIF_ERROR;
}
sp->RasterBits = (unsigned char *)reallocarray(NULL, ImageSize,
sizeof(GifPixelType));
if (sp->RasterBits == NULL) {
return GIF_ERROR;
}
if (sp->ImageDesc.Interlace) {
int i, j;
int InterlacedOffset[] = { 0, 4, 2, 1 };
int InterlacedJumps[] = { 8, 8, 4, 2 };
for (i = 0; i < 4; i++)
for (j = InterlacedOffset[i];
j < sp->ImageDesc.Height;
j += InterlacedJumps[i]) {
if (DGifGetLine(GifFile,
sp->RasterBits+j*sp->ImageDesc.Width,
sp->ImageDesc.Width) == GIF_ERROR)
return GIF_ERROR;
}
}
else {
if (DGifGetLine(GifFile,sp->RasterBits,ImageSize)==GIF_ERROR)
return (GIF_ERROR);
}
if (GifFile->ExtensionBlocks) {
sp->ExtensionBlocks = GifFile->ExtensionBlocks;
sp->ExtensionBlockCount = GifFile->ExtensionBlockCount;
GifFile->ExtensionBlocks = NULL;
GifFile->ExtensionBlockCount = 0;
}
break;
case EXTENSION_RECORD_TYPE:
if (DGifGetExtension(GifFile,&ExtFunction,&ExtData) == GIF_ERROR)
return (GIF_ERROR);
if (ExtData != NULL) {
if (GifAddExtensionBlock(&GifFile->ExtensionBlockCount,
&GifFile->ExtensionBlocks,
ExtFunction, ExtData[0], &ExtData[1])
== GIF_ERROR)
return (GIF_ERROR);
}
while (ExtData != NULL) {
if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR)
return (GIF_ERROR);
if (ExtData != NULL)
if (GifAddExtensionBlock(&GifFile->ExtensionBlockCount,
&GifFile->ExtensionBlocks,
CONTINUE_EXT_FUNC_CODE,
ExtData[0], &ExtData[1]) == GIF_ERROR)
return (GIF_ERROR);
}
break;
case TERMINATE_RECORD_TYPE:
break;
default:
break;
}
} while (RecordType != TERMINATE_RECORD_TYPE);
if (GifFile->ImageCount == 0) {
GifFile->Error = D_GIF_ERR_NO_IMAG_DSCR;
return(GIF_ERROR);
}
return (GIF_OK);
} |
// StageBuilder.addStageShip() takes paths relative to the main stage file, but
// its working directory should be the same as the stage's.
// Example:
// * stages/my/game.lua calls addStageShip("gameship.lua")
// * BerryBots loads file from stages/my/gameship.lua
// * Ship's working directory is stages/, filename is my/gameship.lua.
char* FileManager::getStageShipRelativePath(const char *stagesDir,
const char *stageFilename, const char *stageShipName) {
char *stagePath = FileManager::getFilePath(stagesDir, stageFilename);
char *stageLocalDir = FileManager::parseDir(stagePath);
char *stageShipPath = FileManager::getFilePath(stageLocalDir, stageShipName);
char *relativePath =
FileManager::parseRelativeFilePath(stagesDir, stageShipPath);
delete stagePath;
delete stageLocalDir;
delete stageShipPath;
return relativePath;
} |
<gh_stars>0
package com.hzu.zao.fragments;
import com.hzu.zao.R;
import com.hzu.zao.presents.UserManagerFragPresent;
import com.hzu.zao.views.UserManagerFragView;
/**
* Function:
* Note:
* Created by <EMAIL> on 2017-11-30.
*/
public class UserManagerFragment extends BaseFrament {
protected static final String TAG = UserManagerFragment.class.getSimpleName();
public UserManagerFragment() {
}
@Override
protected int getLayoutResource() {
return R.layout.user_manager_fragment;
}
@Override
protected void initialized() {
final UserManagerFragView userManagerFragView = new UserManagerFragView(getContext());
final UserManagerFragPresent userManagerFragPresent = new UserManagerFragPresent(getContext(),userManagerFragView);
}
}
|
def loadFile(self, filename='' , confirm=True):
xsi.OpenScene(filename, confirm)
return False |
/**
* Store details of the security link in the resolution cache. The link is assumed to be a record of the link to the object, for example is it held by strong (object id) or weak (external id)
* reference.
* <p>
* Securities are already resolved when the functions see the positions, so the logging target resolver will not capture any uses of the security.
*
* @param link the link to store - the identifier is taken from this along with the resolved unique identifier
*/
private void store(final SecurityLink link) {
final ComputationTargetReference key;
final UniqueId uid;
if (link.getTarget() != null) {
uid = link.getTarget().getUniqueId();
if (link.getObjectId() != null) {
key = new ComputationTargetSpecification(ComputationTargetType.SECURITY, uid.toLatest());
} else if (!link.getExternalId().isEmpty()) {
key = new ComputationTargetRequirement(ComputationTargetType.SECURITY, link.getExternalId());
} else {
return;
}
if (uid == null) {
throw new IllegalArgumentException("Provided a SecurityLink " + link + " where the UniqueId could not be identified. Error in underlying Source/Master.");
}
final UniqueId existing = _resolutions.putIfAbsent(MemoryUtils.instance(key), uid);
assert (existing == null) || existing.equals(uid);
}
} |
.
AIM
To substantiate administration of <<Perftoran>> for prevention of cerebral ischemia in operations on extracranial arteries.
MATERIAL AND METHODS
The present prospective randomized trial included a total of 50 patients having endured various operative interventions on extracranial arteries. Of these, 24 subjects were additionally given <<Perftoran>> in order to prevent ischaemic complications. Conventionally accepted methods of protection were used in 26 patients. The degree of cerebral ischaemia during surgery was assessed by means of monitoring the lactate content in the blood from the internal carotid artery and internal jugular vein on the side of the operation performed. Also, as an indirect method aimed at evaluating intraoperative cerebral ischaemia we used monitoring of transcutaneous oxygen tension (TcPO2) on the side of the surgical intervention with the placement of the appropriate sensor in the temporal region.
RESULTS
The patients receiving perftoran additionally in order to prevent cerebral ischaemia showed a statistically reliable decrease in the blood lactate level at all stages of the operation. Besides, with the statistically similar levels of TcPO2 in the both groups at the stage prior to pinching the major arteries amongst the patients given perftoran the decrease in TcPO2 at the subsequent stages was significantly lower.
CONCLUSION
Administration of perftoran during surgery on the extracranial arteries made it possible to substantially improve cerebral oxygenation, rendering it stable at all stages of the surgical intervention. Combining this method with other techniques aimed at protecting the brain makes it possible to increase safety of the operations by promoting additional protection from circulatory hypoxia in multifocal lesions of the carotid arteries and arteries of the circle of Willis. |
<gh_stars>0
package com.example.r028367.navscheme.study.swipe;
import android.content.res.Configuration;
import android.support.annotation.Nullable;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.example.r028367.navscheme.R;
import com.example.r028367.navscheme.study.swipe.fragments.CustomStatePagerAdapter;
import com.example.r028367.navscheme.study.swipe.fragments.entities.AbstractFeatures;
import com.example.r028367.navscheme.study.swipe.fragments.entities.FactoryMapFeatures;
import com.example.r028367.navscheme.study.swipe.transition.PageChangeImpl;
import com.example.r028367.navscheme.study.swipe.transition.ZoomOutPageTransforner;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class ActivityMenuTransition extends AppCompatActivity
implements AdapterView.OnItemClickListener, PageChangeImpl.InteractActivity {
private ViewPager viewPager;
private PagerAdapter pagerAdapter;
private List<Fragment> listFragmentsFeatures;
private ListView menuList;
private DrawerLayout drawerLayout;
private String [] itemsMenuFragment;
private CharSequence title, drawerTitle;
private ActionBarDrawerToggle drawerToggle;
/*
* Mapa<Codigo funcionalitade, Funcionalidade>
* Esse mapa vincula uma funcionalidade a seu Codigo
* Esse eh um exemplo que pretendo usar como solucao num app
* de um cliente
* */
Map<String, AbstractFeatures> featuresSystem;
/*
* Mapa<Funcionalidade, Tela de acao>
* Esse mapa vincula uma funcionalidade a
* uma tela de acao (Fragment). Essa e a tela inicial
* que da Acesso a Acao(Funcionalidade)
* Por exemplo
* MaterialsFeatures eh uma especificacao de AbstracFeature
* ou seja MaterialsFeatures representa uma funcionalidade do sistema
* Map<MaterialsFeatures, MenuAccessMaterials>
* Uma funcionalidade esta atrelada a sua tela de acao, dessa
* forma podemos montar dinamicamente um menu que o usuario
*
*
* */
private Map<AbstractFeatures, Fragment> fragmentsSystem;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_menu_transition);
FactoryMapFeatures factory = new FactoryMapFeatures();
// mapa com todas as Classes que implementam toda a regra de negocio
// Exemplo: A classe que implementa funcionalidades para materiais
// A classe que
// funcionalidades do sistema
featuresSystem = factory.getFeatures();
// telas que dao acesso ao sistema
fragmentsSystem = factory.getViewsFeatureSystem();
String [] codes = {"130", "132", "134"};
/*
*
* Criar a lista de Fragments que sera usada para o efeito
* de Swipe.
*
* Essa lista de fragmentsSystem eh criada conforme as funcionalistades que
* o usuario tera acesso
* */
createSwipeMenu(codes);
/*
* ViewPager: https://developer.android.com/reference/android/support/v4/view/ViewPager.html
* */
viewPager = (ViewPager) findViewById(R.id.slider);
viewPager.setPageTransformer(true, new ZoomOutPageTransforner());
FragmentManager fm = getSupportFragmentManager();
//
pagerAdapter = new CustomStatePagerAdapter(fm, listFragmentsFeatures);
//
viewPager.setAdapter(pagerAdapter);
//
viewPager.addOnPageChangeListener(new PageChangeImpl(this));
/*
* Configuracao do menu lateral
*
* */
final ActionBar actionBar = getSupportActionBar();
if(actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
}
drawerLayout = (DrawerLayout) findViewById(R.id.activity_menu_transition);
menuList = (ListView) findViewById(R.id.side_nav_menu);
menuList.setAdapter(new ArrayAdapter<String>(
this
,android.R.layout.simple_list_item_1
, itemsMenuFragment)
);
// Se o usuario tiver acesso a pelo menos uma funcionalidade
// a descricao dela sera o titulo da pagina
if(itemsMenuFragment[0] != null)
setTitle(itemsMenuFragment[0]);
menuList.setOnItemClickListener(this);
// Metodo implementado pela Activity para pegar o titulo
title = drawerTitle = getTitle();
/*
* Classe Filha da puta
* ActionBarDrawerToggle na api v4 support o contrutor
* e esse abaixo, na v7 ele muda
*
* */
drawerToggle = new ActionBarDrawerToggle(
this
,drawerLayout
,R.drawable.ic_drawer
,R.string.drawer_open
,R.string.drawer_close) {
@Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
actionBar.setTitle(title);
//supportInvalidateOptionsMenu();
}
@Override
public void onDrawerClosed(View drawerView) {
super.onDrawerClosed(drawerView);
actionBar.setTitle(title);
//supportInvalidateOptionsMenu();
}
};
drawerLayout.setDrawerListener(drawerToggle);
}
private void createSwipeMenu(String [] codes) {
listFragmentsFeatures = new ArrayList<>();
ArrayList<String> descriptions = new ArrayList<>();
for(String code : codes) {
if(featuresSystem.containsKey(code)) {
AbstractFeatures feature = featuresSystem.get(code);
descriptions.add(feature.getDescription());
Fragment fragment = fragmentsSystem.get(feature);
listFragmentsFeatures.add(fragment);
}
}
itemsMenuFragment = new String[descriptions.size()];
for(int i = 0; i< itemsMenuFragment.length; i++)
itemsMenuFragment[i] = descriptions.get(i);
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Fragment currentFragment = listFragmentsFeatures.get(position);
String description = "";
AbstractFeatures feature = null;
for(Map.Entry<AbstractFeatures, Fragment> pair : fragmentsSystem.entrySet()) {
Fragment fragment = pair.getValue();
boolean eq = fragment.getClass().getName().equals(currentFragment.getClass().getName());
boolean eq2 = fragment.equals(currentFragment);
if ( eq ) {
feature = pair.getKey();
description = feature.getDescription();
title = description;
setTitle(title);
break;
}
}
/*
if(fragment instanceof MenuAccessMaterials) {
description = ((MenuAccessServiceOrders) fragment).getServiceOrder().getDescription();
}
else if(fragment instanceof MenuAccessMaterials) {
description = ((MenuAccessMaterials) fragment).getMaterials().getDescription();
}
else if(fragment instanceof MenuAccessSyncServiceOrder) {
description = ((MenuAccessSyncServiceOrder) fragment ).getSyncServiceOrder().getDescription();
}
*/
viewPager.setCurrentItem(position);
menuList.setItemChecked(position, true);
drawerLayout.closeDrawer(menuList);
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
boolean drawerOpen = drawerLayout.isDrawerOpen(menuList);
//menu.findItem().setVisible(!drawerOpen);
return super.onPrepareOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if(drawerToggle.onOptionsItemSelected(item)) {
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
drawerToggle.syncState();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
drawerToggle.onConfigurationChanged(newConfig);
}
@Override
public void passPosition(int pos) {
setTitle(itemsMenuFragment[pos]);
}
@Override
protected boolean onPrepareOptionsPanel(View view, Menu menu) {
return super.onPrepareOptionsPanel(view, menu);
}
}
|
// Code generated by pigeon; DO NOT EDIT.
package parser
import (
"bytes"
"errors"
"fmt"
"io"
"io/ioutil"
"math"
"os"
"sort"
"strconv"
"strings"
"unicode"
"unicode/utf8"
"github.com/bytesparadise/libasciidoc/pkg/types"
)
var g = &grammar{
rules: []*rule{
{
name: "AsciidocDocument",
pos: position{line: 17, col: 1, offset: 319},
expr: &actionExpr{
pos: position{line: 17, col: 21, offset: 339},
run: (*parser).callonAsciidocDocument1,
expr: &seqExpr{
pos: position{line: 17, col: 21, offset: 339},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 17, col: 21, offset: 339},
label: "frontmatter",
expr: &zeroOrOneExpr{
pos: position{line: 17, col: 34, offset: 352},
expr: &ruleRefExpr{
pos: position{line: 17, col: 34, offset: 352},
name: "FrontMatter",
},
},
},
&labeledExpr{
pos: position{line: 17, col: 48, offset: 366},
label: "blocks",
expr: &ruleRefExpr{
pos: position{line: 17, col: 56, offset: 374},
name: "AsciidocDocumentBlocks",
},
},
&ruleRefExpr{
pos: position{line: 17, col: 80, offset: 398},
name: "EOF",
},
},
},
},
},
{
name: "AsciidocDocumentWithinDelimitedBlock",
pos: position{line: 21, col: 1, offset: 478},
expr: &actionExpr{
pos: position{line: 21, col: 41, offset: 518},
run: (*parser).callonAsciidocDocumentWithinDelimitedBlock1,
expr: &seqExpr{
pos: position{line: 21, col: 41, offset: 518},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 21, col: 41, offset: 518},
label: "frontmatter",
expr: &zeroOrOneExpr{
pos: position{line: 21, col: 54, offset: 531},
expr: &ruleRefExpr{
pos: position{line: 21, col: 54, offset: 531},
name: "FrontMatter",
},
},
},
&labeledExpr{
pos: position{line: 21, col: 68, offset: 545},
label: "blocks",
expr: &ruleRefExpr{
pos: position{line: 21, col: 76, offset: 553},
name: "AsciidocDocumentBlocksWithinDelimitedBlock",
},
},
&ruleRefExpr{
pos: position{line: 21, col: 120, offset: 597},
name: "EOF",
},
},
},
},
},
{
name: "TextDocument",
pos: position{line: 25, col: 1, offset: 677},
expr: &actionExpr{
pos: position{line: 25, col: 17, offset: 693},
run: (*parser).callonTextDocument1,
expr: &seqExpr{
pos: position{line: 25, col: 17, offset: 693},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 25, col: 17, offset: 693},
label: "blocks",
expr: &ruleRefExpr{
pos: position{line: 25, col: 25, offset: 701},
name: "TextDocumentBlocks",
},
},
&ruleRefExpr{
pos: position{line: 25, col: 45, offset: 721},
name: "EOF",
},
},
},
},
},
{
name: "AsciidocDocumentBlocks",
pos: position{line: 32, col: 1, offset: 904},
expr: &actionExpr{
pos: position{line: 32, col: 27, offset: 930},
run: (*parser).callonAsciidocDocumentBlocks1,
expr: &seqExpr{
pos: position{line: 32, col: 27, offset: 930},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 32, col: 27, offset: 930},
label: "header",
expr: &zeroOrOneExpr{
pos: position{line: 32, col: 35, offset: 938},
expr: &ruleRefExpr{
pos: position{line: 32, col: 35, offset: 938},
name: "DocumentHeader",
},
},
},
&labeledExpr{
pos: position{line: 32, col: 52, offset: 955},
label: "others",
expr: &zeroOrMoreExpr{
pos: position{line: 32, col: 60, offset: 963},
expr: &ruleRefExpr{
pos: position{line: 32, col: 60, offset: 963},
name: "DocumentBlock",
},
},
},
},
},
},
},
{
name: "DocumentBlock",
pos: position{line: 41, col: 1, offset: 1212},
expr: &actionExpr{
pos: position{line: 41, col: 18, offset: 1229},
run: (*parser).callonDocumentBlock1,
expr: &seqExpr{
pos: position{line: 41, col: 18, offset: 1229},
exprs: []interface{}{
¬Expr{
pos: position{line: 41, col: 18, offset: 1229},
expr: &ruleRefExpr{
pos: position{line: 41, col: 19, offset: 1230},
name: "EOF",
},
},
&labeledExpr{
pos: position{line: 42, col: 5, offset: 1239},
label: "block",
expr: &choiceExpr{
pos: position{line: 42, col: 12, offset: 1246},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 42, col: 12, offset: 1246},
name: "SimpleParagraph",
},
&ruleRefExpr{
pos: position{line: 43, col: 11, offset: 1272},
name: "Section",
},
&ruleRefExpr{
pos: position{line: 44, col: 11, offset: 1291},
name: "DelimitedBlock",
},
&ruleRefExpr{
pos: position{line: 45, col: 11, offset: 1316},
name: "FileInclusion",
},
&ruleRefExpr{
pos: position{line: 46, col: 11, offset: 1340},
name: "VerseParagraph",
},
&ruleRefExpr{
pos: position{line: 47, col: 11, offset: 1394},
name: "ImageBlock",
},
&ruleRefExpr{
pos: position{line: 48, col: 11, offset: 1416},
name: "ListItem",
},
&ruleRefExpr{
pos: position{line: 49, col: 11, offset: 1435},
name: "BlankLine",
},
&ruleRefExpr{
pos: position{line: 50, col: 11, offset: 1486},
name: "LiteralBlock",
},
&ruleRefExpr{
pos: position{line: 51, col: 11, offset: 1510},
name: "DocumentAttributeDeclaration",
},
&ruleRefExpr{
pos: position{line: 52, col: 11, offset: 1550},
name: "DocumentAttributeReset",
},
&ruleRefExpr{
pos: position{line: 53, col: 11, offset: 1584},
name: "TableOfContentsPlaceHolder",
},
&ruleRefExpr{
pos: position{line: 54, col: 11, offset: 1621},
name: "UserMacroBlock",
},
&ruleRefExpr{
pos: position{line: 55, col: 11, offset: 1646},
name: "Paragraph",
},
},
},
},
},
},
},
},
{
name: "AsciidocDocumentBlocksWithinDelimitedBlock",
pos: position{line: 59, col: 1, offset: 1684},
expr: &labeledExpr{
pos: position{line: 59, col: 47, offset: 1730},
label: "blocks",
expr: &zeroOrMoreExpr{
pos: position{line: 59, col: 54, offset: 1737},
expr: &ruleRefExpr{
pos: position{line: 59, col: 55, offset: 1738},
name: "DocumentBlockWithinDelimitedBlock",
},
},
},
},
{
name: "DocumentBlockWithinDelimitedBlock",
pos: position{line: 61, col: 1, offset: 1775},
expr: &actionExpr{
pos: position{line: 61, col: 38, offset: 1812},
run: (*parser).callonDocumentBlockWithinDelimitedBlock1,
expr: &seqExpr{
pos: position{line: 61, col: 38, offset: 1812},
exprs: []interface{}{
¬Expr{
pos: position{line: 61, col: 38, offset: 1812},
expr: &ruleRefExpr{
pos: position{line: 61, col: 39, offset: 1813},
name: "EOF",
},
},
&labeledExpr{
pos: position{line: 62, col: 5, offset: 1822},
label: "block",
expr: &choiceExpr{
pos: position{line: 62, col: 12, offset: 1829},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 62, col: 12, offset: 1829},
name: "DelimitedBlock",
},
&ruleRefExpr{
pos: position{line: 63, col: 11, offset: 1854},
name: "FileInclusion",
},
&ruleRefExpr{
pos: position{line: 64, col: 11, offset: 1878},
name: "VerseParagraph",
},
&ruleRefExpr{
pos: position{line: 65, col: 11, offset: 1903},
name: "ImageBlock",
},
&ruleRefExpr{
pos: position{line: 66, col: 11, offset: 1925},
name: "ListItem",
},
&ruleRefExpr{
pos: position{line: 67, col: 11, offset: 1944},
name: "BlankLine",
},
&ruleRefExpr{
pos: position{line: 68, col: 11, offset: 1995},
name: "LiteralBlock",
},
&ruleRefExpr{
pos: position{line: 69, col: 11, offset: 2019},
name: "DocumentAttributeDeclaration",
},
&ruleRefExpr{
pos: position{line: 70, col: 11, offset: 2059},
name: "DocumentAttributeReset",
},
&ruleRefExpr{
pos: position{line: 71, col: 11, offset: 2093},
name: "TableOfContentsPlaceHolder",
},
&ruleRefExpr{
pos: position{line: 72, col: 11, offset: 2130},
name: "UserMacroBlock",
},
&ruleRefExpr{
pos: position{line: 73, col: 11, offset: 2155},
name: "Paragraph",
},
},
},
},
},
},
},
},
{
name: "TextDocumentBlocks",
pos: position{line: 77, col: 1, offset: 2193},
expr: &labeledExpr{
pos: position{line: 77, col: 23, offset: 2215},
label: "blocks",
expr: &zeroOrMoreExpr{
pos: position{line: 77, col: 30, offset: 2222},
expr: &ruleRefExpr{
pos: position{line: 77, col: 31, offset: 2223},
name: "TextDocumentBlock",
},
},
},
},
{
name: "TextDocumentBlock",
pos: position{line: 79, col: 1, offset: 2244},
expr: &actionExpr{
pos: position{line: 79, col: 22, offset: 2265},
run: (*parser).callonTextDocumentBlock1,
expr: &seqExpr{
pos: position{line: 79, col: 22, offset: 2265},
exprs: []interface{}{
¬Expr{
pos: position{line: 79, col: 22, offset: 2265},
expr: &ruleRefExpr{
pos: position{line: 79, col: 23, offset: 2266},
name: "EOF",
},
},
&labeledExpr{
pos: position{line: 80, col: 5, offset: 2275},
label: "block",
expr: &choiceExpr{
pos: position{line: 80, col: 12, offset: 2282},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 80, col: 12, offset: 2282},
name: "BlankLine",
},
&ruleRefExpr{
pos: position{line: 80, col: 24, offset: 2294},
name: "Paragraph",
},
},
},
},
},
},
},
},
{
name: "FrontMatter",
pos: position{line: 87, col: 1, offset: 2440},
expr: &ruleRefExpr{
pos: position{line: 87, col: 16, offset: 2455},
name: "YamlFrontMatter",
},
},
{
name: "YamlFrontMatter",
pos: position{line: 89, col: 1, offset: 2473},
expr: &actionExpr{
pos: position{line: 89, col: 20, offset: 2492},
run: (*parser).callonYamlFrontMatter1,
expr: &seqExpr{
pos: position{line: 89, col: 20, offset: 2492},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 89, col: 20, offset: 2492},
name: "YamlFrontMatterToken",
},
&labeledExpr{
pos: position{line: 89, col: 41, offset: 2513},
label: "content",
expr: &zeroOrOneExpr{
pos: position{line: 89, col: 49, offset: 2521},
expr: &ruleRefExpr{
pos: position{line: 89, col: 50, offset: 2522},
name: "YamlFrontMatterContent",
},
},
},
&ruleRefExpr{
pos: position{line: 89, col: 75, offset: 2547},
name: "YamlFrontMatterToken",
},
},
},
},
},
{
name: "YamlFrontMatterToken",
pos: position{line: 93, col: 1, offset: 2627},
expr: &seqExpr{
pos: position{line: 93, col: 26, offset: 2652},
exprs: []interface{}{
&litMatcher{
pos: position{line: 93, col: 26, offset: 2652},
val: "---",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 93, col: 32, offset: 2658},
expr: &ruleRefExpr{
pos: position{line: 93, col: 32, offset: 2658},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 93, col: 36, offset: 2662},
name: "EOL",
},
},
},
},
{
name: "YamlFrontMatterContent",
pos: position{line: 95, col: 1, offset: 2667},
expr: &actionExpr{
pos: position{line: 95, col: 27, offset: 2693},
run: (*parser).callonYamlFrontMatterContent1,
expr: &zeroOrMoreExpr{
pos: position{line: 95, col: 27, offset: 2693},
expr: &oneOrMoreExpr{
pos: position{line: 95, col: 28, offset: 2694},
expr: &seqExpr{
pos: position{line: 95, col: 29, offset: 2695},
exprs: []interface{}{
¬Expr{
pos: position{line: 95, col: 29, offset: 2695},
expr: &ruleRefExpr{
pos: position{line: 95, col: 30, offset: 2696},
name: "YamlFrontMatterToken",
},
},
&anyMatcher{
line: 95, col: 51, offset: 2717,
},
},
},
},
},
},
},
{
name: "DocumentHeader",
pos: position{line: 102, col: 1, offset: 2883},
expr: &actionExpr{
pos: position{line: 102, col: 19, offset: 2901},
run: (*parser).callonDocumentHeader1,
expr: &seqExpr{
pos: position{line: 102, col: 19, offset: 2901},
exprs: []interface{}{
&litMatcher{
pos: position{line: 102, col: 19, offset: 2901},
val: "=",
ignoreCase: false,
},
&oneOrMoreExpr{
pos: position{line: 102, col: 23, offset: 2905},
expr: &ruleRefExpr{
pos: position{line: 102, col: 23, offset: 2905},
name: "WS",
},
},
&labeledExpr{
pos: position{line: 102, col: 27, offset: 2909},
label: "title",
expr: &ruleRefExpr{
pos: position{line: 102, col: 34, offset: 2916},
name: "TitleElements",
},
},
&labeledExpr{
pos: position{line: 102, col: 49, offset: 2931},
label: "id",
expr: &zeroOrMoreExpr{
pos: position{line: 102, col: 53, offset: 2935},
expr: &ruleRefExpr{
pos: position{line: 102, col: 53, offset: 2935},
name: "InlineElementID",
},
},
},
&ruleRefExpr{
pos: position{line: 102, col: 71, offset: 2953},
name: "EOL",
},
&zeroOrMoreExpr{
pos: position{line: 103, col: 9, offset: 2965},
expr: &choiceExpr{
pos: position{line: 103, col: 10, offset: 2966},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 103, col: 10, offset: 2966},
name: "SingleLineComment",
},
&ruleRefExpr{
pos: position{line: 103, col: 30, offset: 2986},
name: "CommentBlock",
},
},
},
},
&labeledExpr{
pos: position{line: 104, col: 9, offset: 3009},
label: "authors",
expr: &zeroOrOneExpr{
pos: position{line: 104, col: 18, offset: 3018},
expr: &ruleRefExpr{
pos: position{line: 104, col: 18, offset: 3018},
name: "DocumentAuthors",
},
},
},
&zeroOrMoreExpr{
pos: position{line: 105, col: 9, offset: 3045},
expr: &choiceExpr{
pos: position{line: 105, col: 10, offset: 3046},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 105, col: 10, offset: 3046},
name: "SingleLineComment",
},
&ruleRefExpr{
pos: position{line: 105, col: 30, offset: 3066},
name: "CommentBlock",
},
},
},
},
&labeledExpr{
pos: position{line: 106, col: 9, offset: 3089},
label: "revision",
expr: &zeroOrOneExpr{
pos: position{line: 106, col: 19, offset: 3099},
expr: &ruleRefExpr{
pos: position{line: 106, col: 19, offset: 3099},
name: "DocumentRevision",
},
},
},
},
},
},
},
{
name: "DocumentAuthors",
pos: position{line: 110, col: 1, offset: 3200},
expr: &choiceExpr{
pos: position{line: 110, col: 20, offset: 3219},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 110, col: 20, offset: 3219},
name: "DocumentAuthorsInlineForm",
},
&ruleRefExpr{
pos: position{line: 110, col: 48, offset: 3247},
name: "DocumentAuthorsAttributeForm",
},
},
},
},
{
name: "DocumentAuthorsInlineForm",
pos: position{line: 112, col: 1, offset: 3277},
expr: &actionExpr{
pos: position{line: 112, col: 30, offset: 3306},
run: (*parser).callonDocumentAuthorsInlineForm1,
expr: &seqExpr{
pos: position{line: 112, col: 30, offset: 3306},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 112, col: 30, offset: 3306},
expr: &ruleRefExpr{
pos: position{line: 112, col: 30, offset: 3306},
name: "WS",
},
},
¬Expr{
pos: position{line: 112, col: 34, offset: 3310},
expr: &litMatcher{
pos: position{line: 112, col: 35, offset: 3311},
val: ":",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 112, col: 39, offset: 3315},
label: "authors",
expr: &oneOrMoreExpr{
pos: position{line: 112, col: 48, offset: 3324},
expr: &ruleRefExpr{
pos: position{line: 112, col: 48, offset: 3324},
name: "DocumentAuthor",
},
},
},
&ruleRefExpr{
pos: position{line: 112, col: 65, offset: 3341},
name: "EOL",
},
},
},
},
},
{
name: "DocumentAuthorsAttributeForm",
pos: position{line: 116, col: 1, offset: 3411},
expr: &actionExpr{
pos: position{line: 116, col: 33, offset: 3443},
run: (*parser).callonDocumentAuthorsAttributeForm1,
expr: &seqExpr{
pos: position{line: 116, col: 33, offset: 3443},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 116, col: 33, offset: 3443},
expr: &ruleRefExpr{
pos: position{line: 116, col: 33, offset: 3443},
name: "WS",
},
},
&litMatcher{
pos: position{line: 116, col: 37, offset: 3447},
val: ":author:",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 116, col: 48, offset: 3458},
label: "author",
expr: &ruleRefExpr{
pos: position{line: 116, col: 56, offset: 3466},
name: "DocumentAuthor",
},
},
&ruleRefExpr{
pos: position{line: 116, col: 72, offset: 3482},
name: "EOL",
},
},
},
},
},
{
name: "DocumentAuthor",
pos: position{line: 120, col: 1, offset: 3561},
expr: &actionExpr{
pos: position{line: 120, col: 19, offset: 3579},
run: (*parser).callonDocumentAuthor1,
expr: &seqExpr{
pos: position{line: 120, col: 19, offset: 3579},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 120, col: 19, offset: 3579},
expr: &ruleRefExpr{
pos: position{line: 120, col: 19, offset: 3579},
name: "WS",
},
},
&labeledExpr{
pos: position{line: 120, col: 23, offset: 3583},
label: "fullname",
expr: &ruleRefExpr{
pos: position{line: 120, col: 33, offset: 3593},
name: "DocumentAuthorName",
},
},
&labeledExpr{
pos: position{line: 120, col: 53, offset: 3613},
label: "email",
expr: &zeroOrOneExpr{
pos: position{line: 120, col: 59, offset: 3619},
expr: &ruleRefExpr{
pos: position{line: 120, col: 60, offset: 3620},
name: "DocumentAuthorEmail",
},
},
},
&zeroOrMoreExpr{
pos: position{line: 120, col: 82, offset: 3642},
expr: &ruleRefExpr{
pos: position{line: 120, col: 82, offset: 3642},
name: "WS",
},
},
&zeroOrOneExpr{
pos: position{line: 120, col: 86, offset: 3646},
expr: &litMatcher{
pos: position{line: 120, col: 86, offset: 3646},
val: ";",
ignoreCase: false,
},
},
&zeroOrMoreExpr{
pos: position{line: 120, col: 91, offset: 3651},
expr: &ruleRefExpr{
pos: position{line: 120, col: 91, offset: 3651},
name: "WS",
},
},
},
},
},
},
{
name: "DocumentAuthorName",
pos: position{line: 125, col: 1, offset: 3793},
expr: &actionExpr{
pos: position{line: 125, col: 23, offset: 3815},
run: (*parser).callonDocumentAuthorName1,
expr: &oneOrMoreExpr{
pos: position{line: 125, col: 23, offset: 3815},
expr: &choiceExpr{
pos: position{line: 125, col: 24, offset: 3816},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 125, col: 24, offset: 3816},
name: "Alphanums",
},
&seqExpr{
pos: position{line: 125, col: 37, offset: 3829},
exprs: []interface{}{
¬Expr{
pos: position{line: 125, col: 37, offset: 3829},
expr: &litMatcher{
pos: position{line: 125, col: 38, offset: 3830},
val: "<",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 125, col: 42, offset: 3834},
expr: &litMatcher{
pos: position{line: 125, col: 43, offset: 3835},
val: ";",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 125, col: 47, offset: 3839},
expr: &ruleRefExpr{
pos: position{line: 125, col: 48, offset: 3840},
name: "Newline",
},
},
&anyMatcher{
line: 125, col: 56, offset: 3848,
},
},
},
},
},
},
},
},
{
name: "DocumentAuthorEmail",
pos: position{line: 129, col: 1, offset: 3889},
expr: &actionExpr{
pos: position{line: 129, col: 24, offset: 3912},
run: (*parser).callonDocumentAuthorEmail1,
expr: &seqExpr{
pos: position{line: 129, col: 24, offset: 3912},
exprs: []interface{}{
&litMatcher{
pos: position{line: 129, col: 24, offset: 3912},
val: "<",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 129, col: 28, offset: 3916},
label: "email",
expr: &actionExpr{
pos: position{line: 129, col: 35, offset: 3923},
run: (*parser).callonDocumentAuthorEmail5,
expr: &oneOrMoreExpr{
pos: position{line: 129, col: 35, offset: 3923},
expr: &choiceExpr{
pos: position{line: 129, col: 36, offset: 3924},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 129, col: 36, offset: 3924},
name: "Alphanums",
},
&seqExpr{
pos: position{line: 129, col: 49, offset: 3937},
exprs: []interface{}{
¬Expr{
pos: position{line: 129, col: 49, offset: 3937},
expr: &litMatcher{
pos: position{line: 129, col: 50, offset: 3938},
val: ">",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 129, col: 54, offset: 3942},
expr: &ruleRefExpr{
pos: position{line: 129, col: 55, offset: 3943},
name: "EOL",
},
},
&anyMatcher{
line: 129, col: 60, offset: 3948,
},
},
},
},
},
},
},
},
&litMatcher{
pos: position{line: 131, col: 4, offset: 3989},
val: ">",
ignoreCase: false,
},
},
},
},
},
{
name: "DocumentRevision",
pos: position{line: 137, col: 1, offset: 4150},
expr: &actionExpr{
pos: position{line: 137, col: 21, offset: 4170},
run: (*parser).callonDocumentRevision1,
expr: &seqExpr{
pos: position{line: 137, col: 21, offset: 4170},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 137, col: 21, offset: 4170},
expr: &ruleRefExpr{
pos: position{line: 137, col: 21, offset: 4170},
name: "WS",
},
},
¬Expr{
pos: position{line: 137, col: 25, offset: 4174},
expr: &litMatcher{
pos: position{line: 137, col: 26, offset: 4175},
val: ":",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 137, col: 30, offset: 4179},
label: "revision",
expr: &choiceExpr{
pos: position{line: 138, col: 9, offset: 4198},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 138, col: 10, offset: 4199},
run: (*parser).callonDocumentRevision9,
expr: &seqExpr{
pos: position{line: 138, col: 10, offset: 4199},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 138, col: 10, offset: 4199},
label: "revnumber",
expr: &ruleRefExpr{
pos: position{line: 138, col: 21, offset: 4210},
name: "DocumentRevisionNumber",
},
},
&zeroOrOneExpr{
pos: position{line: 138, col: 45, offset: 4234},
expr: &litMatcher{
pos: position{line: 138, col: 45, offset: 4234},
val: ",",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 138, col: 50, offset: 4239},
label: "revdate",
expr: &zeroOrOneExpr{
pos: position{line: 138, col: 58, offset: 4247},
expr: &ruleRefExpr{
pos: position{line: 138, col: 59, offset: 4248},
name: "DocumentRevisionDate",
},
},
},
&zeroOrOneExpr{
pos: position{line: 138, col: 82, offset: 4271},
expr: &litMatcher{
pos: position{line: 138, col: 82, offset: 4271},
val: ":",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 138, col: 87, offset: 4276},
label: "revremark",
expr: &zeroOrOneExpr{
pos: position{line: 138, col: 97, offset: 4286},
expr: &ruleRefExpr{
pos: position{line: 138, col: 98, offset: 4287},
name: "DocumentRevisionRemark",
},
},
},
},
},
},
&actionExpr{
pos: position{line: 140, col: 15, offset: 4404},
run: (*parser).callonDocumentRevision23,
expr: &seqExpr{
pos: position{line: 140, col: 15, offset: 4404},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 140, col: 15, offset: 4404},
label: "revdate",
expr: &ruleRefExpr{
pos: position{line: 140, col: 24, offset: 4413},
name: "DocumentRevisionDate",
},
},
&zeroOrOneExpr{
pos: position{line: 140, col: 46, offset: 4435},
expr: &litMatcher{
pos: position{line: 140, col: 46, offset: 4435},
val: ":",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 140, col: 51, offset: 4440},
label: "revremark",
expr: &zeroOrOneExpr{
pos: position{line: 140, col: 61, offset: 4450},
expr: &ruleRefExpr{
pos: position{line: 140, col: 62, offset: 4451},
name: "DocumentRevisionRemark",
},
},
},
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 142, col: 13, offset: 4560},
name: "EOL",
},
},
},
},
},
{
name: "DocumentRevisionNumber",
pos: position{line: 147, col: 1, offset: 4690},
expr: &choiceExpr{
pos: position{line: 147, col: 27, offset: 4716},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 147, col: 27, offset: 4716},
run: (*parser).callonDocumentRevisionNumber2,
expr: &seqExpr{
pos: position{line: 147, col: 27, offset: 4716},
exprs: []interface{}{
&litMatcher{
pos: position{line: 147, col: 27, offset: 4716},
val: "v",
ignoreCase: true,
},
&ruleRefExpr{
pos: position{line: 147, col: 32, offset: 4721},
name: "DIGIT",
},
&oneOrMoreExpr{
pos: position{line: 147, col: 39, offset: 4728},
expr: &choiceExpr{
pos: position{line: 147, col: 40, offset: 4729},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 147, col: 40, offset: 4729},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 147, col: 52, offset: 4741},
name: "Spaces",
},
&seqExpr{
pos: position{line: 147, col: 62, offset: 4751},
exprs: []interface{}{
¬Expr{
pos: position{line: 147, col: 62, offset: 4751},
expr: &ruleRefExpr{
pos: position{line: 147, col: 63, offset: 4752},
name: "EOL",
},
},
¬Expr{
pos: position{line: 147, col: 67, offset: 4756},
expr: &litMatcher{
pos: position{line: 147, col: 68, offset: 4757},
val: ",",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 147, col: 72, offset: 4761},
expr: &litMatcher{
pos: position{line: 147, col: 73, offset: 4762},
val: ":",
ignoreCase: false,
},
},
&anyMatcher{
line: 147, col: 78, offset: 4767,
},
},
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 149, col: 5, offset: 4809},
run: (*parser).callonDocumentRevisionNumber18,
expr: &seqExpr{
pos: position{line: 149, col: 5, offset: 4809},
exprs: []interface{}{
&zeroOrOneExpr{
pos: position{line: 149, col: 5, offset: 4809},
expr: &litMatcher{
pos: position{line: 149, col: 5, offset: 4809},
val: "v",
ignoreCase: true,
},
},
&ruleRefExpr{
pos: position{line: 149, col: 11, offset: 4815},
name: "DIGIT",
},
&oneOrMoreExpr{
pos: position{line: 149, col: 18, offset: 4822},
expr: &choiceExpr{
pos: position{line: 149, col: 19, offset: 4823},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 149, col: 19, offset: 4823},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 149, col: 31, offset: 4835},
name: "Spaces",
},
&seqExpr{
pos: position{line: 149, col: 41, offset: 4845},
exprs: []interface{}{
¬Expr{
pos: position{line: 149, col: 41, offset: 4845},
expr: &ruleRefExpr{
pos: position{line: 149, col: 42, offset: 4846},
name: "EOL",
},
},
¬Expr{
pos: position{line: 149, col: 46, offset: 4850},
expr: &litMatcher{
pos: position{line: 149, col: 47, offset: 4851},
val: ",",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 149, col: 51, offset: 4855},
expr: &litMatcher{
pos: position{line: 149, col: 52, offset: 4856},
val: ":",
ignoreCase: false,
},
},
&anyMatcher{
line: 149, col: 57, offset: 4861,
},
},
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 149, col: 62, offset: 4866},
expr: &ruleRefExpr{
pos: position{line: 149, col: 62, offset: 4866},
name: "WS",
},
},
&andExpr{
pos: position{line: 149, col: 66, offset: 4870},
expr: &litMatcher{
pos: position{line: 149, col: 67, offset: 4871},
val: ",",
ignoreCase: false,
},
},
},
},
},
},
},
},
{
name: "DocumentRevisionDate",
pos: position{line: 153, col: 1, offset: 4911},
expr: &actionExpr{
pos: position{line: 153, col: 25, offset: 4935},
run: (*parser).callonDocumentRevisionDate1,
expr: &oneOrMoreExpr{
pos: position{line: 153, col: 25, offset: 4935},
expr: &choiceExpr{
pos: position{line: 153, col: 26, offset: 4936},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 153, col: 26, offset: 4936},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 153, col: 38, offset: 4948},
name: "Spaces",
},
&seqExpr{
pos: position{line: 153, col: 48, offset: 4958},
exprs: []interface{}{
¬Expr{
pos: position{line: 153, col: 48, offset: 4958},
expr: &ruleRefExpr{
pos: position{line: 153, col: 49, offset: 4959},
name: "EOL",
},
},
¬Expr{
pos: position{line: 153, col: 53, offset: 4963},
expr: &litMatcher{
pos: position{line: 153, col: 54, offset: 4964},
val: ":",
ignoreCase: false,
},
},
&anyMatcher{
line: 153, col: 59, offset: 4969,
},
},
},
},
},
},
},
},
{
name: "DocumentRevisionRemark",
pos: position{line: 157, col: 1, offset: 5010},
expr: &actionExpr{
pos: position{line: 157, col: 27, offset: 5036},
run: (*parser).callonDocumentRevisionRemark1,
expr: &oneOrMoreExpr{
pos: position{line: 157, col: 27, offset: 5036},
expr: &choiceExpr{
pos: position{line: 157, col: 28, offset: 5037},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 157, col: 28, offset: 5037},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 157, col: 40, offset: 5049},
name: "Spaces",
},
&seqExpr{
pos: position{line: 157, col: 50, offset: 5059},
exprs: []interface{}{
¬Expr{
pos: position{line: 157, col: 50, offset: 5059},
expr: &ruleRefExpr{
pos: position{line: 157, col: 51, offset: 5060},
name: "EOL",
},
},
&anyMatcher{
line: 157, col: 56, offset: 5065,
},
},
},
},
},
},
},
},
{
name: "DocumentAttributeDeclaration",
pos: position{line: 164, col: 1, offset: 5221},
expr: &actionExpr{
pos: position{line: 164, col: 33, offset: 5253},
run: (*parser).callonDocumentAttributeDeclaration1,
expr: &seqExpr{
pos: position{line: 164, col: 33, offset: 5253},
exprs: []interface{}{
&litMatcher{
pos: position{line: 164, col: 33, offset: 5253},
val: ":",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 164, col: 37, offset: 5257},
label: "name",
expr: &ruleRefExpr{
pos: position{line: 164, col: 43, offset: 5263},
name: "DocumentAttributeName",
},
},
&litMatcher{
pos: position{line: 164, col: 66, offset: 5286},
val: ":",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 164, col: 70, offset: 5290},
label: "value",
expr: &zeroOrOneExpr{
pos: position{line: 164, col: 76, offset: 5296},
expr: &actionExpr{
pos: position{line: 164, col: 77, offset: 5297},
run: (*parser).callonDocumentAttributeDeclaration9,
expr: &seqExpr{
pos: position{line: 164, col: 78, offset: 5298},
exprs: []interface{}{
&oneOrMoreExpr{
pos: position{line: 164, col: 78, offset: 5298},
expr: &ruleRefExpr{
pos: position{line: 164, col: 78, offset: 5298},
name: "WS",
},
},
&labeledExpr{
pos: position{line: 164, col: 82, offset: 5302},
label: "value",
expr: &ruleRefExpr{
pos: position{line: 164, col: 89, offset: 5309},
name: "DocumentAttributeValue",
},
},
},
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 164, col: 138, offset: 5358},
expr: &ruleRefExpr{
pos: position{line: 164, col: 138, offset: 5358},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 164, col: 142, offset: 5362},
name: "EOL",
},
},
},
},
},
{
name: "DocumentAttributeName",
pos: position{line: 171, col: 1, offset: 5610},
expr: &actionExpr{
pos: position{line: 171, col: 26, offset: 5635},
run: (*parser).callonDocumentAttributeName1,
expr: &seqExpr{
pos: position{line: 171, col: 26, offset: 5635},
exprs: []interface{}{
&choiceExpr{
pos: position{line: 171, col: 27, offset: 5636},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 171, col: 27, offset: 5636},
val: "[A-Z]",
ranges: []rune{'A', 'Z'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 171, col: 35, offset: 5644},
val: "[a-z]",
ranges: []rune{'a', 'z'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 171, col: 43, offset: 5652},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 171, col: 51, offset: 5660},
val: "_",
ignoreCase: false,
},
},
},
&zeroOrMoreExpr{
pos: position{line: 171, col: 56, offset: 5665},
expr: &choiceExpr{
pos: position{line: 171, col: 57, offset: 5666},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 171, col: 57, offset: 5666},
val: "[A-Z]",
ranges: []rune{'A', 'Z'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 171, col: 65, offset: 5674},
val: "[a-z]",
ranges: []rune{'a', 'z'},
ignoreCase: false,
inverted: false,
},
&charClassMatcher{
pos: position{line: 171, col: 73, offset: 5682},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 171, col: 81, offset: 5690},
val: "-",
ignoreCase: false,
},
},
},
},
},
},
},
},
{
name: "DocumentAttributeValue",
pos: position{line: 175, col: 1, offset: 5732},
expr: &actionExpr{
pos: position{line: 175, col: 27, offset: 5758},
run: (*parser).callonDocumentAttributeValue1,
expr: &oneOrMoreExpr{
pos: position{line: 175, col: 27, offset: 5758},
expr: &seqExpr{
pos: position{line: 175, col: 28, offset: 5759},
exprs: []interface{}{
¬Expr{
pos: position{line: 175, col: 28, offset: 5759},
expr: &ruleRefExpr{
pos: position{line: 175, col: 29, offset: 5760},
name: "Newline",
},
},
&anyMatcher{
line: 175, col: 37, offset: 5768,
},
},
},
},
},
},
{
name: "DocumentAttributeReset",
pos: position{line: 179, col: 1, offset: 5808},
expr: &choiceExpr{
pos: position{line: 179, col: 27, offset: 5834},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 179, col: 27, offset: 5834},
run: (*parser).callonDocumentAttributeReset2,
expr: &seqExpr{
pos: position{line: 179, col: 27, offset: 5834},
exprs: []interface{}{
&litMatcher{
pos: position{line: 179, col: 27, offset: 5834},
val: ":!",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 179, col: 32, offset: 5839},
label: "name",
expr: &ruleRefExpr{
pos: position{line: 179, col: 38, offset: 5845},
name: "DocumentAttributeName",
},
},
&litMatcher{
pos: position{line: 179, col: 61, offset: 5868},
val: ":",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 179, col: 65, offset: 5872},
expr: &ruleRefExpr{
pos: position{line: 179, col: 65, offset: 5872},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 179, col: 69, offset: 5876},
name: "EOL",
},
},
},
},
&actionExpr{
pos: position{line: 181, col: 5, offset: 5944},
run: (*parser).callonDocumentAttributeReset11,
expr: &seqExpr{
pos: position{line: 181, col: 5, offset: 5944},
exprs: []interface{}{
&litMatcher{
pos: position{line: 181, col: 5, offset: 5944},
val: ":",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 181, col: 9, offset: 5948},
label: "name",
expr: &ruleRefExpr{
pos: position{line: 181, col: 15, offset: 5954},
name: "DocumentAttributeName",
},
},
&litMatcher{
pos: position{line: 181, col: 38, offset: 5977},
val: "!:",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 181, col: 43, offset: 5982},
expr: &ruleRefExpr{
pos: position{line: 181, col: 43, offset: 5982},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 181, col: 47, offset: 5986},
name: "EOL",
},
},
},
},
},
},
},
{
name: "DocumentAttributeSubstitution",
pos: position{line: 185, col: 1, offset: 6053},
expr: &actionExpr{
pos: position{line: 185, col: 34, offset: 6086},
run: (*parser).callonDocumentAttributeSubstitution1,
expr: &seqExpr{
pos: position{line: 185, col: 34, offset: 6086},
exprs: []interface{}{
&litMatcher{
pos: position{line: 185, col: 34, offset: 6086},
val: "{",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 185, col: 38, offset: 6090},
label: "name",
expr: &ruleRefExpr{
pos: position{line: 185, col: 44, offset: 6096},
name: "DocumentAttributeName",
},
},
&litMatcher{
pos: position{line: 185, col: 67, offset: 6119},
val: "}",
ignoreCase: false,
},
},
},
},
},
{
name: "ElementAttributes",
pos: position{line: 192, col: 1, offset: 6307},
expr: &actionExpr{
pos: position{line: 192, col: 22, offset: 6328},
run: (*parser).callonElementAttributes1,
expr: &seqExpr{
pos: position{line: 192, col: 22, offset: 6328},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 192, col: 22, offset: 6328},
label: "attrs",
expr: &oneOrMoreExpr{
pos: position{line: 192, col: 28, offset: 6334},
expr: &ruleRefExpr{
pos: position{line: 192, col: 29, offset: 6335},
name: "ElementAttribute",
},
},
},
&zeroOrMoreExpr{
pos: position{line: 192, col: 48, offset: 6354},
expr: &ruleRefExpr{
pos: position{line: 192, col: 48, offset: 6354},
name: "BlankLine",
},
},
},
},
},
},
{
name: "ElementAttribute",
pos: position{line: 196, col: 1, offset: 6436},
expr: &actionExpr{
pos: position{line: 196, col: 21, offset: 6456},
run: (*parser).callonElementAttribute1,
expr: &seqExpr{
pos: position{line: 196, col: 21, offset: 6456},
exprs: []interface{}{
&andExpr{
pos: position{line: 196, col: 21, offset: 6456},
expr: &choiceExpr{
pos: position{line: 196, col: 23, offset: 6458},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 196, col: 23, offset: 6458},
val: "[",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 196, col: 29, offset: 6464},
val: ".",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 196, col: 35, offset: 6470},
val: "#",
ignoreCase: false,
},
},
},
},
&labeledExpr{
pos: position{line: 197, col: 5, offset: 6546},
label: "attr",
expr: &choiceExpr{
pos: position{line: 197, col: 11, offset: 6552},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 197, col: 11, offset: 6552},
name: "ElementID",
},
&ruleRefExpr{
pos: position{line: 198, col: 9, offset: 6573},
name: "ElementTitle",
},
&ruleRefExpr{
pos: position{line: 199, col: 9, offset: 6597},
name: "ElementRole",
},
&ruleRefExpr{
pos: position{line: 200, col: 9, offset: 6620},
name: "LiteralAttribute",
},
&ruleRefExpr{
pos: position{line: 201, col: 9, offset: 6648},
name: "SourceAttributes",
},
&ruleRefExpr{
pos: position{line: 202, col: 9, offset: 6676},
name: "QuoteAttributes",
},
&ruleRefExpr{
pos: position{line: 203, col: 9, offset: 6703},
name: "VerseAttributes",
},
&ruleRefExpr{
pos: position{line: 204, col: 9, offset: 6730},
name: "AdmonitionMarkerAttribute",
},
&ruleRefExpr{
pos: position{line: 205, col: 9, offset: 6767},
name: "HorizontalLayout",
},
&ruleRefExpr{
pos: position{line: 206, col: 9, offset: 6795},
name: "AttributeGroup",
},
},
},
},
},
},
},
},
{
name: "MasqueradeAttribute",
pos: position{line: 211, col: 1, offset: 6978},
expr: &choiceExpr{
pos: position{line: 211, col: 24, offset: 7001},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 211, col: 24, offset: 7001},
name: "QuoteAttributes",
},
&ruleRefExpr{
pos: position{line: 211, col: 42, offset: 7019},
name: "VerseAttributes",
},
},
},
},
{
name: "ElementID",
pos: position{line: 213, col: 1, offset: 7036},
expr: &choiceExpr{
pos: position{line: 213, col: 14, offset: 7049},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 213, col: 14, offset: 7049},
run: (*parser).callonElementID2,
expr: &seqExpr{
pos: position{line: 213, col: 14, offset: 7049},
exprs: []interface{}{
&litMatcher{
pos: position{line: 213, col: 14, offset: 7049},
val: "[[",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 213, col: 19, offset: 7054},
label: "id",
expr: &ruleRefExpr{
pos: position{line: 213, col: 23, offset: 7058},
name: "ID",
},
},
&litMatcher{
pos: position{line: 213, col: 27, offset: 7062},
val: "]]",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 213, col: 32, offset: 7067},
expr: &ruleRefExpr{
pos: position{line: 213, col: 32, offset: 7067},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 213, col: 36, offset: 7071},
name: "EOL",
},
},
},
},
&actionExpr{
pos: position{line: 215, col: 5, offset: 7124},
run: (*parser).callonElementID11,
expr: &seqExpr{
pos: position{line: 215, col: 5, offset: 7124},
exprs: []interface{}{
&litMatcher{
pos: position{line: 215, col: 5, offset: 7124},
val: "[#",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 215, col: 10, offset: 7129},
label: "id",
expr: &ruleRefExpr{
pos: position{line: 215, col: 14, offset: 7133},
name: "ID",
},
},
&litMatcher{
pos: position{line: 215, col: 18, offset: 7137},
val: "]",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 215, col: 23, offset: 7142},
expr: &ruleRefExpr{
pos: position{line: 215, col: 23, offset: 7142},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 215, col: 27, offset: 7146},
name: "EOL",
},
},
},
},
},
},
},
{
name: "InlineElementID",
pos: position{line: 219, col: 1, offset: 7198},
expr: &actionExpr{
pos: position{line: 219, col: 20, offset: 7217},
run: (*parser).callonInlineElementID1,
expr: &seqExpr{
pos: position{line: 219, col: 20, offset: 7217},
exprs: []interface{}{
&litMatcher{
pos: position{line: 219, col: 20, offset: 7217},
val: "[[",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 219, col: 25, offset: 7222},
label: "id",
expr: &ruleRefExpr{
pos: position{line: 219, col: 29, offset: 7226},
name: "ID",
},
},
&litMatcher{
pos: position{line: 219, col: 33, offset: 7230},
val: "]]",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 219, col: 38, offset: 7235},
expr: &ruleRefExpr{
pos: position{line: 219, col: 38, offset: 7235},
name: "WS",
},
},
},
},
},
},
{
name: "ElementTitle",
pos: position{line: 225, col: 1, offset: 7509},
expr: &actionExpr{
pos: position{line: 225, col: 17, offset: 7525},
run: (*parser).callonElementTitle1,
expr: &seqExpr{
pos: position{line: 225, col: 17, offset: 7525},
exprs: []interface{}{
&litMatcher{
pos: position{line: 225, col: 17, offset: 7525},
val: ".",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 225, col: 21, offset: 7529},
label: "title",
expr: &actionExpr{
pos: position{line: 225, col: 28, offset: 7536},
run: (*parser).callonElementTitle5,
expr: &seqExpr{
pos: position{line: 225, col: 28, offset: 7536},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 225, col: 28, offset: 7536},
name: "Alphanums",
},
&zeroOrMoreExpr{
pos: position{line: 225, col: 38, offset: 7546},
expr: &choiceExpr{
pos: position{line: 225, col: 39, offset: 7547},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 225, col: 39, offset: 7547},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 225, col: 51, offset: 7559},
name: "Spaces",
},
&seqExpr{
pos: position{line: 225, col: 61, offset: 7569},
exprs: []interface{}{
¬Expr{
pos: position{line: 225, col: 61, offset: 7569},
expr: &ruleRefExpr{
pos: position{line: 225, col: 62, offset: 7570},
name: "Newline",
},
},
&anyMatcher{
line: 225, col: 70, offset: 7578,
},
},
},
},
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 227, col: 4, offset: 7619},
name: "EOL",
},
},
},
},
},
{
name: "ElementRole",
pos: position{line: 233, col: 1, offset: 7771},
expr: &actionExpr{
pos: position{line: 233, col: 16, offset: 7786},
run: (*parser).callonElementRole1,
expr: &seqExpr{
pos: position{line: 233, col: 16, offset: 7786},
exprs: []interface{}{
&litMatcher{
pos: position{line: 233, col: 16, offset: 7786},
val: "[.",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 233, col: 21, offset: 7791},
label: "role",
expr: &actionExpr{
pos: position{line: 233, col: 27, offset: 7797},
run: (*parser).callonElementRole5,
expr: &seqExpr{
pos: position{line: 233, col: 27, offset: 7797},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 233, col: 27, offset: 7797},
name: "Alphanums",
},
&zeroOrMoreExpr{
pos: position{line: 233, col: 37, offset: 7807},
expr: &choiceExpr{
pos: position{line: 233, col: 38, offset: 7808},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 233, col: 38, offset: 7808},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 233, col: 50, offset: 7820},
name: "Spaces",
},
&seqExpr{
pos: position{line: 233, col: 60, offset: 7830},
exprs: []interface{}{
¬Expr{
pos: position{line: 233, col: 60, offset: 7830},
expr: &ruleRefExpr{
pos: position{line: 233, col: 61, offset: 7831},
name: "Newline",
},
},
¬Expr{
pos: position{line: 233, col: 69, offset: 7839},
expr: &litMatcher{
pos: position{line: 233, col: 70, offset: 7840},
val: "]",
ignoreCase: false,
},
},
&anyMatcher{
line: 233, col: 74, offset: 7844,
},
},
},
},
},
},
},
},
},
},
&litMatcher{
pos: position{line: 235, col: 4, offset: 7885},
val: "]",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 235, col: 8, offset: 7889},
expr: &ruleRefExpr{
pos: position{line: 235, col: 8, offset: 7889},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 235, col: 12, offset: 7893},
name: "EOL",
},
},
},
},
},
{
name: "LiteralAttribute",
pos: position{line: 239, col: 1, offset: 7949},
expr: &actionExpr{
pos: position{line: 239, col: 21, offset: 7969},
run: (*parser).callonLiteralAttribute1,
expr: &seqExpr{
pos: position{line: 239, col: 21, offset: 7969},
exprs: []interface{}{
&litMatcher{
pos: position{line: 239, col: 21, offset: 7969},
val: "[literal]",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 239, col: 33, offset: 7981},
expr: &ruleRefExpr{
pos: position{line: 239, col: 33, offset: 7981},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 239, col: 37, offset: 7985},
name: "Newline",
},
},
},
},
},
{
name: "AdmonitionMarkerAttribute",
pos: position{line: 244, col: 1, offset: 8117},
expr: &actionExpr{
pos: position{line: 244, col: 30, offset: 8146},
run: (*parser).callonAdmonitionMarkerAttribute1,
expr: &seqExpr{
pos: position{line: 244, col: 30, offset: 8146},
exprs: []interface{}{
&litMatcher{
pos: position{line: 244, col: 30, offset: 8146},
val: "[",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 244, col: 34, offset: 8150},
label: "k",
expr: &ruleRefExpr{
pos: position{line: 244, col: 37, offset: 8153},
name: "AdmonitionKind",
},
},
&litMatcher{
pos: position{line: 244, col: 53, offset: 8169},
val: "]",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 244, col: 57, offset: 8173},
expr: &ruleRefExpr{
pos: position{line: 244, col: 57, offset: 8173},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 244, col: 61, offset: 8177},
name: "EOL",
},
},
},
},
},
{
name: "SourceAttributes",
pos: position{line: 249, col: 1, offset: 8332},
expr: &actionExpr{
pos: position{line: 249, col: 21, offset: 8352},
run: (*parser).callonSourceAttributes1,
expr: &seqExpr{
pos: position{line: 249, col: 21, offset: 8352},
exprs: []interface{}{
&litMatcher{
pos: position{line: 249, col: 21, offset: 8352},
val: "[source",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 250, col: 5, offset: 8367},
label: "language",
expr: &zeroOrOneExpr{
pos: position{line: 250, col: 14, offset: 8376},
expr: &actionExpr{
pos: position{line: 250, col: 15, offset: 8377},
run: (*parser).callonSourceAttributes6,
expr: &seqExpr{
pos: position{line: 250, col: 15, offset: 8377},
exprs: []interface{}{
&litMatcher{
pos: position{line: 250, col: 15, offset: 8377},
val: ",",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 250, col: 19, offset: 8381},
label: "attr",
expr: &zeroOrOneExpr{
pos: position{line: 250, col: 24, offset: 8386},
expr: &ruleRefExpr{
pos: position{line: 250, col: 25, offset: 8387},
name: "StandaloneAttributeValue",
},
},
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 251, col: 5, offset: 8442},
label: "others",
expr: &zeroOrMoreExpr{
pos: position{line: 251, col: 12, offset: 8449},
expr: &actionExpr{
pos: position{line: 251, col: 13, offset: 8450},
run: (*parser).callonSourceAttributes14,
expr: &seqExpr{
pos: position{line: 251, col: 13, offset: 8450},
exprs: []interface{}{
&litMatcher{
pos: position{line: 251, col: 13, offset: 8450},
val: ",",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 251, col: 17, offset: 8454},
label: "attr",
expr: &zeroOrOneExpr{
pos: position{line: 251, col: 22, offset: 8459},
expr: &ruleRefExpr{
pos: position{line: 251, col: 23, offset: 8460},
name: "GenericAttribute",
},
},
},
},
},
},
},
},
&litMatcher{
pos: position{line: 252, col: 5, offset: 8507},
val: "]",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 252, col: 9, offset: 8511},
expr: &ruleRefExpr{
pos: position{line: 252, col: 9, offset: 8511},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 252, col: 13, offset: 8515},
name: "EOL",
},
},
},
},
},
{
name: "AttributeGroup",
pos: position{line: 257, col: 1, offset: 8666},
expr: &actionExpr{
pos: position{line: 257, col: 19, offset: 8684},
run: (*parser).callonAttributeGroup1,
expr: &seqExpr{
pos: position{line: 257, col: 19, offset: 8684},
exprs: []interface{}{
&litMatcher{
pos: position{line: 257, col: 19, offset: 8684},
val: "[",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 257, col: 23, offset: 8688},
label: "attributes",
expr: &zeroOrMoreExpr{
pos: position{line: 257, col: 34, offset: 8699},
expr: &ruleRefExpr{
pos: position{line: 257, col: 35, offset: 8700},
name: "GenericAttribute",
},
},
},
&litMatcher{
pos: position{line: 257, col: 54, offset: 8719},
val: "]",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 257, col: 58, offset: 8723},
expr: &ruleRefExpr{
pos: position{line: 257, col: 58, offset: 8723},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 257, col: 62, offset: 8727},
name: "EOL",
},
},
},
},
},
{
name: "GenericAttribute",
pos: position{line: 261, col: 1, offset: 8799},
expr: &choiceExpr{
pos: position{line: 261, col: 21, offset: 8819},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 261, col: 21, offset: 8819},
name: "GenericAttributeWithValue",
},
&ruleRefExpr{
pos: position{line: 261, col: 49, offset: 8847},
name: "GenericAttributeWithoutValue",
},
},
},
},
{
name: "GenericAttributeWithValue",
pos: position{line: 263, col: 1, offset: 8877},
expr: &actionExpr{
pos: position{line: 263, col: 30, offset: 8906},
run: (*parser).callonGenericAttributeWithValue1,
expr: &seqExpr{
pos: position{line: 263, col: 30, offset: 8906},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 263, col: 30, offset: 8906},
label: "key",
expr: &ruleRefExpr{
pos: position{line: 263, col: 35, offset: 8911},
name: "AttributeKey",
},
},
&litMatcher{
pos: position{line: 263, col: 49, offset: 8925},
val: "=",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 263, col: 53, offset: 8929},
label: "value",
expr: &zeroOrOneExpr{
pos: position{line: 263, col: 59, offset: 8935},
expr: &ruleRefExpr{
pos: position{line: 263, col: 60, offset: 8936},
name: "AttributeValue",
},
},
},
&zeroOrOneExpr{
pos: position{line: 263, col: 77, offset: 8953},
expr: &litMatcher{
pos: position{line: 263, col: 77, offset: 8953},
val: ",",
ignoreCase: false,
},
},
&zeroOrMoreExpr{
pos: position{line: 263, col: 82, offset: 8958},
expr: &ruleRefExpr{
pos: position{line: 263, col: 82, offset: 8958},
name: "WS",
},
},
},
},
},
},
{
name: "GenericAttributeWithoutValue",
pos: position{line: 267, col: 1, offset: 9054},
expr: &actionExpr{
pos: position{line: 267, col: 33, offset: 9086},
run: (*parser).callonGenericAttributeWithoutValue1,
expr: &seqExpr{
pos: position{line: 267, col: 33, offset: 9086},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 267, col: 33, offset: 9086},
label: "key",
expr: &ruleRefExpr{
pos: position{line: 267, col: 38, offset: 9091},
name: "AttributeKey",
},
},
&zeroOrOneExpr{
pos: position{line: 267, col: 52, offset: 9105},
expr: &litMatcher{
pos: position{line: 267, col: 52, offset: 9105},
val: ",",
ignoreCase: false,
},
},
&zeroOrMoreExpr{
pos: position{line: 267, col: 57, offset: 9110},
expr: &ruleRefExpr{
pos: position{line: 267, col: 57, offset: 9110},
name: "WS",
},
},
},
},
},
},
{
name: "AttributeKey",
pos: position{line: 271, col: 1, offset: 9195},
expr: &actionExpr{
pos: position{line: 271, col: 17, offset: 9211},
run: (*parser).callonAttributeKey1,
expr: &seqExpr{
pos: position{line: 271, col: 17, offset: 9211},
exprs: []interface{}{
¬Expr{
pos: position{line: 271, col: 17, offset: 9211},
expr: &litMatcher{
pos: position{line: 271, col: 18, offset: 9212},
val: "quote",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 271, col: 26, offset: 9220},
expr: &litMatcher{
pos: position{line: 271, col: 27, offset: 9221},
val: "verse",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 271, col: 35, offset: 9229},
expr: &litMatcher{
pos: position{line: 271, col: 36, offset: 9230},
val: "literal",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 271, col: 46, offset: 9240},
expr: &ruleRefExpr{
pos: position{line: 271, col: 47, offset: 9241},
name: "Spaces",
},
},
&labeledExpr{
pos: position{line: 271, col: 54, offset: 9248},
label: "key",
expr: &oneOrMoreExpr{
pos: position{line: 271, col: 58, offset: 9252},
expr: &choiceExpr{
pos: position{line: 271, col: 59, offset: 9253},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 271, col: 59, offset: 9253},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 271, col: 71, offset: 9265},
name: "OtherAttributeChar",
},
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 271, col: 92, offset: 9286},
expr: &ruleRefExpr{
pos: position{line: 271, col: 92, offset: 9286},
name: "WS",
},
},
},
},
},
},
{
name: "AttributeValue",
pos: position{line: 275, col: 1, offset: 9326},
expr: &actionExpr{
pos: position{line: 275, col: 19, offset: 9344},
run: (*parser).callonAttributeValue1,
expr: &labeledExpr{
pos: position{line: 275, col: 19, offset: 9344},
label: "value",
expr: &oneOrMoreExpr{
pos: position{line: 275, col: 25, offset: 9350},
expr: &choiceExpr{
pos: position{line: 275, col: 26, offset: 9351},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 275, col: 26, offset: 9351},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 275, col: 38, offset: 9363},
name: "Spaces",
},
&ruleRefExpr{
pos: position{line: 275, col: 47, offset: 9372},
name: "OtherAttributeChar",
},
},
},
},
},
},
},
{
name: "StandaloneAttributeValue",
pos: position{line: 279, col: 1, offset: 9430},
expr: &actionExpr{
pos: position{line: 279, col: 29, offset: 9458},
run: (*parser).callonStandaloneAttributeValue1,
expr: &seqExpr{
pos: position{line: 279, col: 29, offset: 9458},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 279, col: 29, offset: 9458},
label: "value",
expr: &oneOrMoreExpr{
pos: position{line: 279, col: 35, offset: 9464},
expr: &choiceExpr{
pos: position{line: 279, col: 36, offset: 9465},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 279, col: 36, offset: 9465},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 279, col: 48, offset: 9477},
name: "Spaces",
},
&ruleRefExpr{
pos: position{line: 279, col: 57, offset: 9486},
name: "OtherAttributeChar",
},
},
},
},
},
¬Expr{
pos: position{line: 279, col: 78, offset: 9507},
expr: &litMatcher{
pos: position{line: 279, col: 79, offset: 9508},
val: "=",
ignoreCase: false,
},
},
},
},
},
},
{
name: "OtherAttributeChar",
pos: position{line: 283, col: 1, offset: 9674},
expr: &seqExpr{
pos: position{line: 283, col: 24, offset: 9697},
exprs: []interface{}{
¬Expr{
pos: position{line: 283, col: 24, offset: 9697},
expr: &ruleRefExpr{
pos: position{line: 283, col: 25, offset: 9698},
name: "Newline",
},
},
¬Expr{
pos: position{line: 283, col: 33, offset: 9706},
expr: &litMatcher{
pos: position{line: 283, col: 34, offset: 9707},
val: "=",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 283, col: 38, offset: 9711},
expr: &litMatcher{
pos: position{line: 283, col: 39, offset: 9712},
val: ",",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 283, col: 43, offset: 9716},
expr: &litMatcher{
pos: position{line: 283, col: 44, offset: 9717},
val: "]",
ignoreCase: false,
},
},
&anyMatcher{
line: 283, col: 48, offset: 9721,
},
},
},
},
{
name: "HorizontalLayout",
pos: position{line: 285, col: 1, offset: 9725},
expr: &actionExpr{
pos: position{line: 285, col: 21, offset: 9745},
run: (*parser).callonHorizontalLayout1,
expr: &seqExpr{
pos: position{line: 285, col: 21, offset: 9745},
exprs: []interface{}{
&litMatcher{
pos: position{line: 285, col: 21, offset: 9745},
val: "[horizontal]",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 285, col: 36, offset: 9760},
expr: &ruleRefExpr{
pos: position{line: 285, col: 36, offset: 9760},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 285, col: 40, offset: 9764},
name: "EOL",
},
},
},
},
},
{
name: "QuoteAttributes",
pos: position{line: 289, col: 1, offset: 9837},
expr: &actionExpr{
pos: position{line: 289, col: 20, offset: 9856},
run: (*parser).callonQuoteAttributes1,
expr: &seqExpr{
pos: position{line: 289, col: 20, offset: 9856},
exprs: []interface{}{
&litMatcher{
pos: position{line: 289, col: 20, offset: 9856},
val: "[quote",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 289, col: 29, offset: 9865},
expr: &ruleRefExpr{
pos: position{line: 289, col: 29, offset: 9865},
name: "WS",
},
},
&zeroOrOneExpr{
pos: position{line: 289, col: 33, offset: 9869},
expr: &litMatcher{
pos: position{line: 289, col: 33, offset: 9869},
val: ",",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 289, col: 38, offset: 9874},
label: "author",
expr: &zeroOrOneExpr{
pos: position{line: 289, col: 45, offset: 9881},
expr: &ruleRefExpr{
pos: position{line: 289, col: 46, offset: 9882},
name: "QuoteAttribute",
},
},
},
&zeroOrOneExpr{
pos: position{line: 289, col: 63, offset: 9899},
expr: &litMatcher{
pos: position{line: 289, col: 63, offset: 9899},
val: ",",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 289, col: 68, offset: 9904},
label: "title",
expr: &zeroOrOneExpr{
pos: position{line: 289, col: 74, offset: 9910},
expr: &ruleRefExpr{
pos: position{line: 289, col: 75, offset: 9911},
name: "QuoteAttribute",
},
},
},
&litMatcher{
pos: position{line: 289, col: 92, offset: 9928},
val: "]",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 289, col: 96, offset: 9932},
expr: &ruleRefExpr{
pos: position{line: 289, col: 96, offset: 9932},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 289, col: 100, offset: 9936},
name: "EOL",
},
},
},
},
},
{
name: "VerseAttributes",
pos: position{line: 293, col: 1, offset: 10005},
expr: &actionExpr{
pos: position{line: 293, col: 20, offset: 10024},
run: (*parser).callonVerseAttributes1,
expr: &seqExpr{
pos: position{line: 293, col: 20, offset: 10024},
exprs: []interface{}{
&litMatcher{
pos: position{line: 293, col: 20, offset: 10024},
val: "[verse",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 293, col: 29, offset: 10033},
expr: &ruleRefExpr{
pos: position{line: 293, col: 29, offset: 10033},
name: "WS",
},
},
&zeroOrOneExpr{
pos: position{line: 293, col: 33, offset: 10037},
expr: &litMatcher{
pos: position{line: 293, col: 33, offset: 10037},
val: ",",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 293, col: 38, offset: 10042},
label: "author",
expr: &zeroOrOneExpr{
pos: position{line: 293, col: 45, offset: 10049},
expr: &ruleRefExpr{
pos: position{line: 293, col: 46, offset: 10050},
name: "QuoteAttribute",
},
},
},
&zeroOrOneExpr{
pos: position{line: 293, col: 63, offset: 10067},
expr: &litMatcher{
pos: position{line: 293, col: 63, offset: 10067},
val: ",",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 293, col: 68, offset: 10072},
label: "title",
expr: &zeroOrOneExpr{
pos: position{line: 293, col: 74, offset: 10078},
expr: &ruleRefExpr{
pos: position{line: 293, col: 75, offset: 10079},
name: "QuoteAttribute",
},
},
},
&litMatcher{
pos: position{line: 293, col: 92, offset: 10096},
val: "]",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 293, col: 96, offset: 10100},
expr: &ruleRefExpr{
pos: position{line: 293, col: 96, offset: 10100},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 293, col: 100, offset: 10104},
name: "EOL",
},
},
},
},
},
{
name: "QuoteAttribute",
pos: position{line: 297, col: 1, offset: 10191},
expr: &actionExpr{
pos: position{line: 297, col: 19, offset: 10209},
run: (*parser).callonQuoteAttribute1,
expr: &zeroOrMoreExpr{
pos: position{line: 297, col: 19, offset: 10209},
expr: &choiceExpr{
pos: position{line: 297, col: 20, offset: 10210},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 297, col: 20, offset: 10210},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 297, col: 32, offset: 10222},
name: "Spaces",
},
&seqExpr{
pos: position{line: 297, col: 42, offset: 10232},
exprs: []interface{}{
¬Expr{
pos: position{line: 297, col: 42, offset: 10232},
expr: &litMatcher{
pos: position{line: 297, col: 43, offset: 10233},
val: ",",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 297, col: 47, offset: 10237},
expr: &litMatcher{
pos: position{line: 297, col: 48, offset: 10238},
val: "]",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 297, col: 52, offset: 10242},
expr: &ruleRefExpr{
pos: position{line: 297, col: 53, offset: 10243},
name: "EOL",
},
},
&anyMatcher{
line: 297, col: 57, offset: 10247,
},
},
},
},
},
},
},
},
{
name: "InlineAttributes",
pos: position{line: 301, col: 1, offset: 10288},
expr: &actionExpr{
pos: position{line: 301, col: 21, offset: 10308},
run: (*parser).callonInlineAttributes1,
expr: &seqExpr{
pos: position{line: 301, col: 21, offset: 10308},
exprs: []interface{}{
&litMatcher{
pos: position{line: 301, col: 21, offset: 10308},
val: "[",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 301, col: 25, offset: 10312},
label: "attrs",
expr: &zeroOrMoreExpr{
pos: position{line: 301, col: 31, offset: 10318},
expr: &ruleRefExpr{
pos: position{line: 301, col: 32, offset: 10319},
name: "GenericAttribute",
},
},
},
&litMatcher{
pos: position{line: 301, col: 51, offset: 10338},
val: "]",
ignoreCase: false,
},
},
},
},
},
{
name: "Section",
pos: position{line: 308, col: 1, offset: 10512},
expr: &actionExpr{
pos: position{line: 308, col: 12, offset: 10523},
run: (*parser).callonSection1,
expr: &seqExpr{
pos: position{line: 308, col: 12, offset: 10523},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 308, col: 12, offset: 10523},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 308, col: 23, offset: 10534},
expr: &ruleRefExpr{
pos: position{line: 308, col: 24, offset: 10535},
name: "ElementAttributes",
},
},
},
&labeledExpr{
pos: position{line: 309, col: 5, offset: 10559},
label: "level",
expr: &actionExpr{
pos: position{line: 309, col: 12, offset: 10566},
run: (*parser).callonSection7,
expr: &oneOrMoreExpr{
pos: position{line: 309, col: 12, offset: 10566},
expr: &litMatcher{
pos: position{line: 309, col: 13, offset: 10567},
val: "=",
ignoreCase: false,
},
},
},
},
&andCodeExpr{
pos: position{line: 313, col: 5, offset: 10658},
run: (*parser).callonSection10,
},
&oneOrMoreExpr{
pos: position{line: 317, col: 5, offset: 10810},
expr: &ruleRefExpr{
pos: position{line: 317, col: 5, offset: 10810},
name: "WS",
},
},
&labeledExpr{
pos: position{line: 317, col: 9, offset: 10814},
label: "title",
expr: &ruleRefExpr{
pos: position{line: 317, col: 16, offset: 10821},
name: "TitleElements",
},
},
&labeledExpr{
pos: position{line: 317, col: 31, offset: 10836},
label: "id",
expr: &zeroOrMoreExpr{
pos: position{line: 317, col: 35, offset: 10840},
expr: &ruleRefExpr{
pos: position{line: 317, col: 35, offset: 10840},
name: "InlineElementID",
},
},
},
&ruleRefExpr{
pos: position{line: 317, col: 53, offset: 10858},
name: "EOL",
},
},
},
},
},
{
name: "TitleElements",
pos: position{line: 321, col: 1, offset: 10964},
expr: &actionExpr{
pos: position{line: 321, col: 18, offset: 10981},
run: (*parser).callonTitleElements1,
expr: &labeledExpr{
pos: position{line: 321, col: 18, offset: 10981},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 321, col: 27, offset: 10990},
expr: &seqExpr{
pos: position{line: 321, col: 28, offset: 10991},
exprs: []interface{}{
¬Expr{
pos: position{line: 321, col: 28, offset: 10991},
expr: &ruleRefExpr{
pos: position{line: 321, col: 29, offset: 10992},
name: "Newline",
},
},
¬Expr{
pos: position{line: 321, col: 37, offset: 11000},
expr: &ruleRefExpr{
pos: position{line: 321, col: 38, offset: 11001},
name: "InlineElementID",
},
},
&ruleRefExpr{
pos: position{line: 321, col: 54, offset: 11017},
name: "TitleElement",
},
},
},
},
},
},
},
{
name: "TitleElement",
pos: position{line: 325, col: 1, offset: 11138},
expr: &actionExpr{
pos: position{line: 325, col: 17, offset: 11154},
run: (*parser).callonTitleElement1,
expr: &labeledExpr{
pos: position{line: 325, col: 17, offset: 11154},
label: "element",
expr: &choiceExpr{
pos: position{line: 325, col: 26, offset: 11163},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 325, col: 26, offset: 11163},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 326, col: 11, offset: 11184},
name: "Spaces",
},
&ruleRefExpr{
pos: position{line: 327, col: 11, offset: 11202},
name: "CrossReference",
},
&ruleRefExpr{
pos: position{line: 328, col: 11, offset: 11227},
name: "Passthrough",
},
&ruleRefExpr{
pos: position{line: 329, col: 11, offset: 11249},
name: "InlineImage",
},
&ruleRefExpr{
pos: position{line: 330, col: 11, offset: 11272},
name: "Link",
},
&ruleRefExpr{
pos: position{line: 331, col: 11, offset: 11287},
name: "InlineFootnote",
},
&ruleRefExpr{
pos: position{line: 332, col: 11, offset: 11312},
name: "QuotedText",
},
&ruleRefExpr{
pos: position{line: 333, col: 11, offset: 11333},
name: "DocumentAttributeSubstitution",
},
&ruleRefExpr{
pos: position{line: 334, col: 11, offset: 11373},
name: "LineBreak",
},
&ruleRefExpr{
pos: position{line: 335, col: 11, offset: 11393},
name: "Parenthesis",
},
&ruleRefExpr{
pos: position{line: 336, col: 11, offset: 11415},
name: "AnyChars",
},
&ruleRefExpr{
pos: position{line: 337, col: 11, offset: 11434},
name: "AnyChar",
},
},
},
},
},
},
{
name: "TableOfContentsPlaceHolder",
pos: position{line: 344, col: 1, offset: 11586},
expr: &seqExpr{
pos: position{line: 344, col: 31, offset: 11616},
exprs: []interface{}{
&litMatcher{
pos: position{line: 344, col: 31, offset: 11616},
val: "toc::[]",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 344, col: 41, offset: 11626},
name: "EOL",
},
},
},
},
{
name: "UserMacroBlock",
pos: position{line: 349, col: 1, offset: 11737},
expr: &actionExpr{
pos: position{line: 349, col: 19, offset: 11755},
run: (*parser).callonUserMacroBlock1,
expr: &seqExpr{
pos: position{line: 349, col: 19, offset: 11755},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 349, col: 19, offset: 11755},
label: "name",
expr: &ruleRefExpr{
pos: position{line: 349, col: 25, offset: 11761},
name: "UserMacroName",
},
},
&litMatcher{
pos: position{line: 349, col: 40, offset: 11776},
val: "::",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 349, col: 45, offset: 11781},
label: "value",
expr: &ruleRefExpr{
pos: position{line: 349, col: 52, offset: 11788},
name: "UserMacroValue",
},
},
&labeledExpr{
pos: position{line: 349, col: 68, offset: 11804},
label: "attrs",
expr: &ruleRefExpr{
pos: position{line: 349, col: 75, offset: 11811},
name: "UserMacroAttributes",
},
},
},
},
},
},
{
name: "InlineUserMacro",
pos: position{line: 353, col: 1, offset: 11952},
expr: &actionExpr{
pos: position{line: 353, col: 20, offset: 11971},
run: (*parser).callonInlineUserMacro1,
expr: &seqExpr{
pos: position{line: 353, col: 20, offset: 11971},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 353, col: 20, offset: 11971},
label: "name",
expr: &ruleRefExpr{
pos: position{line: 353, col: 26, offset: 11977},
name: "UserMacroName",
},
},
&litMatcher{
pos: position{line: 353, col: 41, offset: 11992},
val: ":",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 353, col: 45, offset: 11996},
label: "value",
expr: &ruleRefExpr{
pos: position{line: 353, col: 52, offset: 12003},
name: "UserMacroValue",
},
},
&labeledExpr{
pos: position{line: 353, col: 68, offset: 12019},
label: "attrs",
expr: &ruleRefExpr{
pos: position{line: 353, col: 75, offset: 12026},
name: "UserMacroAttributes",
},
},
},
},
},
},
{
name: "UserMacroName",
pos: position{line: 357, col: 1, offset: 12168},
expr: &actionExpr{
pos: position{line: 357, col: 18, offset: 12185},
run: (*parser).callonUserMacroName1,
expr: &oneOrMoreExpr{
pos: position{line: 357, col: 18, offset: 12185},
expr: &choiceExpr{
pos: position{line: 357, col: 19, offset: 12186},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 357, col: 19, offset: 12186},
val: "[a-zA-Z0-9]",
ranges: []rune{'a', 'z', 'A', 'Z', '0', '9'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 357, col: 33, offset: 12200},
val: "_",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 357, col: 39, offset: 12206},
val: "-",
ignoreCase: false,
},
},
},
},
},
},
{
name: "UserMacroValue",
pos: position{line: 361, col: 1, offset: 12248},
expr: &actionExpr{
pos: position{line: 361, col: 19, offset: 12266},
run: (*parser).callonUserMacroValue1,
expr: &zeroOrMoreExpr{
pos: position{line: 361, col: 19, offset: 12266},
expr: &choiceExpr{
pos: position{line: 361, col: 20, offset: 12267},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 361, col: 20, offset: 12267},
name: "Alphanums",
},
&seqExpr{
pos: position{line: 361, col: 33, offset: 12280},
exprs: []interface{}{
¬Expr{
pos: position{line: 361, col: 33, offset: 12280},
expr: &ruleRefExpr{
pos: position{line: 361, col: 34, offset: 12281},
name: "WS",
},
},
¬Expr{
pos: position{line: 361, col: 37, offset: 12284},
expr: &litMatcher{
pos: position{line: 361, col: 38, offset: 12285},
val: ":",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 361, col: 42, offset: 12289},
expr: &litMatcher{
pos: position{line: 361, col: 43, offset: 12290},
val: "[",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 361, col: 47, offset: 12294},
expr: &ruleRefExpr{
pos: position{line: 361, col: 48, offset: 12295},
name: "EOL",
},
},
&anyMatcher{
line: 361, col: 52, offset: 12299,
},
},
},
},
},
},
},
},
{
name: "UserMacroAttributes",
pos: position{line: 365, col: 1, offset: 12340},
expr: &actionExpr{
pos: position{line: 365, col: 24, offset: 12363},
run: (*parser).callonUserMacroAttributes1,
expr: &seqExpr{
pos: position{line: 365, col: 24, offset: 12363},
exprs: []interface{}{
&litMatcher{
pos: position{line: 365, col: 24, offset: 12363},
val: "[",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 365, col: 28, offset: 12367},
label: "attrs",
expr: &zeroOrMoreExpr{
pos: position{line: 365, col: 34, offset: 12373},
expr: &ruleRefExpr{
pos: position{line: 365, col: 35, offset: 12374},
name: "GenericAttribute",
},
},
},
&litMatcher{
pos: position{line: 365, col: 54, offset: 12393},
val: "]",
ignoreCase: false,
},
},
},
},
},
{
name: "FileInclusion",
pos: position{line: 372, col: 1, offset: 12573},
expr: &actionExpr{
pos: position{line: 372, col: 18, offset: 12590},
run: (*parser).callonFileInclusion1,
expr: &seqExpr{
pos: position{line: 372, col: 18, offset: 12590},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 372, col: 18, offset: 12590},
label: "incl",
expr: &actionExpr{
pos: position{line: 372, col: 24, offset: 12596},
run: (*parser).callonFileInclusion4,
expr: &seqExpr{
pos: position{line: 372, col: 24, offset: 12596},
exprs: []interface{}{
&litMatcher{
pos: position{line: 372, col: 24, offset: 12596},
val: "include::",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 372, col: 36, offset: 12608},
label: "path",
expr: &ruleRefExpr{
pos: position{line: 372, col: 42, offset: 12614},
name: "FileLocation",
},
},
&labeledExpr{
pos: position{line: 372, col: 56, offset: 12628},
label: "inlineAttributes",
expr: &ruleRefExpr{
pos: position{line: 372, col: 74, offset: 12646},
name: "FileIncludeAttributes",
},
},
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 374, col: 8, offset: 12800},
expr: &ruleRefExpr{
pos: position{line: 374, col: 8, offset: 12800},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 374, col: 12, offset: 12804},
name: "EOL",
},
},
},
},
},
{
name: "FileIncludeAttributes",
pos: position{line: 378, col: 1, offset: 12856},
expr: &actionExpr{
pos: position{line: 378, col: 26, offset: 12881},
run: (*parser).callonFileIncludeAttributes1,
expr: &seqExpr{
pos: position{line: 378, col: 26, offset: 12881},
exprs: []interface{}{
&litMatcher{
pos: position{line: 378, col: 26, offset: 12881},
val: "[",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 378, col: 30, offset: 12885},
label: "attrs",
expr: &zeroOrMoreExpr{
pos: position{line: 378, col: 36, offset: 12891},
expr: &choiceExpr{
pos: position{line: 378, col: 37, offset: 12892},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 378, col: 37, offset: 12892},
name: "LineRangesAttribute",
},
&ruleRefExpr{
pos: position{line: 378, col: 59, offset: 12914},
name: "TagRangesAttribute",
},
&ruleRefExpr{
pos: position{line: 378, col: 80, offset: 12935},
name: "GenericAttribute",
},
},
},
},
},
&litMatcher{
pos: position{line: 378, col: 99, offset: 12954},
val: "]",
ignoreCase: false,
},
},
},
},
},
{
name: "LineRangesAttribute",
pos: position{line: 382, col: 1, offset: 13024},
expr: &actionExpr{
pos: position{line: 382, col: 24, offset: 13047},
run: (*parser).callonLineRangesAttribute1,
expr: &seqExpr{
pos: position{line: 382, col: 24, offset: 13047},
exprs: []interface{}{
&litMatcher{
pos: position{line: 382, col: 24, offset: 13047},
val: "lines=",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 382, col: 33, offset: 13056},
label: "lines",
expr: &ruleRefExpr{
pos: position{line: 382, col: 40, offset: 13063},
name: "LineRangesAttributeValue",
},
},
&zeroOrOneExpr{
pos: position{line: 382, col: 66, offset: 13089},
expr: &litMatcher{
pos: position{line: 382, col: 66, offset: 13089},
val: ",",
ignoreCase: false,
},
},
},
},
},
},
{
name: "LineRangesAttributeValue",
pos: position{line: 386, col: 1, offset: 13148},
expr: &actionExpr{
pos: position{line: 386, col: 29, offset: 13176},
run: (*parser).callonLineRangesAttributeValue1,
expr: &seqExpr{
pos: position{line: 386, col: 29, offset: 13176},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 386, col: 29, offset: 13176},
label: "value",
expr: &choiceExpr{
pos: position{line: 386, col: 36, offset: 13183},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 386, col: 36, offset: 13183},
name: "MultipleLineRanges",
},
&ruleRefExpr{
pos: position{line: 387, col: 11, offset: 13300},
name: "MultipleQuotedLineRanges",
},
&ruleRefExpr{
pos: position{line: 388, col: 11, offset: 13336},
name: "MultiLineRange",
},
&ruleRefExpr{
pos: position{line: 389, col: 11, offset: 13362},
name: "MultiLineQuotedRange",
},
&ruleRefExpr{
pos: position{line: 390, col: 11, offset: 13394},
name: "SingleLineQuotedRange",
},
&ruleRefExpr{
pos: position{line: 391, col: 11, offset: 13426},
name: "SingleLineRange",
},
&ruleRefExpr{
pos: position{line: 392, col: 11, offset: 13453},
name: "UndefinedLineRange",
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 392, col: 31, offset: 13473},
expr: &ruleRefExpr{
pos: position{line: 392, col: 31, offset: 13473},
name: "WS",
},
},
&choiceExpr{
pos: position{line: 392, col: 36, offset: 13478},
alternatives: []interface{}{
&andExpr{
pos: position{line: 392, col: 36, offset: 13478},
expr: &litMatcher{
pos: position{line: 392, col: 37, offset: 13479},
val: ",",
ignoreCase: false,
},
},
&andExpr{
pos: position{line: 392, col: 43, offset: 13485},
expr: &litMatcher{
pos: position{line: 392, col: 44, offset: 13486},
val: "]",
ignoreCase: false,
},
},
},
},
},
},
},
},
{
name: "MultipleLineRanges",
pos: position{line: 396, col: 1, offset: 13518},
expr: &actionExpr{
pos: position{line: 396, col: 23, offset: 13540},
run: (*parser).callonMultipleLineRanges1,
expr: &seqExpr{
pos: position{line: 396, col: 23, offset: 13540},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 396, col: 23, offset: 13540},
label: "first",
expr: &choiceExpr{
pos: position{line: 396, col: 30, offset: 13547},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 396, col: 30, offset: 13547},
name: "MultiLineRange",
},
&ruleRefExpr{
pos: position{line: 396, col: 47, offset: 13564},
name: "SingleLineRange",
},
},
},
},
&labeledExpr{
pos: position{line: 397, col: 5, offset: 13586},
label: "others",
expr: &oneOrMoreExpr{
pos: position{line: 397, col: 12, offset: 13593},
expr: &actionExpr{
pos: position{line: 397, col: 13, offset: 13594},
run: (*parser).callonMultipleLineRanges9,
expr: &seqExpr{
pos: position{line: 397, col: 13, offset: 13594},
exprs: []interface{}{
&litMatcher{
pos: position{line: 397, col: 13, offset: 13594},
val: ";",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 397, col: 17, offset: 13598},
label: "other",
expr: &choiceExpr{
pos: position{line: 397, col: 24, offset: 13605},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 397, col: 24, offset: 13605},
name: "MultiLineRange",
},
&ruleRefExpr{
pos: position{line: 397, col: 41, offset: 13622},
name: "SingleLineRange",
},
},
},
},
},
},
},
},
},
},
},
},
},
{
name: "MultipleQuotedLineRanges",
pos: position{line: 403, col: 1, offset: 13760},
expr: &actionExpr{
pos: position{line: 403, col: 29, offset: 13788},
run: (*parser).callonMultipleQuotedLineRanges1,
expr: &seqExpr{
pos: position{line: 403, col: 29, offset: 13788},
exprs: []interface{}{
&litMatcher{
pos: position{line: 403, col: 29, offset: 13788},
val: "\"",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 403, col: 34, offset: 13793},
label: "first",
expr: &choiceExpr{
pos: position{line: 403, col: 41, offset: 13800},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 403, col: 41, offset: 13800},
name: "MultiLineRange",
},
&ruleRefExpr{
pos: position{line: 403, col: 58, offset: 13817},
name: "SingleLineRange",
},
},
},
},
&labeledExpr{
pos: position{line: 404, col: 5, offset: 13839},
label: "others",
expr: &oneOrMoreExpr{
pos: position{line: 404, col: 12, offset: 13846},
expr: &actionExpr{
pos: position{line: 404, col: 13, offset: 13847},
run: (*parser).callonMultipleQuotedLineRanges10,
expr: &seqExpr{
pos: position{line: 404, col: 13, offset: 13847},
exprs: []interface{}{
&litMatcher{
pos: position{line: 404, col: 13, offset: 13847},
val: ",",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 404, col: 17, offset: 13851},
label: "other",
expr: &choiceExpr{
pos: position{line: 404, col: 24, offset: 13858},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 404, col: 24, offset: 13858},
name: "MultiLineRange",
},
&ruleRefExpr{
pos: position{line: 404, col: 41, offset: 13875},
name: "SingleLineRange",
},
},
},
},
},
},
},
},
},
&litMatcher{
pos: position{line: 406, col: 9, offset: 13928},
val: "\"",
ignoreCase: false,
},
},
},
},
},
{
name: "MultiLineRange",
pos: position{line: 410, col: 1, offset: 14018},
expr: &actionExpr{
pos: position{line: 410, col: 19, offset: 14036},
run: (*parser).callonMultiLineRange1,
expr: &seqExpr{
pos: position{line: 410, col: 19, offset: 14036},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 410, col: 19, offset: 14036},
label: "start",
expr: &ruleRefExpr{
pos: position{line: 410, col: 26, offset: 14043},
name: "NUMBER",
},
},
&litMatcher{
pos: position{line: 410, col: 34, offset: 14051},
val: "..",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 410, col: 39, offset: 14056},
label: "end",
expr: &ruleRefExpr{
pos: position{line: 410, col: 44, offset: 14061},
name: "NUMBER",
},
},
},
},
},
},
{
name: "MultiLineQuotedRange",
pos: position{line: 414, col: 1, offset: 14149},
expr: &actionExpr{
pos: position{line: 414, col: 25, offset: 14173},
run: (*parser).callonMultiLineQuotedRange1,
expr: &seqExpr{
pos: position{line: 414, col: 25, offset: 14173},
exprs: []interface{}{
&litMatcher{
pos: position{line: 414, col: 25, offset: 14173},
val: "\"",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 414, col: 30, offset: 14178},
label: "start",
expr: &ruleRefExpr{
pos: position{line: 414, col: 37, offset: 14185},
name: "NUMBER",
},
},
&litMatcher{
pos: position{line: 414, col: 45, offset: 14193},
val: "..",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 414, col: 50, offset: 14198},
label: "end",
expr: &ruleRefExpr{
pos: position{line: 414, col: 55, offset: 14203},
name: "NUMBER",
},
},
&litMatcher{
pos: position{line: 414, col: 63, offset: 14211},
val: "\"",
ignoreCase: false,
},
},
},
},
},
{
name: "SingleLineRange",
pos: position{line: 418, col: 1, offset: 14296},
expr: &actionExpr{
pos: position{line: 418, col: 20, offset: 14315},
run: (*parser).callonSingleLineRange1,
expr: &labeledExpr{
pos: position{line: 418, col: 20, offset: 14315},
label: "singleline",
expr: &ruleRefExpr{
pos: position{line: 418, col: 32, offset: 14327},
name: "NUMBER",
},
},
},
},
{
name: "SingleLineQuotedRange",
pos: position{line: 422, col: 1, offset: 14422},
expr: &actionExpr{
pos: position{line: 422, col: 26, offset: 14447},
run: (*parser).callonSingleLineQuotedRange1,
expr: &seqExpr{
pos: position{line: 422, col: 26, offset: 14447},
exprs: []interface{}{
&litMatcher{
pos: position{line: 422, col: 26, offset: 14447},
val: "\"",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 422, col: 31, offset: 14452},
label: "singleline",
expr: &ruleRefExpr{
pos: position{line: 422, col: 43, offset: 14464},
name: "NUMBER",
},
},
&litMatcher{
pos: position{line: 422, col: 51, offset: 14472},
val: "\"",
ignoreCase: false,
},
},
},
},
},
{
name: "UndefinedLineRange",
pos: position{line: 426, col: 1, offset: 14564},
expr: &actionExpr{
pos: position{line: 426, col: 23, offset: 14586},
run: (*parser).callonUndefinedLineRange1,
expr: &zeroOrMoreExpr{
pos: position{line: 426, col: 23, offset: 14586},
expr: &seqExpr{
pos: position{line: 426, col: 24, offset: 14587},
exprs: []interface{}{
¬Expr{
pos: position{line: 426, col: 24, offset: 14587},
expr: &litMatcher{
pos: position{line: 426, col: 25, offset: 14588},
val: "]",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 426, col: 29, offset: 14592},
expr: &litMatcher{
pos: position{line: 426, col: 30, offset: 14593},
val: ",",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 426, col: 34, offset: 14597},
expr: &ruleRefExpr{
pos: position{line: 426, col: 35, offset: 14598},
name: "WS",
},
},
&anyMatcher{
line: 426, col: 38, offset: 14601,
},
},
},
},
},
},
{
name: "TagRangesAttribute",
pos: position{line: 430, col: 1, offset: 14641},
expr: &actionExpr{
pos: position{line: 430, col: 23, offset: 14663},
run: (*parser).callonTagRangesAttribute1,
expr: &seqExpr{
pos: position{line: 430, col: 23, offset: 14663},
exprs: []interface{}{
&choiceExpr{
pos: position{line: 430, col: 24, offset: 14664},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 430, col: 24, offset: 14664},
val: "tags=",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 430, col: 34, offset: 14674},
val: "tag=",
ignoreCase: false,
},
},
},
&labeledExpr{
pos: position{line: 430, col: 42, offset: 14682},
label: "tags",
expr: &ruleRefExpr{
pos: position{line: 430, col: 48, offset: 14688},
name: "TagRangesAttributeValue",
},
},
&zeroOrOneExpr{
pos: position{line: 430, col: 73, offset: 14713},
expr: &litMatcher{
pos: position{line: 430, col: 73, offset: 14713},
val: ",",
ignoreCase: false,
},
},
},
},
},
},
{
name: "TagRangesAttributeValue",
pos: position{line: 434, col: 1, offset: 14862},
expr: &actionExpr{
pos: position{line: 434, col: 28, offset: 14889},
run: (*parser).callonTagRangesAttributeValue1,
expr: &seqExpr{
pos: position{line: 434, col: 28, offset: 14889},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 434, col: 28, offset: 14889},
label: "value",
expr: &ruleRefExpr{
pos: position{line: 434, col: 35, offset: 14896},
name: "MultipleTagRanges",
},
},
&zeroOrMoreExpr{
pos: position{line: 434, col: 54, offset: 14915},
expr: &ruleRefExpr{
pos: position{line: 434, col: 54, offset: 14915},
name: "WS",
},
},
&choiceExpr{
pos: position{line: 434, col: 59, offset: 14920},
alternatives: []interface{}{
&andExpr{
pos: position{line: 434, col: 59, offset: 14920},
expr: &litMatcher{
pos: position{line: 434, col: 60, offset: 14921},
val: ",",
ignoreCase: false,
},
},
&andExpr{
pos: position{line: 434, col: 66, offset: 14927},
expr: &litMatcher{
pos: position{line: 434, col: 67, offset: 14928},
val: "]",
ignoreCase: false,
},
},
},
},
},
},
},
},
{
name: "MultipleTagRanges",
pos: position{line: 438, col: 1, offset: 14960},
expr: &actionExpr{
pos: position{line: 438, col: 22, offset: 14981},
run: (*parser).callonMultipleTagRanges1,
expr: &seqExpr{
pos: position{line: 438, col: 22, offset: 14981},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 438, col: 22, offset: 14981},
label: "first",
expr: &ruleRefExpr{
pos: position{line: 438, col: 29, offset: 14988},
name: "TagRange",
},
},
&labeledExpr{
pos: position{line: 439, col: 5, offset: 15002},
label: "others",
expr: &zeroOrMoreExpr{
pos: position{line: 439, col: 12, offset: 15009},
expr: &actionExpr{
pos: position{line: 439, col: 13, offset: 15010},
run: (*parser).callonMultipleTagRanges7,
expr: &seqExpr{
pos: position{line: 439, col: 13, offset: 15010},
exprs: []interface{}{
&litMatcher{
pos: position{line: 439, col: 13, offset: 15010},
val: ";",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 439, col: 17, offset: 15014},
label: "other",
expr: &ruleRefExpr{
pos: position{line: 439, col: 24, offset: 15021},
name: "TagRange",
},
},
},
},
},
},
},
},
},
},
},
{
name: "TagRange",
pos: position{line: 445, col: 1, offset: 15152},
expr: &choiceExpr{
pos: position{line: 445, col: 13, offset: 15164},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 445, col: 13, offset: 15164},
run: (*parser).callonTagRange2,
expr: &labeledExpr{
pos: position{line: 445, col: 13, offset: 15164},
label: "tag",
expr: &choiceExpr{
pos: position{line: 445, col: 18, offset: 15169},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 445, col: 18, offset: 15169},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 445, col: 30, offset: 15181},
name: "TagWildcard",
},
},
},
},
},
&actionExpr{
pos: position{line: 447, col: 5, offset: 15249},
run: (*parser).callonTagRange7,
expr: &seqExpr{
pos: position{line: 447, col: 5, offset: 15249},
exprs: []interface{}{
&litMatcher{
pos: position{line: 447, col: 5, offset: 15249},
val: "!",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 447, col: 9, offset: 15253},
label: "tag",
expr: &choiceExpr{
pos: position{line: 447, col: 14, offset: 15258},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 447, col: 14, offset: 15258},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 447, col: 26, offset: 15270},
name: "TagWildcard",
},
},
},
},
},
},
},
},
},
},
{
name: "TagWildcard",
pos: position{line: 451, col: 1, offset: 15338},
expr: &actionExpr{
pos: position{line: 451, col: 16, offset: 15353},
run: (*parser).callonTagWildcard1,
expr: &seqExpr{
pos: position{line: 451, col: 16, offset: 15353},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 451, col: 16, offset: 15353},
label: "stars",
expr: &actionExpr{
pos: position{line: 451, col: 23, offset: 15360},
run: (*parser).callonTagWildcard4,
expr: &oneOrMoreExpr{
pos: position{line: 451, col: 23, offset: 15360},
expr: &litMatcher{
pos: position{line: 451, col: 24, offset: 15361},
val: "*",
ignoreCase: false,
},
},
},
},
&andCodeExpr{
pos: position{line: 454, col: 5, offset: 15415},
run: (*parser).callonTagWildcard7,
},
},
},
},
},
{
name: "IncludedFileLine",
pos: position{line: 464, col: 1, offset: 15709},
expr: &actionExpr{
pos: position{line: 464, col: 21, offset: 15729},
run: (*parser).callonIncludedFileLine1,
expr: &seqExpr{
pos: position{line: 464, col: 21, offset: 15729},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 464, col: 21, offset: 15729},
label: "content",
expr: &zeroOrMoreExpr{
pos: position{line: 464, col: 29, offset: 15737},
expr: &choiceExpr{
pos: position{line: 464, col: 30, offset: 15738},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 464, col: 30, offset: 15738},
name: "IncludedFileStartTag",
},
&ruleRefExpr{
pos: position{line: 464, col: 53, offset: 15761},
name: "IncludedFileEndTag",
},
&actionExpr{
pos: position{line: 464, col: 74, offset: 15782},
run: (*parser).callonIncludedFileLine8,
expr: &anyMatcher{
line: 464, col: 74, offset: 15782,
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 464, col: 107, offset: 15815},
name: "EOL",
},
},
},
},
},
{
name: "IncludedFileStartTag",
pos: position{line: 468, col: 1, offset: 15886},
expr: &actionExpr{
pos: position{line: 468, col: 25, offset: 15910},
run: (*parser).callonIncludedFileStartTag1,
expr: &seqExpr{
pos: position{line: 468, col: 25, offset: 15910},
exprs: []interface{}{
&litMatcher{
pos: position{line: 468, col: 25, offset: 15910},
val: "tag::",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 468, col: 33, offset: 15918},
label: "tag",
expr: &actionExpr{
pos: position{line: 468, col: 38, offset: 15923},
run: (*parser).callonIncludedFileStartTag5,
expr: &ruleRefExpr{
pos: position{line: 468, col: 38, offset: 15923},
name: "Alphanums",
},
},
},
&litMatcher{
pos: position{line: 468, col: 78, offset: 15963},
val: "[]",
ignoreCase: false,
},
},
},
},
},
{
name: "IncludedFileEndTag",
pos: position{line: 472, col: 1, offset: 16028},
expr: &actionExpr{
pos: position{line: 472, col: 23, offset: 16050},
run: (*parser).callonIncludedFileEndTag1,
expr: &seqExpr{
pos: position{line: 472, col: 23, offset: 16050},
exprs: []interface{}{
&litMatcher{
pos: position{line: 472, col: 23, offset: 16050},
val: "end::",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 472, col: 31, offset: 16058},
label: "tag",
expr: &actionExpr{
pos: position{line: 472, col: 36, offset: 16063},
run: (*parser).callonIncludedFileEndTag5,
expr: &ruleRefExpr{
pos: position{line: 472, col: 36, offset: 16063},
name: "Alphanums",
},
},
},
&litMatcher{
pos: position{line: 472, col: 76, offset: 16103},
val: "[]",
ignoreCase: false,
},
},
},
},
},
{
name: "ListItems",
pos: position{line: 479, col: 1, offset: 16267},
expr: &oneOrMoreExpr{
pos: position{line: 479, col: 14, offset: 16280},
expr: &ruleRefExpr{
pos: position{line: 479, col: 14, offset: 16280},
name: "ListItem",
},
},
},
{
name: "ListItem",
pos: position{line: 481, col: 1, offset: 16291},
expr: &choiceExpr{
pos: position{line: 481, col: 13, offset: 16303},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 481, col: 13, offset: 16303},
name: "OrderedListItem",
},
&ruleRefExpr{
pos: position{line: 481, col: 31, offset: 16321},
name: "UnorderedListItem",
},
&ruleRefExpr{
pos: position{line: 481, col: 51, offset: 16341},
name: "LabeledListItem",
},
&ruleRefExpr{
pos: position{line: 481, col: 69, offset: 16359},
name: "ContinuedListItemElement",
},
},
},
},
{
name: "ListParagraph",
pos: position{line: 483, col: 1, offset: 16385},
expr: &choiceExpr{
pos: position{line: 483, col: 18, offset: 16402},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 483, col: 18, offset: 16402},
run: (*parser).callonListParagraph2,
expr: &labeledExpr{
pos: position{line: 483, col: 18, offset: 16402},
label: "comment",
expr: &ruleRefExpr{
pos: position{line: 483, col: 27, offset: 16411},
name: "SingleLineComment",
},
},
},
&actionExpr{
pos: position{line: 485, col: 9, offset: 16468},
run: (*parser).callonListParagraph5,
expr: &labeledExpr{
pos: position{line: 485, col: 9, offset: 16468},
label: "lines",
expr: &oneOrMoreExpr{
pos: position{line: 485, col: 15, offset: 16474},
expr: &ruleRefExpr{
pos: position{line: 485, col: 16, offset: 16475},
name: "ListParagraphLine",
},
},
},
},
},
},
},
{
name: "ListParagraphLine",
pos: position{line: 489, col: 1, offset: 16567},
expr: &actionExpr{
pos: position{line: 489, col: 22, offset: 16588},
run: (*parser).callonListParagraphLine1,
expr: &seqExpr{
pos: position{line: 489, col: 22, offset: 16588},
exprs: []interface{}{
¬Expr{
pos: position{line: 489, col: 22, offset: 16588},
expr: &ruleRefExpr{
pos: position{line: 489, col: 23, offset: 16589},
name: "EOF",
},
},
¬Expr{
pos: position{line: 490, col: 5, offset: 16597},
expr: &ruleRefExpr{
pos: position{line: 490, col: 6, offset: 16598},
name: "BlankLine",
},
},
¬Expr{
pos: position{line: 491, col: 5, offset: 16613},
expr: &ruleRefExpr{
pos: position{line: 491, col: 6, offset: 16614},
name: "SingleLineComment",
},
},
¬Expr{
pos: position{line: 492, col: 5, offset: 16636},
expr: &ruleRefExpr{
pos: position{line: 492, col: 6, offset: 16637},
name: "OrderedListItemPrefix",
},
},
¬Expr{
pos: position{line: 493, col: 5, offset: 16663},
expr: &ruleRefExpr{
pos: position{line: 493, col: 6, offset: 16664},
name: "UnorderedListItemPrefix",
},
},
¬Expr{
pos: position{line: 494, col: 5, offset: 16692},
expr: &ruleRefExpr{
pos: position{line: 494, col: 6, offset: 16693},
name: "ListItemContinuation",
},
},
¬Expr{
pos: position{line: 495, col: 5, offset: 16718},
expr: &ruleRefExpr{
pos: position{line: 495, col: 6, offset: 16719},
name: "ElementAttribute",
},
},
¬Expr{
pos: position{line: 496, col: 5, offset: 16740},
expr: &ruleRefExpr{
pos: position{line: 496, col: 6, offset: 16741},
name: "BlockDelimiter",
},
},
¬Expr{
pos: position{line: 497, col: 5, offset: 16760},
expr: &seqExpr{
pos: position{line: 497, col: 7, offset: 16762},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 497, col: 7, offset: 16762},
name: "SimpleLabeledListItemTerm",
},
&ruleRefExpr{
pos: position{line: 497, col: 33, offset: 16788},
name: "LabeledListItemSeparator",
},
},
},
},
&labeledExpr{
pos: position{line: 498, col: 5, offset: 16819},
label: "line",
expr: &actionExpr{
pos: position{line: 499, col: 9, offset: 16834},
run: (*parser).callonListParagraphLine24,
expr: &seqExpr{
pos: position{line: 499, col: 9, offset: 16834},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 499, col: 9, offset: 16834},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 499, col: 18, offset: 16843},
expr: &ruleRefExpr{
pos: position{line: 499, col: 19, offset: 16844},
name: "InlineElement",
},
},
},
&labeledExpr{
pos: position{line: 499, col: 35, offset: 16860},
label: "linebreak",
expr: &zeroOrOneExpr{
pos: position{line: 499, col: 45, offset: 16870},
expr: &ruleRefExpr{
pos: position{line: 499, col: 46, offset: 16871},
name: "LineBreak",
},
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 501, col: 12, offset: 17023},
name: "EOL",
},
},
},
},
},
{
name: "ListItemContinuation",
pos: position{line: 505, col: 1, offset: 17070},
expr: &seqExpr{
pos: position{line: 505, col: 25, offset: 17094},
exprs: []interface{}{
&litMatcher{
pos: position{line: 505, col: 25, offset: 17094},
val: "+",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 505, col: 29, offset: 17098},
expr: &ruleRefExpr{
pos: position{line: 505, col: 29, offset: 17098},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 505, col: 33, offset: 17102},
name: "EOL",
},
},
},
},
{
name: "ContinuedListItemElement",
pos: position{line: 507, col: 1, offset: 17108},
expr: &actionExpr{
pos: position{line: 507, col: 29, offset: 17136},
run: (*parser).callonContinuedListItemElement1,
expr: &seqExpr{
pos: position{line: 507, col: 29, offset: 17136},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 507, col: 29, offset: 17136},
label: "blanklines",
expr: &zeroOrMoreExpr{
pos: position{line: 507, col: 41, offset: 17148},
expr: &ruleRefExpr{
pos: position{line: 507, col: 41, offset: 17148},
name: "BlankLine",
},
},
},
&ruleRefExpr{
pos: position{line: 507, col: 53, offset: 17160},
name: "ListItemContinuation",
},
&labeledExpr{
pos: position{line: 507, col: 74, offset: 17181},
label: "element",
expr: &ruleRefExpr{
pos: position{line: 507, col: 82, offset: 17189},
name: "ContinuedListItemBlock",
},
},
},
},
},
},
{
name: "ContinuedListItemBlock",
pos: position{line: 511, col: 1, offset: 17327},
expr: &actionExpr{
pos: position{line: 511, col: 27, offset: 17353},
run: (*parser).callonContinuedListItemBlock1,
expr: &seqExpr{
pos: position{line: 511, col: 27, offset: 17353},
exprs: []interface{}{
¬Expr{
pos: position{line: 511, col: 27, offset: 17353},
expr: &ruleRefExpr{
pos: position{line: 511, col: 28, offset: 17354},
name: "EOF",
},
},
&labeledExpr{
pos: position{line: 512, col: 5, offset: 17363},
label: "block",
expr: &choiceExpr{
pos: position{line: 512, col: 12, offset: 17370},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 512, col: 12, offset: 17370},
name: "DelimitedBlock",
},
&ruleRefExpr{
pos: position{line: 513, col: 11, offset: 17395},
name: "FileInclusion",
},
&ruleRefExpr{
pos: position{line: 514, col: 11, offset: 17419},
name: "VerseParagraph",
},
&ruleRefExpr{
pos: position{line: 515, col: 11, offset: 17473},
name: "ImageBlock",
},
&ruleRefExpr{
pos: position{line: 516, col: 11, offset: 17495},
name: "ListItem",
},
&ruleRefExpr{
pos: position{line: 517, col: 11, offset: 17514},
name: "BlankLine",
},
&ruleRefExpr{
pos: position{line: 518, col: 11, offset: 17565},
name: "LiteralBlock",
},
&ruleRefExpr{
pos: position{line: 519, col: 11, offset: 17589},
name: "DocumentAttributeDeclaration",
},
&ruleRefExpr{
pos: position{line: 520, col: 11, offset: 17629},
name: "DocumentAttributeReset",
},
&ruleRefExpr{
pos: position{line: 521, col: 11, offset: 17663},
name: "TableOfContentsPlaceHolder",
},
&ruleRefExpr{
pos: position{line: 522, col: 11, offset: 17700},
name: "UserMacroBlock",
},
&ruleRefExpr{
pos: position{line: 523, col: 11, offset: 17725},
name: "ContinuedParagraph",
},
},
},
},
},
},
},
},
{
name: "OrderedListItem",
pos: position{line: 530, col: 1, offset: 17886},
expr: &actionExpr{
pos: position{line: 530, col: 20, offset: 17905},
run: (*parser).callonOrderedListItem1,
expr: &seqExpr{
pos: position{line: 530, col: 20, offset: 17905},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 530, col: 20, offset: 17905},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 530, col: 31, offset: 17916},
expr: &ruleRefExpr{
pos: position{line: 530, col: 32, offset: 17917},
name: "ElementAttributes",
},
},
},
&labeledExpr{
pos: position{line: 530, col: 52, offset: 17937},
label: "prefix",
expr: &ruleRefExpr{
pos: position{line: 530, col: 60, offset: 17945},
name: "OrderedListItemPrefix",
},
},
&labeledExpr{
pos: position{line: 530, col: 83, offset: 17968},
label: "content",
expr: &ruleRefExpr{
pos: position{line: 530, col: 92, offset: 17977},
name: "OrderedListItemContent",
},
},
},
},
},
},
{
name: "OrderedListItemPrefix",
pos: position{line: 534, col: 1, offset: 18117},
expr: &actionExpr{
pos: position{line: 535, col: 5, offset: 18147},
run: (*parser).callonOrderedListItemPrefix1,
expr: &seqExpr{
pos: position{line: 535, col: 5, offset: 18147},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 535, col: 5, offset: 18147},
expr: &ruleRefExpr{
pos: position{line: 535, col: 5, offset: 18147},
name: "WS",
},
},
&labeledExpr{
pos: position{line: 535, col: 9, offset: 18151},
label: "prefix",
expr: &choiceExpr{
pos: position{line: 537, col: 9, offset: 18214},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 537, col: 9, offset: 18214},
run: (*parser).callonOrderedListItemPrefix7,
expr: &seqExpr{
pos: position{line: 537, col: 9, offset: 18214},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 537, col: 9, offset: 18214},
label: "depth",
expr: &actionExpr{
pos: position{line: 537, col: 16, offset: 18221},
run: (*parser).callonOrderedListItemPrefix10,
expr: &oneOrMoreExpr{
pos: position{line: 537, col: 16, offset: 18221},
expr: &litMatcher{
pos: position{line: 537, col: 17, offset: 18222},
val: ".",
ignoreCase: false,
},
},
},
},
&andCodeExpr{
pos: position{line: 541, col: 9, offset: 18322},
run: (*parser).callonOrderedListItemPrefix13,
},
},
},
},
&actionExpr{
pos: position{line: 560, col: 11, offset: 19039},
run: (*parser).callonOrderedListItemPrefix14,
expr: &seqExpr{
pos: position{line: 560, col: 11, offset: 19039},
exprs: []interface{}{
&oneOrMoreExpr{
pos: position{line: 560, col: 11, offset: 19039},
expr: &charClassMatcher{
pos: position{line: 560, col: 12, offset: 19040},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
&litMatcher{
pos: position{line: 560, col: 20, offset: 19048},
val: ".",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 562, col: 13, offset: 19159},
run: (*parser).callonOrderedListItemPrefix19,
expr: &seqExpr{
pos: position{line: 562, col: 13, offset: 19159},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 562, col: 14, offset: 19160},
val: "[a-z]",
ranges: []rune{'a', 'z'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 562, col: 21, offset: 19167},
val: ".",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 564, col: 13, offset: 19281},
run: (*parser).callonOrderedListItemPrefix23,
expr: &seqExpr{
pos: position{line: 564, col: 13, offset: 19281},
exprs: []interface{}{
&charClassMatcher{
pos: position{line: 564, col: 14, offset: 19282},
val: "[A-Z]",
ranges: []rune{'A', 'Z'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 564, col: 21, offset: 19289},
val: ".",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 566, col: 13, offset: 19403},
run: (*parser).callonOrderedListItemPrefix27,
expr: &seqExpr{
pos: position{line: 566, col: 13, offset: 19403},
exprs: []interface{}{
&oneOrMoreExpr{
pos: position{line: 566, col: 13, offset: 19403},
expr: &charClassMatcher{
pos: position{line: 566, col: 14, offset: 19404},
val: "[a-z]",
ranges: []rune{'a', 'z'},
ignoreCase: false,
inverted: false,
},
},
&litMatcher{
pos: position{line: 566, col: 22, offset: 19412},
val: ")",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 568, col: 13, offset: 19526},
run: (*parser).callonOrderedListItemPrefix32,
expr: &seqExpr{
pos: position{line: 568, col: 13, offset: 19526},
exprs: []interface{}{
&oneOrMoreExpr{
pos: position{line: 568, col: 13, offset: 19526},
expr: &charClassMatcher{
pos: position{line: 568, col: 14, offset: 19527},
val: "[A-Z]",
ranges: []rune{'A', 'Z'},
ignoreCase: false,
inverted: false,
},
},
&litMatcher{
pos: position{line: 568, col: 22, offset: 19535},
val: ")",
ignoreCase: false,
},
},
},
},
},
},
},
&oneOrMoreExpr{
pos: position{line: 570, col: 12, offset: 19648},
expr: &ruleRefExpr{
pos: position{line: 570, col: 12, offset: 19648},
name: "WS",
},
},
},
},
},
},
{
name: "OrderedListItemContent",
pos: position{line: 574, col: 1, offset: 19680},
expr: &actionExpr{
pos: position{line: 574, col: 27, offset: 19706},
run: (*parser).callonOrderedListItemContent1,
expr: &labeledExpr{
pos: position{line: 574, col: 27, offset: 19706},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 574, col: 37, offset: 19716},
expr: &ruleRefExpr{
pos: position{line: 574, col: 37, offset: 19716},
name: "ListParagraph",
},
},
},
},
},
{
name: "UnorderedListItem",
pos: position{line: 581, col: 1, offset: 19916},
expr: &actionExpr{
pos: position{line: 581, col: 22, offset: 19937},
run: (*parser).callonUnorderedListItem1,
expr: &seqExpr{
pos: position{line: 581, col: 22, offset: 19937},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 581, col: 22, offset: 19937},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 581, col: 33, offset: 19948},
expr: &ruleRefExpr{
pos: position{line: 581, col: 34, offset: 19949},
name: "ElementAttributes",
},
},
},
&labeledExpr{
pos: position{line: 581, col: 54, offset: 19969},
label: "prefix",
expr: &ruleRefExpr{
pos: position{line: 581, col: 62, offset: 19977},
name: "UnorderedListItemPrefix",
},
},
&labeledExpr{
pos: position{line: 581, col: 87, offset: 20002},
label: "checkstyle",
expr: &zeroOrOneExpr{
pos: position{line: 581, col: 98, offset: 20013},
expr: &ruleRefExpr{
pos: position{line: 581, col: 99, offset: 20014},
name: "UnorderedListItemCheckStyle",
},
},
},
&labeledExpr{
pos: position{line: 581, col: 129, offset: 20044},
label: "content",
expr: &ruleRefExpr{
pos: position{line: 581, col: 138, offset: 20053},
name: "UnorderedListItemContent",
},
},
},
},
},
},
{
name: "UnorderedListItemPrefix",
pos: position{line: 585, col: 1, offset: 20211},
expr: &actionExpr{
pos: position{line: 586, col: 5, offset: 20243},
run: (*parser).callonUnorderedListItemPrefix1,
expr: &seqExpr{
pos: position{line: 586, col: 5, offset: 20243},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 586, col: 5, offset: 20243},
expr: &ruleRefExpr{
pos: position{line: 586, col: 5, offset: 20243},
name: "WS",
},
},
&labeledExpr{
pos: position{line: 586, col: 9, offset: 20247},
label: "prefix",
expr: &choiceExpr{
pos: position{line: 586, col: 17, offset: 20255},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 588, col: 9, offset: 20312},
run: (*parser).callonUnorderedListItemPrefix7,
expr: &seqExpr{
pos: position{line: 588, col: 9, offset: 20312},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 588, col: 9, offset: 20312},
label: "depth",
expr: &actionExpr{
pos: position{line: 588, col: 16, offset: 20319},
run: (*parser).callonUnorderedListItemPrefix10,
expr: &oneOrMoreExpr{
pos: position{line: 588, col: 16, offset: 20319},
expr: &litMatcher{
pos: position{line: 588, col: 17, offset: 20320},
val: "*",
ignoreCase: false,
},
},
},
},
&andCodeExpr{
pos: position{line: 592, col: 9, offset: 20420},
run: (*parser).callonUnorderedListItemPrefix13,
},
},
},
},
&labeledExpr{
pos: position{line: 609, col: 14, offset: 21127},
label: "depth",
expr: &actionExpr{
pos: position{line: 609, col: 21, offset: 21134},
run: (*parser).callonUnorderedListItemPrefix15,
expr: &litMatcher{
pos: position{line: 609, col: 22, offset: 21135},
val: "-",
ignoreCase: false,
},
},
},
},
},
},
&oneOrMoreExpr{
pos: position{line: 611, col: 13, offset: 21221},
expr: &ruleRefExpr{
pos: position{line: 611, col: 13, offset: 21221},
name: "WS",
},
},
},
},
},
},
{
name: "UnorderedListItemCheckStyle",
pos: position{line: 615, col: 1, offset: 21254},
expr: &actionExpr{
pos: position{line: 615, col: 32, offset: 21285},
run: (*parser).callonUnorderedListItemCheckStyle1,
expr: &seqExpr{
pos: position{line: 615, col: 32, offset: 21285},
exprs: []interface{}{
&andExpr{
pos: position{line: 615, col: 32, offset: 21285},
expr: &litMatcher{
pos: position{line: 615, col: 33, offset: 21286},
val: "[",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 615, col: 37, offset: 21290},
label: "style",
expr: &choiceExpr{
pos: position{line: 616, col: 7, offset: 21304},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 616, col: 7, offset: 21304},
run: (*parser).callonUnorderedListItemCheckStyle7,
expr: &litMatcher{
pos: position{line: 616, col: 7, offset: 21304},
val: "[ ]",
ignoreCase: false,
},
},
&actionExpr{
pos: position{line: 617, col: 7, offset: 21349},
run: (*parser).callonUnorderedListItemCheckStyle9,
expr: &litMatcher{
pos: position{line: 617, col: 7, offset: 21349},
val: "[*]",
ignoreCase: false,
},
},
&actionExpr{
pos: position{line: 618, col: 7, offset: 21392},
run: (*parser).callonUnorderedListItemCheckStyle11,
expr: &litMatcher{
pos: position{line: 618, col: 7, offset: 21392},
val: "[x]",
ignoreCase: false,
},
},
},
},
},
&oneOrMoreExpr{
pos: position{line: 619, col: 7, offset: 21434},
expr: &ruleRefExpr{
pos: position{line: 619, col: 7, offset: 21434},
name: "WS",
},
},
},
},
},
},
{
name: "UnorderedListItemContent",
pos: position{line: 623, col: 1, offset: 21473},
expr: &actionExpr{
pos: position{line: 623, col: 29, offset: 21501},
run: (*parser).callonUnorderedListItemContent1,
expr: &labeledExpr{
pos: position{line: 623, col: 29, offset: 21501},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 623, col: 39, offset: 21511},
expr: &ruleRefExpr{
pos: position{line: 623, col: 39, offset: 21511},
name: "ListParagraph",
},
},
},
},
},
{
name: "LabeledListItem",
pos: position{line: 630, col: 1, offset: 21827},
expr: &actionExpr{
pos: position{line: 630, col: 20, offset: 21846},
run: (*parser).callonLabeledListItem1,
expr: &seqExpr{
pos: position{line: 630, col: 20, offset: 21846},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 630, col: 20, offset: 21846},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 630, col: 31, offset: 21857},
expr: &ruleRefExpr{
pos: position{line: 630, col: 32, offset: 21858},
name: "ElementAttributes",
},
},
},
&labeledExpr{
pos: position{line: 630, col: 52, offset: 21878},
label: "term",
expr: &ruleRefExpr{
pos: position{line: 630, col: 58, offset: 21884},
name: "SimpleLabeledListItemTerm",
},
},
&labeledExpr{
pos: position{line: 630, col: 85, offset: 21911},
label: "separator",
expr: &ruleRefExpr{
pos: position{line: 630, col: 96, offset: 21922},
name: "LabeledListItemSeparator",
},
},
&labeledExpr{
pos: position{line: 630, col: 122, offset: 21948},
label: "description",
expr: &zeroOrOneExpr{
pos: position{line: 630, col: 134, offset: 21960},
expr: &ruleRefExpr{
pos: position{line: 630, col: 135, offset: 21961},
name: "LabeledListItemDescription",
},
},
},
},
},
},
},
{
name: "SimpleLabeledListItemTerm",
pos: position{line: 634, col: 1, offset: 22107},
expr: &actionExpr{
pos: position{line: 634, col: 30, offset: 22136},
run: (*parser).callonSimpleLabeledListItemTerm1,
expr: &labeledExpr{
pos: position{line: 634, col: 30, offset: 22136},
label: "content",
expr: &actionExpr{
pos: position{line: 634, col: 39, offset: 22145},
run: (*parser).callonSimpleLabeledListItemTerm3,
expr: &oneOrMoreExpr{
pos: position{line: 634, col: 39, offset: 22145},
expr: &choiceExpr{
pos: position{line: 634, col: 40, offset: 22146},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 634, col: 40, offset: 22146},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 634, col: 52, offset: 22158},
name: "Spaces",
},
&seqExpr{
pos: position{line: 634, col: 62, offset: 22168},
exprs: []interface{}{
¬Expr{
pos: position{line: 634, col: 62, offset: 22168},
expr: &ruleRefExpr{
pos: position{line: 634, col: 63, offset: 22169},
name: "Newline",
},
},
¬Expr{
pos: position{line: 634, col: 71, offset: 22177},
expr: &ruleRefExpr{
pos: position{line: 634, col: 72, offset: 22178},
name: "LabeledListItemSeparator",
},
},
&anyMatcher{
line: 634, col: 97, offset: 22203,
},
},
},
},
},
},
},
},
},
},
{
name: "LabeledListItemTerm",
pos: position{line: 640, col: 1, offset: 22332},
expr: &actionExpr{
pos: position{line: 640, col: 24, offset: 22355},
run: (*parser).callonLabeledListItemTerm1,
expr: &labeledExpr{
pos: position{line: 640, col: 24, offset: 22355},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 640, col: 33, offset: 22364},
expr: &seqExpr{
pos: position{line: 640, col: 34, offset: 22365},
exprs: []interface{}{
¬Expr{
pos: position{line: 640, col: 34, offset: 22365},
expr: &ruleRefExpr{
pos: position{line: 640, col: 35, offset: 22366},
name: "Newline",
},
},
¬Expr{
pos: position{line: 640, col: 43, offset: 22374},
expr: &ruleRefExpr{
pos: position{line: 640, col: 44, offset: 22375},
name: "LabeledListItemSeparator",
},
},
&ruleRefExpr{
pos: position{line: 640, col: 69, offset: 22400},
name: "LabeledListItemTermElement",
},
},
},
},
},
},
},
{
name: "LabeledListItemTermElement",
pos: position{line: 644, col: 1, offset: 22535},
expr: &actionExpr{
pos: position{line: 644, col: 31, offset: 22565},
run: (*parser).callonLabeledListItemTermElement1,
expr: &labeledExpr{
pos: position{line: 644, col: 31, offset: 22565},
label: "element",
expr: &choiceExpr{
pos: position{line: 644, col: 40, offset: 22574},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 644, col: 40, offset: 22574},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 645, col: 11, offset: 22595},
name: "Spaces",
},
&ruleRefExpr{
pos: position{line: 646, col: 11, offset: 22613},
name: "CrossReference",
},
&ruleRefExpr{
pos: position{line: 647, col: 11, offset: 22638},
name: "ConcealedIndexTerm",
},
&ruleRefExpr{
pos: position{line: 648, col: 11, offset: 22667},
name: "IndexTerm",
},
&ruleRefExpr{
pos: position{line: 649, col: 11, offset: 22687},
name: "Passthrough",
},
&ruleRefExpr{
pos: position{line: 650, col: 11, offset: 22709},
name: "InlineImage",
},
&ruleRefExpr{
pos: position{line: 651, col: 11, offset: 22732},
name: "Link",
},
&ruleRefExpr{
pos: position{line: 652, col: 11, offset: 22747},
name: "InlineFootnote",
},
&ruleRefExpr{
pos: position{line: 653, col: 11, offset: 22772},
name: "QuotedText",
},
&ruleRefExpr{
pos: position{line: 654, col: 11, offset: 22793},
name: "DocumentAttributeSubstitution",
},
&ruleRefExpr{
pos: position{line: 655, col: 11, offset: 22833},
name: "LineBreak",
},
&ruleRefExpr{
pos: position{line: 656, col: 11, offset: 22853},
name: "Parenthesis",
},
&ruleRefExpr{
pos: position{line: 657, col: 11, offset: 22875},
name: "AnyChars",
},
&ruleRefExpr{
pos: position{line: 658, col: 11, offset: 22894},
name: "AnyChar",
},
},
},
},
},
},
{
name: "LabeledListItemSeparator",
pos: position{line: 662, col: 1, offset: 22933},
expr: &actionExpr{
pos: position{line: 663, col: 5, offset: 22966},
run: (*parser).callonLabeledListItemSeparator1,
expr: &seqExpr{
pos: position{line: 663, col: 5, offset: 22966},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 663, col: 5, offset: 22966},
label: "separator",
expr: &actionExpr{
pos: position{line: 663, col: 16, offset: 22977},
run: (*parser).callonLabeledListItemSeparator4,
expr: &oneOrMoreExpr{
pos: position{line: 663, col: 16, offset: 22977},
expr: &litMatcher{
pos: position{line: 663, col: 17, offset: 22978},
val: ":",
ignoreCase: false,
},
},
},
},
&andCodeExpr{
pos: position{line: 666, col: 5, offset: 23036},
run: (*parser).callonLabeledListItemSeparator7,
},
&choiceExpr{
pos: position{line: 670, col: 6, offset: 23212},
alternatives: []interface{}{
&oneOrMoreExpr{
pos: position{line: 670, col: 6, offset: 23212},
expr: &choiceExpr{
pos: position{line: 670, col: 7, offset: 23213},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 670, col: 7, offset: 23213},
name: "WS",
},
&ruleRefExpr{
pos: position{line: 670, col: 12, offset: 23218},
name: "Newline",
},
},
},
},
&ruleRefExpr{
pos: position{line: 670, col: 24, offset: 23230},
name: "EOL",
},
},
},
},
},
},
},
{
name: "LabeledListItemDescription",
pos: position{line: 674, col: 1, offset: 23270},
expr: &actionExpr{
pos: position{line: 674, col: 31, offset: 23300},
run: (*parser).callonLabeledListItemDescription1,
expr: &labeledExpr{
pos: position{line: 674, col: 31, offset: 23300},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 674, col: 40, offset: 23309},
expr: &ruleRefExpr{
pos: position{line: 674, col: 41, offset: 23310},
name: "ListParagraph",
},
},
},
},
},
{
name: "AdmonitionKind",
pos: position{line: 681, col: 1, offset: 23501},
expr: &choiceExpr{
pos: position{line: 681, col: 19, offset: 23519},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 681, col: 19, offset: 23519},
run: (*parser).callonAdmonitionKind2,
expr: &litMatcher{
pos: position{line: 681, col: 19, offset: 23519},
val: "TIP",
ignoreCase: false,
},
},
&actionExpr{
pos: position{line: 683, col: 9, offset: 23565},
run: (*parser).callonAdmonitionKind4,
expr: &litMatcher{
pos: position{line: 683, col: 9, offset: 23565},
val: "NOTE",
ignoreCase: false,
},
},
&actionExpr{
pos: position{line: 685, col: 9, offset: 23613},
run: (*parser).callonAdmonitionKind6,
expr: &litMatcher{
pos: position{line: 685, col: 9, offset: 23613},
val: "IMPORTANT",
ignoreCase: false,
},
},
&actionExpr{
pos: position{line: 687, col: 9, offset: 23671},
run: (*parser).callonAdmonitionKind8,
expr: &litMatcher{
pos: position{line: 687, col: 9, offset: 23671},
val: "WARNING",
ignoreCase: false,
},
},
&actionExpr{
pos: position{line: 689, col: 9, offset: 23725},
run: (*parser).callonAdmonitionKind10,
expr: &litMatcher{
pos: position{line: 689, col: 9, offset: 23725},
val: "CAUTION",
ignoreCase: false,
},
},
},
},
},
{
name: "Paragraph",
pos: position{line: 698, col: 1, offset: 24032},
expr: &choiceExpr{
pos: position{line: 700, col: 5, offset: 24079},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 700, col: 5, offset: 24079},
run: (*parser).callonParagraph2,
expr: &seqExpr{
pos: position{line: 700, col: 5, offset: 24079},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 700, col: 5, offset: 24079},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 700, col: 16, offset: 24090},
expr: &ruleRefExpr{
pos: position{line: 700, col: 17, offset: 24091},
name: "ElementAttributes",
},
},
},
&labeledExpr{
pos: position{line: 700, col: 37, offset: 24111},
label: "t",
expr: &ruleRefExpr{
pos: position{line: 700, col: 40, offset: 24114},
name: "AdmonitionKind",
},
},
&litMatcher{
pos: position{line: 700, col: 56, offset: 24130},
val: ": ",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 700, col: 61, offset: 24135},
label: "lines",
expr: &oneOrMoreExpr{
pos: position{line: 700, col: 67, offset: 24141},
expr: &ruleRefExpr{
pos: position{line: 700, col: 68, offset: 24142},
name: "InlineElements",
},
},
},
},
},
},
&actionExpr{
pos: position{line: 704, col: 5, offset: 24334},
run: (*parser).callonParagraph13,
expr: &seqExpr{
pos: position{line: 704, col: 5, offset: 24334},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 704, col: 5, offset: 24334},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 704, col: 16, offset: 24345},
expr: &ruleRefExpr{
pos: position{line: 704, col: 17, offset: 24346},
name: "ElementAttributes",
},
},
},
&labeledExpr{
pos: position{line: 704, col: 37, offset: 24366},
label: "lines",
expr: &oneOrMoreExpr{
pos: position{line: 704, col: 43, offset: 24372},
expr: &ruleRefExpr{
pos: position{line: 704, col: 44, offset: 24373},
name: "InlineElements",
},
},
},
},
},
},
},
},
},
{
name: "SimpleParagraph",
pos: position{line: 709, col: 1, offset: 24538},
expr: &actionExpr{
pos: position{line: 709, col: 20, offset: 24557},
run: (*parser).callonSimpleParagraph1,
expr: &seqExpr{
pos: position{line: 709, col: 20, offset: 24557},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 709, col: 20, offset: 24557},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 709, col: 31, offset: 24568},
expr: &ruleRefExpr{
pos: position{line: 709, col: 32, offset: 24569},
name: "ElementAttributes",
},
},
},
&andCodeExpr{
pos: position{line: 710, col: 5, offset: 24594},
run: (*parser).callonSimpleParagraph6,
},
&labeledExpr{
pos: position{line: 718, col: 5, offset: 24885},
label: "firstLine",
expr: &ruleRefExpr{
pos: position{line: 718, col: 16, offset: 24896},
name: "FirstParagraphLine",
},
},
&labeledExpr{
pos: position{line: 719, col: 5, offset: 24919},
label: "otherLines",
expr: &zeroOrMoreExpr{
pos: position{line: 719, col: 16, offset: 24930},
expr: &ruleRefExpr{
pos: position{line: 719, col: 17, offset: 24931},
name: "OtherParagraphLine",
},
},
},
},
},
},
},
{
name: "ContinuedParagraph",
pos: position{line: 724, col: 1, offset: 25139},
expr: &choiceExpr{
pos: position{line: 726, col: 5, offset: 25195},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 726, col: 5, offset: 25195},
run: (*parser).callonContinuedParagraph2,
expr: &seqExpr{
pos: position{line: 726, col: 5, offset: 25195},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 726, col: 5, offset: 25195},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 726, col: 16, offset: 25206},
expr: &ruleRefExpr{
pos: position{line: 726, col: 17, offset: 25207},
name: "ElementAttributes",
},
},
},
&labeledExpr{
pos: position{line: 726, col: 37, offset: 25227},
label: "t",
expr: &ruleRefExpr{
pos: position{line: 726, col: 40, offset: 25230},
name: "AdmonitionKind",
},
},
&litMatcher{
pos: position{line: 726, col: 56, offset: 25246},
val: ": ",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 726, col: 61, offset: 25251},
label: "lines",
expr: &ruleRefExpr{
pos: position{line: 726, col: 68, offset: 25258},
name: "ContinuedParagraphLines",
},
},
},
},
},
&actionExpr{
pos: position{line: 730, col: 5, offset: 25458},
run: (*parser).callonContinuedParagraph12,
expr: &seqExpr{
pos: position{line: 730, col: 5, offset: 25458},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 730, col: 5, offset: 25458},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 730, col: 16, offset: 25469},
expr: &ruleRefExpr{
pos: position{line: 730, col: 17, offset: 25470},
name: "ElementAttributes",
},
},
},
&labeledExpr{
pos: position{line: 730, col: 37, offset: 25490},
label: "lines",
expr: &ruleRefExpr{
pos: position{line: 730, col: 44, offset: 25497},
name: "ContinuedParagraphLines",
},
},
},
},
},
},
},
},
{
name: "ContinuedParagraphLines",
pos: position{line: 734, col: 1, offset: 25598},
expr: &actionExpr{
pos: position{line: 734, col: 28, offset: 25625},
run: (*parser).callonContinuedParagraphLines1,
expr: &seqExpr{
pos: position{line: 734, col: 28, offset: 25625},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 734, col: 28, offset: 25625},
label: "firstLine",
expr: &ruleRefExpr{
pos: position{line: 734, col: 39, offset: 25636},
name: "FirstParagraphLine",
},
},
&labeledExpr{
pos: position{line: 734, col: 59, offset: 25656},
label: "otherLines",
expr: &zeroOrMoreExpr{
pos: position{line: 734, col: 70, offset: 25667},
expr: &seqExpr{
pos: position{line: 734, col: 71, offset: 25668},
exprs: []interface{}{
¬Expr{
pos: position{line: 734, col: 71, offset: 25668},
expr: &ruleRefExpr{
pos: position{line: 734, col: 72, offset: 25669},
name: "ListItemContinuation",
},
},
&ruleRefExpr{
pos: position{line: 734, col: 93, offset: 25690},
name: "OtherParagraphLine",
},
},
},
},
},
},
},
},
},
{
name: "FirstParagraphLine",
pos: position{line: 738, col: 1, offset: 25796},
expr: &actionExpr{
pos: position{line: 738, col: 23, offset: 25818},
run: (*parser).callonFirstParagraphLine1,
expr: &seqExpr{
pos: position{line: 738, col: 23, offset: 25818},
exprs: []interface{}{
¬Expr{
pos: position{line: 738, col: 23, offset: 25818},
expr: &seqExpr{
pos: position{line: 738, col: 25, offset: 25820},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 738, col: 25, offset: 25820},
name: "SimpleLabeledListItemTerm",
},
&ruleRefExpr{
pos: position{line: 738, col: 51, offset: 25846},
name: "LabeledListItemSeparator",
},
},
},
},
&labeledExpr{
pos: position{line: 739, col: 5, offset: 25876},
label: "elements",
expr: &seqExpr{
pos: position{line: 739, col: 15, offset: 25886},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 739, col: 15, offset: 25886},
name: "SimpleWord",
},
&zeroOrMoreExpr{
pos: position{line: 739, col: 26, offset: 25897},
expr: &ruleRefExpr{
pos: position{line: 739, col: 26, offset: 25897},
name: "InlineElement",
},
},
},
},
},
&labeledExpr{
pos: position{line: 739, col: 42, offset: 25913},
label: "linebreak",
expr: &zeroOrOneExpr{
pos: position{line: 739, col: 52, offset: 25923},
expr: &ruleRefExpr{
pos: position{line: 739, col: 53, offset: 25924},
name: "LineBreak",
},
},
},
&ruleRefExpr{
pos: position{line: 739, col: 65, offset: 25936},
name: "EOL",
},
},
},
},
},
{
name: "OtherParagraphLine",
pos: position{line: 743, col: 1, offset: 26026},
expr: &actionExpr{
pos: position{line: 743, col: 23, offset: 26048},
run: (*parser).callonOtherParagraphLine1,
expr: &labeledExpr{
pos: position{line: 743, col: 23, offset: 26048},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 743, col: 33, offset: 26058},
name: "InlineElements",
},
},
},
},
{
name: "VerseParagraph",
pos: position{line: 747, col: 1, offset: 26104},
expr: &choiceExpr{
pos: position{line: 749, col: 5, offset: 26156},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 749, col: 5, offset: 26156},
run: (*parser).callonVerseParagraph2,
expr: &seqExpr{
pos: position{line: 749, col: 5, offset: 26156},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 749, col: 5, offset: 26156},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 749, col: 16, offset: 26167},
expr: &ruleRefExpr{
pos: position{line: 749, col: 17, offset: 26168},
name: "ElementAttributes",
},
},
},
&andCodeExpr{
pos: position{line: 750, col: 5, offset: 26192},
run: (*parser).callonVerseParagraph7,
},
&labeledExpr{
pos: position{line: 757, col: 5, offset: 26404},
label: "t",
expr: &ruleRefExpr{
pos: position{line: 757, col: 8, offset: 26407},
name: "AdmonitionKind",
},
},
&litMatcher{
pos: position{line: 757, col: 24, offset: 26423},
val: ": ",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 757, col: 29, offset: 26428},
label: "lines",
expr: &oneOrMoreExpr{
pos: position{line: 757, col: 35, offset: 26434},
expr: &ruleRefExpr{
pos: position{line: 757, col: 36, offset: 26435},
name: "InlineElements",
},
},
},
},
},
},
&actionExpr{
pos: position{line: 761, col: 5, offset: 26627},
run: (*parser).callonVerseParagraph14,
expr: &seqExpr{
pos: position{line: 761, col: 5, offset: 26627},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 761, col: 5, offset: 26627},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 761, col: 16, offset: 26638},
expr: &ruleRefExpr{
pos: position{line: 761, col: 17, offset: 26639},
name: "ElementAttributes",
},
},
},
&andCodeExpr{
pos: position{line: 762, col: 5, offset: 26663},
run: (*parser).callonVerseParagraph19,
},
&labeledExpr{
pos: position{line: 769, col: 5, offset: 26875},
label: "lines",
expr: &oneOrMoreExpr{
pos: position{line: 769, col: 11, offset: 26881},
expr: &ruleRefExpr{
pos: position{line: 769, col: 12, offset: 26882},
name: "InlineElements",
},
},
},
},
},
},
},
},
},
{
name: "InlineElements",
pos: position{line: 773, col: 1, offset: 26983},
expr: &actionExpr{
pos: position{line: 773, col: 19, offset: 27001},
run: (*parser).callonInlineElements1,
expr: &seqExpr{
pos: position{line: 773, col: 19, offset: 27001},
exprs: []interface{}{
¬Expr{
pos: position{line: 773, col: 19, offset: 27001},
expr: &ruleRefExpr{
pos: position{line: 773, col: 20, offset: 27002},
name: "EOF",
},
},
¬Expr{
pos: position{line: 773, col: 24, offset: 27006},
expr: &ruleRefExpr{
pos: position{line: 773, col: 25, offset: 27007},
name: "BlankLine",
},
},
&labeledExpr{
pos: position{line: 774, col: 5, offset: 27021},
label: "elements",
expr: &choiceExpr{
pos: position{line: 774, col: 15, offset: 27031},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 774, col: 15, offset: 27031},
run: (*parser).callonInlineElements9,
expr: &labeledExpr{
pos: position{line: 774, col: 15, offset: 27031},
label: "comment",
expr: &ruleRefExpr{
pos: position{line: 774, col: 24, offset: 27040},
name: "SingleLineComment",
},
},
},
&actionExpr{
pos: position{line: 776, col: 9, offset: 27132},
run: (*parser).callonInlineElements12,
expr: &seqExpr{
pos: position{line: 776, col: 9, offset: 27132},
exprs: []interface{}{
¬Expr{
pos: position{line: 776, col: 9, offset: 27132},
expr: &ruleRefExpr{
pos: position{line: 776, col: 10, offset: 27133},
name: "BlockDelimiter",
},
},
&labeledExpr{
pos: position{line: 776, col: 25, offset: 27148},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 776, col: 34, offset: 27157},
expr: &ruleRefExpr{
pos: position{line: 776, col: 35, offset: 27158},
name: "InlineElement",
},
},
},
&labeledExpr{
pos: position{line: 776, col: 51, offset: 27174},
label: "linebreak",
expr: &zeroOrOneExpr{
pos: position{line: 776, col: 61, offset: 27184},
expr: &ruleRefExpr{
pos: position{line: 776, col: 62, offset: 27185},
name: "LineBreak",
},
},
},
&ruleRefExpr{
pos: position{line: 776, col: 74, offset: 27197},
name: "EOL",
},
},
},
},
},
},
},
},
},
},
},
{
name: "InlineElement",
pos: position{line: 782, col: 1, offset: 27333},
expr: &actionExpr{
pos: position{line: 782, col: 18, offset: 27350},
run: (*parser).callonInlineElement1,
expr: &seqExpr{
pos: position{line: 782, col: 18, offset: 27350},
exprs: []interface{}{
¬Expr{
pos: position{line: 782, col: 18, offset: 27350},
expr: &ruleRefExpr{
pos: position{line: 782, col: 19, offset: 27351},
name: "EOL",
},
},
¬Expr{
pos: position{line: 782, col: 23, offset: 27355},
expr: &ruleRefExpr{
pos: position{line: 782, col: 24, offset: 27356},
name: "LineBreak",
},
},
&labeledExpr{
pos: position{line: 783, col: 5, offset: 27371},
label: "element",
expr: &choiceExpr{
pos: position{line: 783, col: 14, offset: 27380},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 783, col: 14, offset: 27380},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 784, col: 11, offset: 27401},
name: "QuotedText",
},
&ruleRefExpr{
pos: position{line: 785, col: 11, offset: 27423},
name: "Spaces",
},
&ruleRefExpr{
pos: position{line: 786, col: 11, offset: 27441},
name: "InlineImage",
},
&ruleRefExpr{
pos: position{line: 787, col: 11, offset: 27464},
name: "Link",
},
&ruleRefExpr{
pos: position{line: 788, col: 11, offset: 27480},
name: "Passthrough",
},
&ruleRefExpr{
pos: position{line: 789, col: 11, offset: 27503},
name: "InlineFootnote",
},
&ruleRefExpr{
pos: position{line: 790, col: 11, offset: 27529},
name: "CrossReference",
},
&ruleRefExpr{
pos: position{line: 791, col: 11, offset: 27555},
name: "InlineUserMacro",
},
&ruleRefExpr{
pos: position{line: 792, col: 11, offset: 27582},
name: "DocumentAttributeSubstitution",
},
&ruleRefExpr{
pos: position{line: 793, col: 11, offset: 27623},
name: "InlineElementID",
},
&ruleRefExpr{
pos: position{line: 794, col: 11, offset: 27650},
name: "ConcealedIndexTerm",
},
&ruleRefExpr{
pos: position{line: 795, col: 11, offset: 27679},
name: "IndexTerm",
},
&ruleRefExpr{
pos: position{line: 796, col: 11, offset: 27699},
name: "Parenthesis",
},
&ruleRefExpr{
pos: position{line: 797, col: 11, offset: 27721},
name: "AnyChars",
},
&ruleRefExpr{
pos: position{line: 798, col: 11, offset: 27740},
name: "AnyChar",
},
},
},
},
},
},
},
},
{
name: "InlineElementsWithoutSubtitution",
pos: position{line: 806, col: 1, offset: 28000},
expr: &actionExpr{
pos: position{line: 806, col: 37, offset: 28036},
run: (*parser).callonInlineElementsWithoutSubtitution1,
expr: &seqExpr{
pos: position{line: 806, col: 37, offset: 28036},
exprs: []interface{}{
¬Expr{
pos: position{line: 806, col: 37, offset: 28036},
expr: &ruleRefExpr{
pos: position{line: 806, col: 38, offset: 28037},
name: "BlankLine",
},
},
¬Expr{
pos: position{line: 806, col: 48, offset: 28047},
expr: &ruleRefExpr{
pos: position{line: 806, col: 49, offset: 28048},
name: "BlockDelimiter",
},
},
&labeledExpr{
pos: position{line: 806, col: 64, offset: 28063},
label: "elements",
expr: &zeroOrMoreExpr{
pos: position{line: 806, col: 73, offset: 28072},
expr: &ruleRefExpr{
pos: position{line: 806, col: 74, offset: 28073},
name: "InlineElementWithoutSubtitution",
},
},
},
&labeledExpr{
pos: position{line: 806, col: 108, offset: 28107},
label: "linebreak",
expr: &zeroOrOneExpr{
pos: position{line: 806, col: 118, offset: 28117},
expr: &ruleRefExpr{
pos: position{line: 806, col: 119, offset: 28118},
name: "LineBreak",
},
},
},
&ruleRefExpr{
pos: position{line: 806, col: 131, offset: 28130},
name: "EOL",
},
},
},
},
},
{
name: "InlineElementWithoutSubtitution",
pos: position{line: 810, col: 1, offset: 28221},
expr: &actionExpr{
pos: position{line: 810, col: 36, offset: 28256},
run: (*parser).callonInlineElementWithoutSubtitution1,
expr: &seqExpr{
pos: position{line: 810, col: 36, offset: 28256},
exprs: []interface{}{
¬Expr{
pos: position{line: 810, col: 36, offset: 28256},
expr: &ruleRefExpr{
pos: position{line: 810, col: 37, offset: 28257},
name: "EOL",
},
},
¬Expr{
pos: position{line: 810, col: 41, offset: 28261},
expr: &ruleRefExpr{
pos: position{line: 810, col: 42, offset: 28262},
name: "LineBreak",
},
},
&labeledExpr{
pos: position{line: 811, col: 5, offset: 28277},
label: "element",
expr: &choiceExpr{
pos: position{line: 811, col: 14, offset: 28286},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 811, col: 14, offset: 28286},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 812, col: 11, offset: 28307},
name: "QuotedText",
},
&ruleRefExpr{
pos: position{line: 813, col: 11, offset: 28329},
name: "Spaces",
},
&ruleRefExpr{
pos: position{line: 814, col: 11, offset: 28347},
name: "InlineImage",
},
&ruleRefExpr{
pos: position{line: 815, col: 11, offset: 28370},
name: "Link",
},
&ruleRefExpr{
pos: position{line: 816, col: 11, offset: 28386},
name: "Passthrough",
},
&ruleRefExpr{
pos: position{line: 817, col: 11, offset: 28409},
name: "CrossReference",
},
&ruleRefExpr{
pos: position{line: 818, col: 11, offset: 28435},
name: "InlineElementID",
},
&ruleRefExpr{
pos: position{line: 819, col: 11, offset: 28461},
name: "Parenthesis",
},
&ruleRefExpr{
pos: position{line: 820, col: 11, offset: 28483},
name: "AnyChars",
},
&ruleRefExpr{
pos: position{line: 821, col: 11, offset: 28502},
name: "AnyChar",
},
},
},
},
},
},
},
},
{
name: "VerbatimParagraph",
pos: position{line: 825, col: 1, offset: 28541},
expr: &actionExpr{
pos: position{line: 825, col: 22, offset: 28562},
run: (*parser).callonVerbatimParagraph1,
expr: &seqExpr{
pos: position{line: 825, col: 22, offset: 28562},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 825, col: 22, offset: 28562},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 825, col: 33, offset: 28573},
expr: &ruleRefExpr{
pos: position{line: 825, col: 34, offset: 28574},
name: "ElementAttributes",
},
},
},
&labeledExpr{
pos: position{line: 825, col: 54, offset: 28594},
label: "lines",
expr: &oneOrMoreExpr{
pos: position{line: 825, col: 60, offset: 28600},
expr: &actionExpr{
pos: position{line: 825, col: 61, offset: 28601},
run: (*parser).callonVerbatimParagraph8,
expr: &seqExpr{
pos: position{line: 825, col: 61, offset: 28601},
exprs: []interface{}{
¬Expr{
pos: position{line: 825, col: 61, offset: 28601},
expr: &ruleRefExpr{
pos: position{line: 825, col: 62, offset: 28602},
name: "EOF",
},
},
&labeledExpr{
pos: position{line: 825, col: 66, offset: 28606},
label: "line",
expr: &ruleRefExpr{
pos: position{line: 825, col: 72, offset: 28612},
name: "VerbatimParagraphLine",
},
},
},
},
},
},
},
},
},
},
},
{
name: "VerbatimParagraphLine",
pos: position{line: 831, col: 1, offset: 28732},
expr: &actionExpr{
pos: position{line: 831, col: 26, offset: 28757},
run: (*parser).callonVerbatimParagraphLine1,
expr: &seqExpr{
pos: position{line: 831, col: 26, offset: 28757},
exprs: []interface{}{
¬Expr{
pos: position{line: 831, col: 26, offset: 28757},
expr: &ruleRefExpr{
pos: position{line: 831, col: 27, offset: 28758},
name: "BlockDelimiter",
},
},
¬Expr{
pos: position{line: 831, col: 42, offset: 28773},
expr: &ruleRefExpr{
pos: position{line: 831, col: 43, offset: 28774},
name: "BlankLine",
},
},
&labeledExpr{
pos: position{line: 831, col: 53, offset: 28784},
label: "elements",
expr: &zeroOrMoreExpr{
pos: position{line: 831, col: 62, offset: 28793},
expr: &ruleRefExpr{
pos: position{line: 831, col: 63, offset: 28794},
name: "VerbatimParagraphLineElement",
},
},
},
&labeledExpr{
pos: position{line: 831, col: 94, offset: 28825},
label: "linebreak",
expr: &zeroOrOneExpr{
pos: position{line: 831, col: 104, offset: 28835},
expr: &ruleRefExpr{
pos: position{line: 831, col: 105, offset: 28836},
name: "LineBreak",
},
},
},
&ruleRefExpr{
pos: position{line: 831, col: 117, offset: 28848},
name: "EOL",
},
},
},
},
},
{
name: "VerbatimParagraphLineElement",
pos: position{line: 835, col: 1, offset: 28939},
expr: &actionExpr{
pos: position{line: 835, col: 33, offset: 28971},
run: (*parser).callonVerbatimParagraphLineElement1,
expr: &oneOrMoreExpr{
pos: position{line: 835, col: 33, offset: 28971},
expr: &seqExpr{
pos: position{line: 835, col: 34, offset: 28972},
exprs: []interface{}{
¬Expr{
pos: position{line: 835, col: 34, offset: 28972},
expr: &ruleRefExpr{
pos: position{line: 835, col: 35, offset: 28973},
name: "EOL",
},
},
¬Expr{
pos: position{line: 835, col: 39, offset: 28977},
expr: &ruleRefExpr{
pos: position{line: 835, col: 40, offset: 28978},
name: "LineBreak",
},
},
&anyMatcher{
line: 835, col: 50, offset: 28988,
},
},
},
},
},
},
{
name: "LineBreak",
pos: position{line: 842, col: 1, offset: 29212},
expr: &actionExpr{
pos: position{line: 842, col: 14, offset: 29225},
run: (*parser).callonLineBreak1,
expr: &seqExpr{
pos: position{line: 842, col: 14, offset: 29225},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 842, col: 14, offset: 29225},
name: "WS",
},
&litMatcher{
pos: position{line: 842, col: 17, offset: 29228},
val: "+",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 842, col: 21, offset: 29232},
expr: &ruleRefExpr{
pos: position{line: 842, col: 21, offset: 29232},
name: "WS",
},
},
&andExpr{
pos: position{line: 842, col: 25, offset: 29236},
expr: &ruleRefExpr{
pos: position{line: 842, col: 26, offset: 29237},
name: "EOL",
},
},
},
},
},
},
{
name: "QuotedText",
pos: position{line: 849, col: 1, offset: 29521},
expr: &choiceExpr{
pos: position{line: 849, col: 15, offset: 29535},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 849, col: 15, offset: 29535},
name: "UnconstrainedQuotedText",
},
&ruleRefExpr{
pos: position{line: 849, col: 41, offset: 29561},
name: "ConstrainedQuotedText",
},
&ruleRefExpr{
pos: position{line: 849, col: 65, offset: 29585},
name: "EscapedQuotedText",
},
},
},
},
{
name: "ConstrainedQuotedTextMarker",
pos: position{line: 851, col: 1, offset: 29604},
expr: &choiceExpr{
pos: position{line: 851, col: 32, offset: 29635},
alternatives: []interface{}{
&seqExpr{
pos: position{line: 851, col: 32, offset: 29635},
exprs: []interface{}{
&litMatcher{
pos: position{line: 851, col: 32, offset: 29635},
val: "*",
ignoreCase: false,
},
¬Expr{
pos: position{line: 851, col: 36, offset: 29639},
expr: &litMatcher{
pos: position{line: 851, col: 37, offset: 29640},
val: "*",
ignoreCase: false,
},
},
},
},
&seqExpr{
pos: position{line: 851, col: 43, offset: 29646},
exprs: []interface{}{
&litMatcher{
pos: position{line: 851, col: 43, offset: 29646},
val: "_",
ignoreCase: false,
},
¬Expr{
pos: position{line: 851, col: 47, offset: 29650},
expr: &litMatcher{
pos: position{line: 851, col: 48, offset: 29651},
val: "_",
ignoreCase: false,
},
},
},
},
&seqExpr{
pos: position{line: 851, col: 54, offset: 29657},
exprs: []interface{}{
&litMatcher{
pos: position{line: 851, col: 54, offset: 29657},
val: "`",
ignoreCase: false,
},
¬Expr{
pos: position{line: 851, col: 58, offset: 29661},
expr: &litMatcher{
pos: position{line: 851, col: 59, offset: 29662},
val: "`",
ignoreCase: false,
},
},
},
},
},
},
},
{
name: "UnconstrainedQuotedTextPrefix",
pos: position{line: 853, col: 1, offset: 29668},
expr: &choiceExpr{
pos: position{line: 853, col: 34, offset: 29701},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 853, col: 34, offset: 29701},
val: "**",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 853, col: 41, offset: 29708},
val: "__",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 853, col: 48, offset: 29715},
val: "``",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 853, col: 55, offset: 29722},
val: "^",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 853, col: 61, offset: 29728},
val: "~",
ignoreCase: false,
},
},
},
},
{
name: "ConstrainedQuotedText",
pos: position{line: 855, col: 1, offset: 29733},
expr: &actionExpr{
pos: position{line: 855, col: 26, offset: 29758},
run: (*parser).callonConstrainedQuotedText1,
expr: &seqExpr{
pos: position{line: 855, col: 26, offset: 29758},
exprs: []interface{}{
¬Expr{
pos: position{line: 855, col: 26, offset: 29758},
expr: &ruleRefExpr{
pos: position{line: 855, col: 27, offset: 29759},
name: "WS",
},
},
&labeledExpr{
pos: position{line: 855, col: 30, offset: 29762},
label: "text",
expr: &choiceExpr{
pos: position{line: 855, col: 36, offset: 29768},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 855, col: 36, offset: 29768},
name: "SingleQuoteBoldText",
},
&ruleRefExpr{
pos: position{line: 856, col: 15, offset: 29803},
name: "SingleQuoteItalicText",
},
&ruleRefExpr{
pos: position{line: 857, col: 15, offset: 29840},
name: "SingleQuoteMonospaceText",
},
&ruleRefExpr{
pos: position{line: 858, col: 15, offset: 29880},
name: "SubscriptText",
},
&ruleRefExpr{
pos: position{line: 859, col: 15, offset: 29909},
name: "SuperscriptText",
},
&ruleRefExpr{
pos: position{line: 860, col: 15, offset: 29940},
name: "SubscriptOrSuperscriptPrefix",
},
},
},
},
},
},
},
},
{
name: "UnconstrainedQuotedText",
pos: position{line: 864, col: 1, offset: 30094},
expr: &choiceExpr{
pos: position{line: 864, col: 28, offset: 30121},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 864, col: 28, offset: 30121},
name: "DoubleQuoteBoldText",
},
&ruleRefExpr{
pos: position{line: 865, col: 15, offset: 30155},
name: "DoubleQuoteItalicText",
},
&ruleRefExpr{
pos: position{line: 866, col: 15, offset: 30191},
name: "DoubleQuoteMonospaceText",
},
},
},
},
{
name: "EscapedQuotedText",
pos: position{line: 868, col: 1, offset: 30217},
expr: &choiceExpr{
pos: position{line: 868, col: 22, offset: 30238},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 868, col: 22, offset: 30238},
name: "EscapedBoldText",
},
&ruleRefExpr{
pos: position{line: 869, col: 15, offset: 30269},
name: "EscapedItalicText",
},
&ruleRefExpr{
pos: position{line: 870, col: 15, offset: 30302},
name: "EscapedMonospaceText",
},
&ruleRefExpr{
pos: position{line: 871, col: 15, offset: 30338},
name: "EscapedSubscriptText",
},
&ruleRefExpr{
pos: position{line: 872, col: 15, offset: 30374},
name: "EscapedSuperscriptText",
},
},
},
},
{
name: "SubscriptOrSuperscriptPrefix",
pos: position{line: 874, col: 1, offset: 30398},
expr: &choiceExpr{
pos: position{line: 874, col: 33, offset: 30430},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 874, col: 33, offset: 30430},
val: "^",
ignoreCase: false,
},
&actionExpr{
pos: position{line: 874, col: 39, offset: 30436},
run: (*parser).callonSubscriptOrSuperscriptPrefix3,
expr: &litMatcher{
pos: position{line: 874, col: 39, offset: 30436},
val: "~",
ignoreCase: false,
},
},
},
},
},
{
name: "OneOrMoreBackslashes",
pos: position{line: 878, col: 1, offset: 30569},
expr: &actionExpr{
pos: position{line: 878, col: 25, offset: 30593},
run: (*parser).callonOneOrMoreBackslashes1,
expr: &oneOrMoreExpr{
pos: position{line: 878, col: 25, offset: 30593},
expr: &litMatcher{
pos: position{line: 878, col: 25, offset: 30593},
val: "\\",
ignoreCase: false,
},
},
},
},
{
name: "TwoOrMoreBackslashes",
pos: position{line: 882, col: 1, offset: 30634},
expr: &actionExpr{
pos: position{line: 882, col: 25, offset: 30658},
run: (*parser).callonTwoOrMoreBackslashes1,
expr: &seqExpr{
pos: position{line: 882, col: 25, offset: 30658},
exprs: []interface{}{
&litMatcher{
pos: position{line: 882, col: 25, offset: 30658},
val: "\\\\",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 882, col: 30, offset: 30663},
expr: &litMatcher{
pos: position{line: 882, col: 30, offset: 30663},
val: "\\",
ignoreCase: false,
},
},
},
},
},
},
{
name: "BoldText",
pos: position{line: 890, col: 1, offset: 30760},
expr: &choiceExpr{
pos: position{line: 890, col: 13, offset: 30772},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 890, col: 13, offset: 30772},
name: "DoubleQuoteBoldText",
},
&ruleRefExpr{
pos: position{line: 890, col: 35, offset: 30794},
name: "SingleQuoteBoldText",
},
},
},
},
{
name: "DoubleQuoteBoldText",
pos: position{line: 892, col: 1, offset: 30861},
expr: &actionExpr{
pos: position{line: 892, col: 24, offset: 30884},
run: (*parser).callonDoubleQuoteBoldText1,
expr: &seqExpr{
pos: position{line: 892, col: 24, offset: 30884},
exprs: []interface{}{
¬Expr{
pos: position{line: 892, col: 24, offset: 30884},
expr: &litMatcher{
pos: position{line: 892, col: 25, offset: 30885},
val: "\\\\",
ignoreCase: false,
},
},
&litMatcher{
pos: position{line: 892, col: 30, offset: 30890},
val: "**",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 892, col: 35, offset: 30895},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 892, col: 45, offset: 30905},
name: "DoubleQuoteBoldTextElements",
},
},
&litMatcher{
pos: position{line: 892, col: 74, offset: 30934},
val: "**",
ignoreCase: false,
},
},
},
},
},
{
name: "DoubleQuoteBoldTextElements",
pos: position{line: 896, col: 1, offset: 31015},
expr: &seqExpr{
pos: position{line: 896, col: 32, offset: 31046},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 896, col: 32, offset: 31046},
name: "DoubleQuoteBoldTextElement",
},
&zeroOrMoreExpr{
pos: position{line: 896, col: 59, offset: 31073},
expr: &seqExpr{
pos: position{line: 896, col: 60, offset: 31074},
exprs: []interface{}{
¬Expr{
pos: position{line: 896, col: 60, offset: 31074},
expr: &litMatcher{
pos: position{line: 896, col: 62, offset: 31076},
val: "**",
ignoreCase: false,
},
},
&choiceExpr{
pos: position{line: 896, col: 69, offset: 31083},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 896, col: 69, offset: 31083},
name: "WS",
},
&ruleRefExpr{
pos: position{line: 896, col: 74, offset: 31088},
name: "DoubleQuoteBoldTextElement",
},
},
},
},
},
},
},
},
},
{
name: "DoubleQuoteBoldTextElement",
pos: position{line: 898, col: 1, offset: 31153},
expr: &actionExpr{
pos: position{line: 898, col: 31, offset: 31183},
run: (*parser).callonDoubleQuoteBoldTextElement1,
expr: &seqExpr{
pos: position{line: 898, col: 31, offset: 31183},
exprs: []interface{}{
¬Expr{
pos: position{line: 898, col: 31, offset: 31183},
expr: &ruleRefExpr{
pos: position{line: 898, col: 32, offset: 31184},
name: "Newline",
},
},
&labeledExpr{
pos: position{line: 898, col: 40, offset: 31192},
label: "element",
expr: &choiceExpr{
pos: position{line: 898, col: 49, offset: 31201},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 898, col: 49, offset: 31201},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 899, col: 11, offset: 31223},
name: "SingleQuoteBoldText",
},
&ruleRefExpr{
pos: position{line: 900, col: 11, offset: 31254},
name: "ItalicText",
},
&ruleRefExpr{
pos: position{line: 901, col: 11, offset: 31276},
name: "MonospaceText",
},
&ruleRefExpr{
pos: position{line: 902, col: 11, offset: 31300},
name: "SubscriptText",
},
&ruleRefExpr{
pos: position{line: 903, col: 11, offset: 31324},
name: "SuperscriptText",
},
&ruleRefExpr{
pos: position{line: 904, col: 11, offset: 31350},
name: "InlineImage",
},
&ruleRefExpr{
pos: position{line: 905, col: 11, offset: 31373},
name: "QuotedLink",
},
&ruleRefExpr{
pos: position{line: 906, col: 11, offset: 31395},
name: "Passthrough",
},
&ruleRefExpr{
pos: position{line: 907, col: 11, offset: 31418},
name: "DocumentAttributeSubstitution",
},
&ruleRefExpr{
pos: position{line: 908, col: 11, offset: 31458},
name: "NonDoubleQuoteBoldText",
},
&ruleRefExpr{
pos: position{line: 909, col: 11, offset: 31491},
name: "Parenthesis",
},
&ruleRefExpr{
pos: position{line: 910, col: 11, offset: 31513},
name: "AnyChars",
},
&ruleRefExpr{
pos: position{line: 911, col: 11, offset: 31532},
name: "AnyChar",
},
},
},
},
},
},
},
},
{
name: "NonDoubleQuoteBoldText",
pos: position{line: 915, col: 1, offset: 31674},
expr: &actionExpr{
pos: position{line: 915, col: 27, offset: 31700},
run: (*parser).callonNonDoubleQuoteBoldText1,
expr: &seqExpr{
pos: position{line: 915, col: 27, offset: 31700},
exprs: []interface{}{
&anyMatcher{
line: 915, col: 28, offset: 31701,
},
&zeroOrMoreExpr{
pos: position{line: 915, col: 31, offset: 31704},
expr: &seqExpr{
pos: position{line: 915, col: 32, offset: 31705},
exprs: []interface{}{
¬Expr{
pos: position{line: 915, col: 32, offset: 31705},
expr: &litMatcher{
pos: position{line: 915, col: 33, offset: 31706},
val: "**",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 915, col: 38, offset: 31711},
expr: &ruleRefExpr{
pos: position{line: 915, col: 39, offset: 31712},
name: "WS",
},
},
¬Expr{
pos: position{line: 915, col: 42, offset: 31715},
expr: &litMatcher{
pos: position{line: 915, col: 43, offset: 31716},
val: "^",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 915, col: 47, offset: 31720},
expr: &litMatcher{
pos: position{line: 915, col: 48, offset: 31721},
val: "~",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 915, col: 52, offset: 31725},
expr: &ruleRefExpr{
pos: position{line: 915, col: 53, offset: 31726},
name: "Newline",
},
},
¬Expr{
pos: position{line: 915, col: 61, offset: 31734},
expr: &ruleRefExpr{
pos: position{line: 915, col: 62, offset: 31735},
name: "Parenthesis",
},
},
&anyMatcher{
line: 915, col: 74, offset: 31747,
},
},
},
},
},
},
},
},
{
name: "SingleQuoteBoldText",
pos: position{line: 919, col: 1, offset: 31807},
expr: &choiceExpr{
pos: position{line: 919, col: 24, offset: 31830},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 919, col: 24, offset: 31830},
run: (*parser).callonSingleQuoteBoldText2,
expr: &seqExpr{
pos: position{line: 919, col: 24, offset: 31830},
exprs: []interface{}{
¬Expr{
pos: position{line: 919, col: 24, offset: 31830},
expr: &litMatcher{
pos: position{line: 919, col: 25, offset: 31831},
val: "\\",
ignoreCase: false,
},
},
&litMatcher{
pos: position{line: 919, col: 29, offset: 31835},
val: "*",
ignoreCase: false,
},
¬Expr{
pos: position{line: 919, col: 33, offset: 31839},
expr: &litMatcher{
pos: position{line: 919, col: 34, offset: 31840},
val: "*",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 919, col: 38, offset: 31844},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 919, col: 48, offset: 31854},
name: "SingleQuoteBoldTextElements",
},
},
&litMatcher{
pos: position{line: 919, col: 77, offset: 31883},
val: "*",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 921, col: 5, offset: 32064},
run: (*parser).callonSingleQuoteBoldText12,
expr: &seqExpr{
pos: position{line: 921, col: 5, offset: 32064},
exprs: []interface{}{
¬Expr{
pos: position{line: 921, col: 5, offset: 32064},
expr: &litMatcher{
pos: position{line: 921, col: 6, offset: 32065},
val: "\\\\",
ignoreCase: false,
},
},
&litMatcher{
pos: position{line: 921, col: 11, offset: 32070},
val: "*",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 921, col: 15, offset: 32074},
label: "elements",
expr: &seqExpr{
pos: position{line: 921, col: 25, offset: 32084},
exprs: []interface{}{
&litMatcher{
pos: position{line: 921, col: 25, offset: 32084},
val: "*",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 921, col: 29, offset: 32088},
name: "SingleQuoteBoldTextElements",
},
},
},
},
&litMatcher{
pos: position{line: 921, col: 58, offset: 32117},
val: "*",
ignoreCase: false,
},
},
},
},
},
},
},
{
name: "SingleQuoteBoldTextElements",
pos: position{line: 925, col: 1, offset: 32316},
expr: &seqExpr{
pos: position{line: 925, col: 32, offset: 32347},
exprs: []interface{}{
¬Expr{
pos: position{line: 925, col: 32, offset: 32347},
expr: &ruleRefExpr{
pos: position{line: 925, col: 33, offset: 32348},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 925, col: 36, offset: 32351},
name: "SingleQuoteBoldTextElement",
},
&zeroOrMoreExpr{
pos: position{line: 925, col: 63, offset: 32378},
expr: &seqExpr{
pos: position{line: 925, col: 64, offset: 32379},
exprs: []interface{}{
¬Expr{
pos: position{line: 925, col: 64, offset: 32379},
expr: &seqExpr{
pos: position{line: 925, col: 66, offset: 32381},
exprs: []interface{}{
&litMatcher{
pos: position{line: 925, col: 66, offset: 32381},
val: "*",
ignoreCase: false,
},
¬Expr{
pos: position{line: 925, col: 70, offset: 32385},
expr: &ruleRefExpr{
pos: position{line: 925, col: 71, offset: 32386},
name: "Alphanum",
},
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 925, col: 81, offset: 32396},
expr: &ruleRefExpr{
pos: position{line: 925, col: 81, offset: 32396},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 925, col: 85, offset: 32400},
name: "SingleQuoteBoldTextElement",
},
},
},
},
},
},
},
{
name: "SingleQuoteBoldTextElement",
pos: position{line: 927, col: 1, offset: 32431},
expr: &actionExpr{
pos: position{line: 927, col: 31, offset: 32461},
run: (*parser).callonSingleQuoteBoldTextElement1,
expr: &seqExpr{
pos: position{line: 927, col: 31, offset: 32461},
exprs: []interface{}{
¬Expr{
pos: position{line: 927, col: 31, offset: 32461},
expr: &ruleRefExpr{
pos: position{line: 927, col: 32, offset: 32462},
name: "Newline",
},
},
&labeledExpr{
pos: position{line: 927, col: 40, offset: 32470},
label: "element",
expr: &choiceExpr{
pos: position{line: 927, col: 49, offset: 32479},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 927, col: 49, offset: 32479},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 928, col: 11, offset: 32501},
name: "DoubleQuoteBoldText",
},
&ruleRefExpr{
pos: position{line: 929, col: 11, offset: 32531},
name: "ItalicText",
},
&ruleRefExpr{
pos: position{line: 930, col: 11, offset: 32553},
name: "MonospaceText",
},
&ruleRefExpr{
pos: position{line: 931, col: 11, offset: 32577},
name: "SubscriptText",
},
&ruleRefExpr{
pos: position{line: 932, col: 11, offset: 32601},
name: "SuperscriptText",
},
&ruleRefExpr{
pos: position{line: 933, col: 11, offset: 32627},
name: "InlineImage",
},
&ruleRefExpr{
pos: position{line: 934, col: 11, offset: 32650},
name: "QuotedLink",
},
&ruleRefExpr{
pos: position{line: 935, col: 11, offset: 32672},
name: "Passthrough",
},
&ruleRefExpr{
pos: position{line: 936, col: 11, offset: 32695},
name: "DocumentAttributeSubstitution",
},
&ruleRefExpr{
pos: position{line: 937, col: 11, offset: 32735},
name: "NonSingleQuoteBoldText",
},
&ruleRefExpr{
pos: position{line: 938, col: 11, offset: 32768},
name: "Parenthesis",
},
&ruleRefExpr{
pos: position{line: 939, col: 11, offset: 32790},
name: "AnyChars",
},
&ruleRefExpr{
pos: position{line: 940, col: 11, offset: 32809},
name: "AnyChar",
},
},
},
},
},
},
},
},
{
name: "NonSingleQuoteBoldText",
pos: position{line: 944, col: 1, offset: 32951},
expr: &actionExpr{
pos: position{line: 944, col: 27, offset: 32977},
run: (*parser).callonNonSingleQuoteBoldText1,
expr: &seqExpr{
pos: position{line: 944, col: 27, offset: 32977},
exprs: []interface{}{
&anyMatcher{
line: 944, col: 28, offset: 32978,
},
&zeroOrMoreExpr{
pos: position{line: 944, col: 31, offset: 32981},
expr: &seqExpr{
pos: position{line: 944, col: 32, offset: 32982},
exprs: []interface{}{
¬Expr{
pos: position{line: 944, col: 32, offset: 32982},
expr: &litMatcher{
pos: position{line: 944, col: 33, offset: 32983},
val: "*",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 944, col: 37, offset: 32987},
expr: &ruleRefExpr{
pos: position{line: 944, col: 38, offset: 32988},
name: "WS",
},
},
¬Expr{
pos: position{line: 944, col: 41, offset: 32991},
expr: &litMatcher{
pos: position{line: 944, col: 42, offset: 32992},
val: "^",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 944, col: 46, offset: 32996},
expr: &litMatcher{
pos: position{line: 944, col: 47, offset: 32997},
val: "~",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 944, col: 51, offset: 33001},
expr: &ruleRefExpr{
pos: position{line: 944, col: 52, offset: 33002},
name: "Newline",
},
},
¬Expr{
pos: position{line: 944, col: 60, offset: 33010},
expr: &ruleRefExpr{
pos: position{line: 944, col: 61, offset: 33011},
name: "Parenthesis",
},
},
&anyMatcher{
line: 944, col: 73, offset: 33023,
},
},
},
},
},
},
},
},
{
name: "EscapedBoldText",
pos: position{line: 948, col: 1, offset: 33083},
expr: &choiceExpr{
pos: position{line: 949, col: 5, offset: 33107},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 949, col: 5, offset: 33107},
run: (*parser).callonEscapedBoldText2,
expr: &seqExpr{
pos: position{line: 949, col: 5, offset: 33107},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 949, col: 5, offset: 33107},
label: "backslashes",
expr: &ruleRefExpr{
pos: position{line: 949, col: 18, offset: 33120},
name: "TwoOrMoreBackslashes",
},
},
&litMatcher{
pos: position{line: 949, col: 40, offset: 33142},
val: "**",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 949, col: 45, offset: 33147},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 949, col: 55, offset: 33157},
name: "DoubleQuoteBoldTextElements",
},
},
&litMatcher{
pos: position{line: 949, col: 84, offset: 33186},
val: "**",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 951, col: 9, offset: 33343},
run: (*parser).callonEscapedBoldText10,
expr: &seqExpr{
pos: position{line: 951, col: 9, offset: 33343},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 951, col: 9, offset: 33343},
label: "backslashes",
expr: &ruleRefExpr{
pos: position{line: 951, col: 22, offset: 33356},
name: "OneOrMoreBackslashes",
},
},
&litMatcher{
pos: position{line: 951, col: 44, offset: 33378},
val: "**",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 951, col: 49, offset: 33383},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 951, col: 59, offset: 33393},
name: "SingleQuoteBoldTextElements",
},
},
&litMatcher{
pos: position{line: 951, col: 88, offset: 33422},
val: "*",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 954, col: 9, offset: 33622},
run: (*parser).callonEscapedBoldText18,
expr: &seqExpr{
pos: position{line: 954, col: 9, offset: 33622},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 954, col: 9, offset: 33622},
label: "backslashes",
expr: &ruleRefExpr{
pos: position{line: 954, col: 22, offset: 33635},
name: "OneOrMoreBackslashes",
},
},
&litMatcher{
pos: position{line: 954, col: 44, offset: 33657},
val: "*",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 954, col: 48, offset: 33661},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 954, col: 58, offset: 33671},
name: "SingleQuoteBoldTextElements",
},
},
&litMatcher{
pos: position{line: 954, col: 87, offset: 33700},
val: "*",
ignoreCase: false,
},
},
},
},
},
},
},
{
name: "ItalicText",
pos: position{line: 962, col: 1, offset: 33908},
expr: &choiceExpr{
pos: position{line: 962, col: 15, offset: 33922},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 962, col: 15, offset: 33922},
name: "DoubleQuoteItalicText",
},
&ruleRefExpr{
pos: position{line: 962, col: 39, offset: 33946},
name: "SingleQuoteItalicText",
},
},
},
},
{
name: "DoubleQuoteItalicText",
pos: position{line: 964, col: 1, offset: 33969},
expr: &actionExpr{
pos: position{line: 964, col: 26, offset: 33994},
run: (*parser).callonDoubleQuoteItalicText1,
expr: &seqExpr{
pos: position{line: 964, col: 26, offset: 33994},
exprs: []interface{}{
¬Expr{
pos: position{line: 964, col: 26, offset: 33994},
expr: &litMatcher{
pos: position{line: 964, col: 27, offset: 33995},
val: "\\\\",
ignoreCase: false,
},
},
&litMatcher{
pos: position{line: 964, col: 32, offset: 34000},
val: "__",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 964, col: 37, offset: 34005},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 964, col: 47, offset: 34015},
name: "DoubleQuoteItalicTextElements",
},
},
&litMatcher{
pos: position{line: 964, col: 78, offset: 34046},
val: "__",
ignoreCase: false,
},
},
},
},
},
{
name: "DoubleQuoteItalicTextElements",
pos: position{line: 968, col: 1, offset: 34173},
expr: &seqExpr{
pos: position{line: 968, col: 34, offset: 34206},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 968, col: 34, offset: 34206},
name: "DoubleQuoteItalicTextElement",
},
&zeroOrMoreExpr{
pos: position{line: 968, col: 63, offset: 34235},
expr: &seqExpr{
pos: position{line: 968, col: 64, offset: 34236},
exprs: []interface{}{
¬Expr{
pos: position{line: 968, col: 64, offset: 34236},
expr: &litMatcher{
pos: position{line: 968, col: 66, offset: 34238},
val: "__",
ignoreCase: false,
},
},
&choiceExpr{
pos: position{line: 968, col: 73, offset: 34245},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 968, col: 73, offset: 34245},
name: "WS",
},
&ruleRefExpr{
pos: position{line: 968, col: 78, offset: 34250},
name: "DoubleQuoteItalicTextElement",
},
},
},
},
},
},
},
},
},
{
name: "DoubleQuoteItalicTextElement",
pos: position{line: 970, col: 1, offset: 34317},
expr: &actionExpr{
pos: position{line: 970, col: 33, offset: 34349},
run: (*parser).callonDoubleQuoteItalicTextElement1,
expr: &seqExpr{
pos: position{line: 970, col: 33, offset: 34349},
exprs: []interface{}{
¬Expr{
pos: position{line: 970, col: 33, offset: 34349},
expr: &ruleRefExpr{
pos: position{line: 970, col: 34, offset: 34350},
name: "Newline",
},
},
&labeledExpr{
pos: position{line: 970, col: 42, offset: 34358},
label: "element",
expr: &choiceExpr{
pos: position{line: 970, col: 51, offset: 34367},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 970, col: 51, offset: 34367},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 971, col: 11, offset: 34389},
name: "SingleQuoteItalicText",
},
&ruleRefExpr{
pos: position{line: 972, col: 11, offset: 34422},
name: "BoldText",
},
&ruleRefExpr{
pos: position{line: 973, col: 11, offset: 34442},
name: "MonospaceText",
},
&ruleRefExpr{
pos: position{line: 974, col: 11, offset: 34466},
name: "SubscriptText",
},
&ruleRefExpr{
pos: position{line: 975, col: 11, offset: 34490},
name: "SuperscriptText",
},
&ruleRefExpr{
pos: position{line: 976, col: 11, offset: 34516},
name: "InlineImage",
},
&ruleRefExpr{
pos: position{line: 977, col: 11, offset: 34539},
name: "QuotedLink",
},
&ruleRefExpr{
pos: position{line: 978, col: 11, offset: 34561},
name: "Passthrough",
},
&ruleRefExpr{
pos: position{line: 979, col: 11, offset: 34584},
name: "NonDoubleQuoteItalicText",
},
&ruleRefExpr{
pos: position{line: 980, col: 11, offset: 34619},
name: "Parenthesis",
},
&ruleRefExpr{
pos: position{line: 981, col: 11, offset: 34641},
name: "AnyChars",
},
&ruleRefExpr{
pos: position{line: 982, col: 11, offset: 34660},
name: "AnyChar",
},
},
},
},
},
},
},
},
{
name: "NonDoubleQuoteItalicText",
pos: position{line: 986, col: 1, offset: 34802},
expr: &actionExpr{
pos: position{line: 986, col: 29, offset: 34830},
run: (*parser).callonNonDoubleQuoteItalicText1,
expr: &seqExpr{
pos: position{line: 986, col: 29, offset: 34830},
exprs: []interface{}{
&anyMatcher{
line: 986, col: 30, offset: 34831,
},
&zeroOrMoreExpr{
pos: position{line: 986, col: 33, offset: 34834},
expr: &seqExpr{
pos: position{line: 986, col: 34, offset: 34835},
exprs: []interface{}{
¬Expr{
pos: position{line: 986, col: 34, offset: 34835},
expr: &litMatcher{
pos: position{line: 986, col: 35, offset: 34836},
val: "__",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 986, col: 40, offset: 34841},
expr: &litMatcher{
pos: position{line: 986, col: 41, offset: 34842},
val: "^",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 986, col: 45, offset: 34846},
expr: &litMatcher{
pos: position{line: 986, col: 46, offset: 34847},
val: "~",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 986, col: 50, offset: 34851},
expr: &ruleRefExpr{
pos: position{line: 986, col: 51, offset: 34852},
name: "Newline",
},
},
¬Expr{
pos: position{line: 986, col: 59, offset: 34860},
expr: &ruleRefExpr{
pos: position{line: 986, col: 60, offset: 34861},
name: "Parenthesis",
},
},
&anyMatcher{
line: 986, col: 72, offset: 34873,
},
},
},
},
},
},
},
},
{
name: "SingleQuoteItalicText",
pos: position{line: 990, col: 1, offset: 34933},
expr: &choiceExpr{
pos: position{line: 990, col: 26, offset: 34958},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 990, col: 26, offset: 34958},
run: (*parser).callonSingleQuoteItalicText2,
expr: &seqExpr{
pos: position{line: 990, col: 26, offset: 34958},
exprs: []interface{}{
¬Expr{
pos: position{line: 990, col: 26, offset: 34958},
expr: &litMatcher{
pos: position{line: 990, col: 27, offset: 34959},
val: "\\",
ignoreCase: false,
},
},
&litMatcher{
pos: position{line: 990, col: 31, offset: 34963},
val: "_",
ignoreCase: false,
},
¬Expr{
pos: position{line: 990, col: 35, offset: 34967},
expr: &litMatcher{
pos: position{line: 990, col: 36, offset: 34968},
val: "_",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 990, col: 40, offset: 34972},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 990, col: 50, offset: 34982},
name: "SingleQuoteItalicTextElements",
},
},
&litMatcher{
pos: position{line: 990, col: 81, offset: 35013},
val: "_",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 992, col: 5, offset: 35196},
run: (*parser).callonSingleQuoteItalicText12,
expr: &seqExpr{
pos: position{line: 992, col: 5, offset: 35196},
exprs: []interface{}{
¬Expr{
pos: position{line: 992, col: 5, offset: 35196},
expr: &litMatcher{
pos: position{line: 992, col: 6, offset: 35197},
val: "\\\\",
ignoreCase: false,
},
},
&litMatcher{
pos: position{line: 992, col: 11, offset: 35202},
val: "_",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 992, col: 15, offset: 35206},
label: "elements",
expr: &seqExpr{
pos: position{line: 992, col: 25, offset: 35216},
exprs: []interface{}{
&litMatcher{
pos: position{line: 992, col: 25, offset: 35216},
val: "_",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 992, col: 29, offset: 35220},
name: "SingleQuoteItalicTextElements",
},
},
},
},
&litMatcher{
pos: position{line: 992, col: 60, offset: 35251},
val: "_",
ignoreCase: false,
},
},
},
},
},
},
},
{
name: "SingleQuoteItalicTextElements",
pos: position{line: 996, col: 1, offset: 35454},
expr: &seqExpr{
pos: position{line: 996, col: 34, offset: 35487},
exprs: []interface{}{
¬Expr{
pos: position{line: 996, col: 34, offset: 35487},
expr: &ruleRefExpr{
pos: position{line: 996, col: 35, offset: 35488},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 996, col: 38, offset: 35491},
name: "SingleQuoteItalicTextElement",
},
&zeroOrMoreExpr{
pos: position{line: 996, col: 67, offset: 35520},
expr: &seqExpr{
pos: position{line: 996, col: 68, offset: 35521},
exprs: []interface{}{
¬Expr{
pos: position{line: 996, col: 68, offset: 35521},
expr: &seqExpr{
pos: position{line: 996, col: 70, offset: 35523},
exprs: []interface{}{
&litMatcher{
pos: position{line: 996, col: 70, offset: 35523},
val: "_",
ignoreCase: false,
},
¬Expr{
pos: position{line: 996, col: 74, offset: 35527},
expr: &ruleRefExpr{
pos: position{line: 996, col: 75, offset: 35528},
name: "Alphanum",
},
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 996, col: 85, offset: 35538},
expr: &ruleRefExpr{
pos: position{line: 996, col: 85, offset: 35538},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 996, col: 89, offset: 35542},
name: "SingleQuoteItalicTextElement",
},
},
},
},
},
},
},
{
name: "SingleQuoteItalicTextElement",
pos: position{line: 998, col: 1, offset: 35574},
expr: &actionExpr{
pos: position{line: 998, col: 33, offset: 35606},
run: (*parser).callonSingleQuoteItalicTextElement1,
expr: &seqExpr{
pos: position{line: 998, col: 33, offset: 35606},
exprs: []interface{}{
¬Expr{
pos: position{line: 998, col: 33, offset: 35606},
expr: &ruleRefExpr{
pos: position{line: 998, col: 34, offset: 35607},
name: "Newline",
},
},
&labeledExpr{
pos: position{line: 998, col: 42, offset: 35615},
label: "element",
expr: &choiceExpr{
pos: position{line: 998, col: 51, offset: 35624},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 998, col: 51, offset: 35624},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 999, col: 11, offset: 35646},
name: "DoubleQuoteItalicText",
},
&ruleRefExpr{
pos: position{line: 1000, col: 11, offset: 35678},
name: "BoldText",
},
&ruleRefExpr{
pos: position{line: 1001, col: 11, offset: 35698},
name: "MonospaceText",
},
&ruleRefExpr{
pos: position{line: 1002, col: 11, offset: 35722},
name: "SubscriptText",
},
&ruleRefExpr{
pos: position{line: 1003, col: 11, offset: 35746},
name: "SuperscriptText",
},
&ruleRefExpr{
pos: position{line: 1004, col: 11, offset: 35772},
name: "InlineImage",
},
&ruleRefExpr{
pos: position{line: 1005, col: 11, offset: 35795},
name: "QuotedLink",
},
&ruleRefExpr{
pos: position{line: 1006, col: 11, offset: 35817},
name: "Passthrough",
},
&ruleRefExpr{
pos: position{line: 1007, col: 11, offset: 35840},
name: "NonSingleQuoteItalicText",
},
&ruleRefExpr{
pos: position{line: 1008, col: 11, offset: 35875},
name: "Parenthesis",
},
&ruleRefExpr{
pos: position{line: 1009, col: 11, offset: 35897},
name: "AnyChars",
},
&ruleRefExpr{
pos: position{line: 1010, col: 11, offset: 35916},
name: "AnyChar",
},
},
},
},
},
},
},
},
{
name: "NonSingleQuoteItalicText",
pos: position{line: 1014, col: 1, offset: 36058},
expr: &actionExpr{
pos: position{line: 1014, col: 29, offset: 36086},
run: (*parser).callonNonSingleQuoteItalicText1,
expr: &seqExpr{
pos: position{line: 1014, col: 29, offset: 36086},
exprs: []interface{}{
&anyMatcher{
line: 1014, col: 30, offset: 36087,
},
&zeroOrMoreExpr{
pos: position{line: 1014, col: 33, offset: 36090},
expr: &seqExpr{
pos: position{line: 1014, col: 34, offset: 36091},
exprs: []interface{}{
¬Expr{
pos: position{line: 1014, col: 34, offset: 36091},
expr: &litMatcher{
pos: position{line: 1014, col: 35, offset: 36092},
val: "_",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1014, col: 39, offset: 36096},
expr: &ruleRefExpr{
pos: position{line: 1014, col: 40, offset: 36097},
name: "WS",
},
},
¬Expr{
pos: position{line: 1014, col: 43, offset: 36100},
expr: &litMatcher{
pos: position{line: 1014, col: 44, offset: 36101},
val: "^",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1014, col: 48, offset: 36105},
expr: &litMatcher{
pos: position{line: 1014, col: 49, offset: 36106},
val: "~",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1014, col: 53, offset: 36110},
expr: &ruleRefExpr{
pos: position{line: 1014, col: 54, offset: 36111},
name: "Newline",
},
},
¬Expr{
pos: position{line: 1014, col: 62, offset: 36119},
expr: &ruleRefExpr{
pos: position{line: 1014, col: 63, offset: 36120},
name: "Parenthesis",
},
},
&anyMatcher{
line: 1014, col: 75, offset: 36132,
},
},
},
},
},
},
},
},
{
name: "EscapedItalicText",
pos: position{line: 1018, col: 1, offset: 36192},
expr: &choiceExpr{
pos: position{line: 1019, col: 5, offset: 36218},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 1019, col: 5, offset: 36218},
run: (*parser).callonEscapedItalicText2,
expr: &seqExpr{
pos: position{line: 1019, col: 5, offset: 36218},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1019, col: 5, offset: 36218},
label: "backslashes",
expr: &ruleRefExpr{
pos: position{line: 1019, col: 18, offset: 36231},
name: "TwoOrMoreBackslashes",
},
},
&litMatcher{
pos: position{line: 1019, col: 40, offset: 36253},
val: "__",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1019, col: 45, offset: 36258},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 1019, col: 55, offset: 36268},
name: "DoubleQuoteItalicTextElements",
},
},
&litMatcher{
pos: position{line: 1019, col: 86, offset: 36299},
val: "__",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 1021, col: 9, offset: 36456},
run: (*parser).callonEscapedItalicText10,
expr: &seqExpr{
pos: position{line: 1021, col: 9, offset: 36456},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1021, col: 9, offset: 36456},
label: "backslashes",
expr: &ruleRefExpr{
pos: position{line: 1021, col: 22, offset: 36469},
name: "OneOrMoreBackslashes",
},
},
&litMatcher{
pos: position{line: 1021, col: 44, offset: 36491},
val: "__",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1021, col: 49, offset: 36496},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 1021, col: 59, offset: 36506},
name: "SingleQuoteItalicTextElements",
},
},
&litMatcher{
pos: position{line: 1021, col: 90, offset: 36537},
val: "_",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 1024, col: 9, offset: 36737},
run: (*parser).callonEscapedItalicText18,
expr: &seqExpr{
pos: position{line: 1024, col: 9, offset: 36737},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1024, col: 9, offset: 36737},
label: "backslashes",
expr: &ruleRefExpr{
pos: position{line: 1024, col: 22, offset: 36750},
name: "OneOrMoreBackslashes",
},
},
&litMatcher{
pos: position{line: 1024, col: 44, offset: 36772},
val: "_",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1024, col: 48, offset: 36776},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 1024, col: 58, offset: 36786},
name: "SingleQuoteItalicTextElements",
},
},
&litMatcher{
pos: position{line: 1024, col: 89, offset: 36817},
val: "_",
ignoreCase: false,
},
},
},
},
},
},
},
{
name: "MonospaceText",
pos: position{line: 1031, col: 1, offset: 37027},
expr: &choiceExpr{
pos: position{line: 1031, col: 18, offset: 37044},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1031, col: 18, offset: 37044},
name: "DoubleQuoteMonospaceText",
},
&ruleRefExpr{
pos: position{line: 1031, col: 45, offset: 37071},
name: "SingleQuoteMonospaceText",
},
},
},
},
{
name: "DoubleQuoteMonospaceText",
pos: position{line: 1033, col: 1, offset: 37097},
expr: &actionExpr{
pos: position{line: 1033, col: 29, offset: 37125},
run: (*parser).callonDoubleQuoteMonospaceText1,
expr: &seqExpr{
pos: position{line: 1033, col: 29, offset: 37125},
exprs: []interface{}{
¬Expr{
pos: position{line: 1033, col: 29, offset: 37125},
expr: &litMatcher{
pos: position{line: 1033, col: 30, offset: 37126},
val: "\\\\",
ignoreCase: false,
},
},
&litMatcher{
pos: position{line: 1033, col: 35, offset: 37131},
val: "``",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1033, col: 40, offset: 37136},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 1033, col: 50, offset: 37146},
name: "DoubleQuoteMonospaceTextElements",
},
},
&litMatcher{
pos: position{line: 1033, col: 84, offset: 37180},
val: "``",
ignoreCase: false,
},
},
},
},
},
{
name: "DoubleQuoteMonospaceTextElements",
pos: position{line: 1037, col: 1, offset: 37310},
expr: &seqExpr{
pos: position{line: 1037, col: 37, offset: 37346},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 1037, col: 37, offset: 37346},
name: "DoubleQuoteMonospaceTextElement",
},
&zeroOrMoreExpr{
pos: position{line: 1037, col: 69, offset: 37378},
expr: &seqExpr{
pos: position{line: 1037, col: 70, offset: 37379},
exprs: []interface{}{
¬Expr{
pos: position{line: 1037, col: 70, offset: 37379},
expr: &litMatcher{
pos: position{line: 1037, col: 72, offset: 37381},
val: "``",
ignoreCase: false,
},
},
&choiceExpr{
pos: position{line: 1037, col: 79, offset: 37388},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1037, col: 79, offset: 37388},
name: "WS",
},
&ruleRefExpr{
pos: position{line: 1037, col: 84, offset: 37393},
name: "DoubleQuoteMonospaceTextElement",
},
},
},
},
},
},
},
},
},
{
name: "DoubleQuoteMonospaceTextElement",
pos: position{line: 1039, col: 1, offset: 37462},
expr: &actionExpr{
pos: position{line: 1039, col: 36, offset: 37497},
run: (*parser).callonDoubleQuoteMonospaceTextElement1,
expr: &seqExpr{
pos: position{line: 1039, col: 36, offset: 37497},
exprs: []interface{}{
¬Expr{
pos: position{line: 1039, col: 36, offset: 37497},
expr: &ruleRefExpr{
pos: position{line: 1039, col: 37, offset: 37498},
name: "Newline",
},
},
&labeledExpr{
pos: position{line: 1039, col: 45, offset: 37506},
label: "element",
expr: &choiceExpr{
pos: position{line: 1039, col: 54, offset: 37515},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1039, col: 54, offset: 37515},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 1040, col: 11, offset: 37537},
name: "SingleQuoteMonospaceText",
},
&ruleRefExpr{
pos: position{line: 1041, col: 11, offset: 37573},
name: "BoldText",
},
&ruleRefExpr{
pos: position{line: 1042, col: 11, offset: 37592},
name: "ItalicText",
},
&ruleRefExpr{
pos: position{line: 1043, col: 11, offset: 37614},
name: "SubscriptText",
},
&ruleRefExpr{
pos: position{line: 1044, col: 11, offset: 37638},
name: "SuperscriptText",
},
&ruleRefExpr{
pos: position{line: 1045, col: 11, offset: 37664},
name: "InlineImage",
},
&ruleRefExpr{
pos: position{line: 1046, col: 11, offset: 37687},
name: "QuotedLink",
},
&ruleRefExpr{
pos: position{line: 1047, col: 11, offset: 37709},
name: "Passthrough",
},
&ruleRefExpr{
pos: position{line: 1048, col: 11, offset: 37732},
name: "NonDoubleQuoteMonospaceText",
},
&ruleRefExpr{
pos: position{line: 1049, col: 11, offset: 37770},
name: "Parenthesis",
},
&ruleRefExpr{
pos: position{line: 1050, col: 11, offset: 37792},
name: "AnyChars",
},
&ruleRefExpr{
pos: position{line: 1051, col: 11, offset: 37811},
name: "AnyChar",
},
},
},
},
},
},
},
},
{
name: "NonDoubleQuoteMonospaceText",
pos: position{line: 1055, col: 1, offset: 37953},
expr: &actionExpr{
pos: position{line: 1055, col: 32, offset: 37984},
run: (*parser).callonNonDoubleQuoteMonospaceText1,
expr: &seqExpr{
pos: position{line: 1055, col: 32, offset: 37984},
exprs: []interface{}{
&anyMatcher{
line: 1055, col: 33, offset: 37985,
},
&zeroOrMoreExpr{
pos: position{line: 1055, col: 36, offset: 37988},
expr: &seqExpr{
pos: position{line: 1055, col: 37, offset: 37989},
exprs: []interface{}{
¬Expr{
pos: position{line: 1055, col: 37, offset: 37989},
expr: &litMatcher{
pos: position{line: 1055, col: 38, offset: 37990},
val: "``",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1055, col: 43, offset: 37995},
expr: &ruleRefExpr{
pos: position{line: 1055, col: 44, offset: 37996},
name: "WS",
},
},
¬Expr{
pos: position{line: 1055, col: 47, offset: 37999},
expr: &litMatcher{
pos: position{line: 1055, col: 48, offset: 38000},
val: "^",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1055, col: 52, offset: 38004},
expr: &litMatcher{
pos: position{line: 1055, col: 53, offset: 38005},
val: "~",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1055, col: 57, offset: 38009},
expr: &ruleRefExpr{
pos: position{line: 1055, col: 58, offset: 38010},
name: "Newline",
},
},
¬Expr{
pos: position{line: 1055, col: 66, offset: 38018},
expr: &ruleRefExpr{
pos: position{line: 1055, col: 67, offset: 38019},
name: "Parenthesis",
},
},
&anyMatcher{
line: 1055, col: 79, offset: 38031,
},
},
},
},
},
},
},
},
{
name: "SingleQuoteMonospaceText",
pos: position{line: 1059, col: 1, offset: 38091},
expr: &choiceExpr{
pos: position{line: 1059, col: 29, offset: 38119},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 1059, col: 29, offset: 38119},
run: (*parser).callonSingleQuoteMonospaceText2,
expr: &seqExpr{
pos: position{line: 1059, col: 29, offset: 38119},
exprs: []interface{}{
¬Expr{
pos: position{line: 1059, col: 29, offset: 38119},
expr: &litMatcher{
pos: position{line: 1059, col: 30, offset: 38120},
val: "\\",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1059, col: 34, offset: 38124},
expr: &litMatcher{
pos: position{line: 1059, col: 35, offset: 38125},
val: "``",
ignoreCase: false,
},
},
&litMatcher{
pos: position{line: 1059, col: 40, offset: 38130},
val: "`",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1059, col: 44, offset: 38134},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 1059, col: 54, offset: 38144},
name: "SingleQuoteMonospaceTextElements",
},
},
&litMatcher{
pos: position{line: 1059, col: 88, offset: 38178},
val: "`",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 1061, col: 5, offset: 38364},
run: (*parser).callonSingleQuoteMonospaceText12,
expr: &seqExpr{
pos: position{line: 1061, col: 5, offset: 38364},
exprs: []interface{}{
¬Expr{
pos: position{line: 1061, col: 5, offset: 38364},
expr: &litMatcher{
pos: position{line: 1061, col: 6, offset: 38365},
val: "\\\\",
ignoreCase: false,
},
},
&litMatcher{
pos: position{line: 1061, col: 11, offset: 38370},
val: "`",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1061, col: 15, offset: 38374},
label: "elements",
expr: &seqExpr{
pos: position{line: 1061, col: 25, offset: 38384},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1061, col: 25, offset: 38384},
val: "`",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 1061, col: 29, offset: 38388},
name: "SingleQuoteMonospaceTextElements",
},
},
},
},
&litMatcher{
pos: position{line: 1061, col: 63, offset: 38422},
val: "`",
ignoreCase: false,
},
},
},
},
},
},
},
{
name: "SingleQuoteMonospaceTextElements",
pos: position{line: 1065, col: 1, offset: 38631},
expr: &seqExpr{
pos: position{line: 1065, col: 37, offset: 38667},
exprs: []interface{}{
¬Expr{
pos: position{line: 1065, col: 37, offset: 38667},
expr: &ruleRefExpr{
pos: position{line: 1065, col: 38, offset: 38668},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1065, col: 41, offset: 38671},
name: "SingleQuoteMonospaceTextElement",
},
&zeroOrMoreExpr{
pos: position{line: 1065, col: 73, offset: 38703},
expr: &seqExpr{
pos: position{line: 1065, col: 74, offset: 38704},
exprs: []interface{}{
¬Expr{
pos: position{line: 1065, col: 74, offset: 38704},
expr: &seqExpr{
pos: position{line: 1065, col: 76, offset: 38706},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1065, col: 76, offset: 38706},
val: "`",
ignoreCase: false,
},
¬Expr{
pos: position{line: 1065, col: 80, offset: 38710},
expr: &ruleRefExpr{
pos: position{line: 1065, col: 81, offset: 38711},
name: "Alphanum",
},
},
},
},
},
&zeroOrMoreExpr{
pos: position{line: 1065, col: 91, offset: 38721},
expr: &ruleRefExpr{
pos: position{line: 1065, col: 91, offset: 38721},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1065, col: 95, offset: 38725},
name: "SingleQuoteMonospaceTextElement",
},
},
},
},
},
},
},
{
name: "SingleQuoteMonospaceTextElement",
pos: position{line: 1067, col: 1, offset: 38760},
expr: &actionExpr{
pos: position{line: 1067, col: 37, offset: 38796},
run: (*parser).callonSingleQuoteMonospaceTextElement1,
expr: &labeledExpr{
pos: position{line: 1067, col: 37, offset: 38796},
label: "element",
expr: &choiceExpr{
pos: position{line: 1067, col: 46, offset: 38805},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1067, col: 46, offset: 38805},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 1068, col: 11, offset: 38827},
name: "Newline",
},
&ruleRefExpr{
pos: position{line: 1069, col: 11, offset: 38865},
name: "DoubleQuoteMonospaceText",
},
&ruleRefExpr{
pos: position{line: 1070, col: 11, offset: 38901},
name: "BoldText",
},
&ruleRefExpr{
pos: position{line: 1071, col: 11, offset: 38920},
name: "ItalicText",
},
&ruleRefExpr{
pos: position{line: 1072, col: 11, offset: 38941},
name: "SubscriptText",
},
&ruleRefExpr{
pos: position{line: 1073, col: 11, offset: 38965},
name: "SuperscriptText",
},
&ruleRefExpr{
pos: position{line: 1074, col: 11, offset: 38991},
name: "InlineImage",
},
&ruleRefExpr{
pos: position{line: 1075, col: 11, offset: 39014},
name: "QuotedLink",
},
&ruleRefExpr{
pos: position{line: 1076, col: 11, offset: 39036},
name: "Passthrough",
},
&ruleRefExpr{
pos: position{line: 1077, col: 11, offset: 39059},
name: "NonSingleQuoteMonospaceText",
},
&ruleRefExpr{
pos: position{line: 1078, col: 11, offset: 39097},
name: "Parenthesis",
},
&ruleRefExpr{
pos: position{line: 1079, col: 11, offset: 39119},
name: "AnyChars",
},
&ruleRefExpr{
pos: position{line: 1080, col: 11, offset: 39138},
name: "AnyChar",
},
},
},
},
},
},
{
name: "NonSingleQuoteMonospaceText",
pos: position{line: 1084, col: 1, offset: 39280},
expr: &actionExpr{
pos: position{line: 1084, col: 32, offset: 39311},
run: (*parser).callonNonSingleQuoteMonospaceText1,
expr: &seqExpr{
pos: position{line: 1084, col: 32, offset: 39311},
exprs: []interface{}{
&anyMatcher{
line: 1084, col: 33, offset: 39312,
},
&zeroOrMoreExpr{
pos: position{line: 1084, col: 36, offset: 39315},
expr: &seqExpr{
pos: position{line: 1084, col: 37, offset: 39316},
exprs: []interface{}{
¬Expr{
pos: position{line: 1084, col: 37, offset: 39316},
expr: &ruleRefExpr{
pos: position{line: 1084, col: 38, offset: 39317},
name: "WS",
},
},
¬Expr{
pos: position{line: 1084, col: 41, offset: 39320},
expr: &litMatcher{
pos: position{line: 1084, col: 42, offset: 39321},
val: "`",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1084, col: 46, offset: 39325},
expr: &litMatcher{
pos: position{line: 1084, col: 47, offset: 39326},
val: "^",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1084, col: 51, offset: 39330},
expr: &litMatcher{
pos: position{line: 1084, col: 52, offset: 39331},
val: "~",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1084, col: 56, offset: 39335},
expr: &ruleRefExpr{
pos: position{line: 1084, col: 57, offset: 39336},
name: "Newline",
},
},
¬Expr{
pos: position{line: 1084, col: 65, offset: 39344},
expr: &ruleRefExpr{
pos: position{line: 1084, col: 66, offset: 39345},
name: "Parenthesis",
},
},
&anyMatcher{
line: 1084, col: 78, offset: 39357,
},
},
},
},
},
},
},
},
{
name: "EscapedMonospaceText",
pos: position{line: 1088, col: 1, offset: 39438},
expr: &choiceExpr{
pos: position{line: 1089, col: 5, offset: 39467},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 1089, col: 5, offset: 39467},
run: (*parser).callonEscapedMonospaceText2,
expr: &seqExpr{
pos: position{line: 1089, col: 5, offset: 39467},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1089, col: 5, offset: 39467},
label: "backslashes",
expr: &ruleRefExpr{
pos: position{line: 1089, col: 18, offset: 39480},
name: "TwoOrMoreBackslashes",
},
},
&litMatcher{
pos: position{line: 1089, col: 40, offset: 39502},
val: "``",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1089, col: 45, offset: 39507},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 1089, col: 55, offset: 39517},
name: "DoubleQuoteMonospaceTextElements",
},
},
&litMatcher{
pos: position{line: 1089, col: 89, offset: 39551},
val: "``",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 1091, col: 9, offset: 39708},
run: (*parser).callonEscapedMonospaceText10,
expr: &seqExpr{
pos: position{line: 1091, col: 9, offset: 39708},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1091, col: 9, offset: 39708},
label: "backslashes",
expr: &ruleRefExpr{
pos: position{line: 1091, col: 22, offset: 39721},
name: "OneOrMoreBackslashes",
},
},
&litMatcher{
pos: position{line: 1091, col: 44, offset: 39743},
val: "``",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1091, col: 49, offset: 39748},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 1091, col: 59, offset: 39758},
name: "SingleQuoteMonospaceTextElements",
},
},
&litMatcher{
pos: position{line: 1091, col: 93, offset: 39792},
val: "`",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 1094, col: 9, offset: 39992},
run: (*parser).callonEscapedMonospaceText18,
expr: &seqExpr{
pos: position{line: 1094, col: 9, offset: 39992},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1094, col: 9, offset: 39992},
label: "backslashes",
expr: &ruleRefExpr{
pos: position{line: 1094, col: 22, offset: 40005},
name: "OneOrMoreBackslashes",
},
},
&litMatcher{
pos: position{line: 1094, col: 44, offset: 40027},
val: "`",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1094, col: 48, offset: 40031},
label: "elements",
expr: &ruleRefExpr{
pos: position{line: 1094, col: 58, offset: 40041},
name: "SingleQuoteMonospaceTextElements",
},
},
&litMatcher{
pos: position{line: 1094, col: 92, offset: 40075},
val: "`",
ignoreCase: false,
},
},
},
},
},
},
},
{
name: "SubscriptText",
pos: position{line: 1098, col: 1, offset: 40225},
expr: &actionExpr{
pos: position{line: 1098, col: 18, offset: 40242},
run: (*parser).callonSubscriptText1,
expr: &seqExpr{
pos: position{line: 1098, col: 18, offset: 40242},
exprs: []interface{}{
¬Expr{
pos: position{line: 1098, col: 18, offset: 40242},
expr: &litMatcher{
pos: position{line: 1098, col: 19, offset: 40243},
val: "\\",
ignoreCase: false,
},
},
&litMatcher{
pos: position{line: 1098, col: 23, offset: 40247},
val: "~",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1098, col: 27, offset: 40251},
label: "element",
expr: &ruleRefExpr{
pos: position{line: 1098, col: 36, offset: 40260},
name: "SubscriptTextElement",
},
},
&litMatcher{
pos: position{line: 1098, col: 58, offset: 40282},
val: "~",
ignoreCase: false,
},
},
},
},
},
{
name: "SubscriptTextElement",
pos: position{line: 1102, col: 1, offset: 40371},
expr: &choiceExpr{
pos: position{line: 1102, col: 25, offset: 40395},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1102, col: 25, offset: 40395},
name: "QuotedText",
},
&ruleRefExpr{
pos: position{line: 1102, col: 38, offset: 40408},
name: "NonSubscriptText",
},
},
},
},
{
name: "NonSubscriptText",
pos: position{line: 1104, col: 1, offset: 40427},
expr: &actionExpr{
pos: position{line: 1104, col: 21, offset: 40447},
run: (*parser).callonNonSubscriptText1,
expr: &oneOrMoreExpr{
pos: position{line: 1104, col: 21, offset: 40447},
expr: &seqExpr{
pos: position{line: 1104, col: 22, offset: 40448},
exprs: []interface{}{
¬Expr{
pos: position{line: 1104, col: 22, offset: 40448},
expr: &ruleRefExpr{
pos: position{line: 1104, col: 23, offset: 40449},
name: "Newline",
},
},
¬Expr{
pos: position{line: 1104, col: 31, offset: 40457},
expr: &ruleRefExpr{
pos: position{line: 1104, col: 32, offset: 40458},
name: "WS",
},
},
¬Expr{
pos: position{line: 1104, col: 35, offset: 40461},
expr: &litMatcher{
pos: position{line: 1104, col: 36, offset: 40462},
val: "~",
ignoreCase: false,
},
},
&anyMatcher{
line: 1104, col: 40, offset: 40466,
},
},
},
},
},
},
{
name: "EscapedSubscriptText",
pos: position{line: 1108, col: 1, offset: 40499},
expr: &actionExpr{
pos: position{line: 1108, col: 25, offset: 40523},
run: (*parser).callonEscapedSubscriptText1,
expr: &seqExpr{
pos: position{line: 1108, col: 25, offset: 40523},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1108, col: 25, offset: 40523},
label: "backslashes",
expr: &ruleRefExpr{
pos: position{line: 1108, col: 38, offset: 40536},
name: "OneOrMoreBackslashes",
},
},
&litMatcher{
pos: position{line: 1108, col: 60, offset: 40558},
val: "~",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1108, col: 64, offset: 40562},
label: "element",
expr: &ruleRefExpr{
pos: position{line: 1108, col: 73, offset: 40571},
name: "SubscriptTextElement",
},
},
&litMatcher{
pos: position{line: 1108, col: 95, offset: 40593},
val: "~",
ignoreCase: false,
},
},
},
},
},
{
name: "SuperscriptText",
pos: position{line: 1112, col: 1, offset: 40722},
expr: &actionExpr{
pos: position{line: 1112, col: 20, offset: 40741},
run: (*parser).callonSuperscriptText1,
expr: &seqExpr{
pos: position{line: 1112, col: 20, offset: 40741},
exprs: []interface{}{
¬Expr{
pos: position{line: 1112, col: 20, offset: 40741},
expr: &litMatcher{
pos: position{line: 1112, col: 21, offset: 40742},
val: "\\",
ignoreCase: false,
},
},
&litMatcher{
pos: position{line: 1112, col: 25, offset: 40746},
val: "^",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1112, col: 29, offset: 40750},
label: "element",
expr: &ruleRefExpr{
pos: position{line: 1112, col: 38, offset: 40759},
name: "SuperscriptTextElement",
},
},
&litMatcher{
pos: position{line: 1112, col: 62, offset: 40783},
val: "^",
ignoreCase: false,
},
},
},
},
},
{
name: "SuperscriptTextElement",
pos: position{line: 1116, col: 1, offset: 40874},
expr: &choiceExpr{
pos: position{line: 1116, col: 27, offset: 40900},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1116, col: 27, offset: 40900},
name: "QuotedText",
},
&ruleRefExpr{
pos: position{line: 1116, col: 40, offset: 40913},
name: "NonSuperscriptText",
},
},
},
},
{
name: "NonSuperscriptText",
pos: position{line: 1118, col: 1, offset: 40934},
expr: &actionExpr{
pos: position{line: 1118, col: 23, offset: 40956},
run: (*parser).callonNonSuperscriptText1,
expr: &oneOrMoreExpr{
pos: position{line: 1118, col: 23, offset: 40956},
expr: &seqExpr{
pos: position{line: 1118, col: 24, offset: 40957},
exprs: []interface{}{
¬Expr{
pos: position{line: 1118, col: 24, offset: 40957},
expr: &ruleRefExpr{
pos: position{line: 1118, col: 25, offset: 40958},
name: "Newline",
},
},
¬Expr{
pos: position{line: 1118, col: 33, offset: 40966},
expr: &ruleRefExpr{
pos: position{line: 1118, col: 34, offset: 40967},
name: "WS",
},
},
¬Expr{
pos: position{line: 1118, col: 37, offset: 40970},
expr: &litMatcher{
pos: position{line: 1118, col: 38, offset: 40971},
val: "^",
ignoreCase: false,
},
},
&anyMatcher{
line: 1118, col: 42, offset: 40975,
},
},
},
},
},
},
{
name: "EscapedSuperscriptText",
pos: position{line: 1122, col: 1, offset: 41008},
expr: &actionExpr{
pos: position{line: 1122, col: 27, offset: 41034},
run: (*parser).callonEscapedSuperscriptText1,
expr: &seqExpr{
pos: position{line: 1122, col: 27, offset: 41034},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1122, col: 27, offset: 41034},
label: "backslashes",
expr: &ruleRefExpr{
pos: position{line: 1122, col: 40, offset: 41047},
name: "OneOrMoreBackslashes",
},
},
&litMatcher{
pos: position{line: 1122, col: 62, offset: 41069},
val: "^",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1122, col: 66, offset: 41073},
label: "element",
expr: &ruleRefExpr{
pos: position{line: 1122, col: 75, offset: 41082},
name: "SuperscriptTextElement",
},
},
&litMatcher{
pos: position{line: 1122, col: 99, offset: 41106},
val: "^",
ignoreCase: false,
},
},
},
},
},
{
name: "Passthrough",
pos: position{line: 1129, col: 1, offset: 41342},
expr: &choiceExpr{
pos: position{line: 1129, col: 16, offset: 41357},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1129, col: 16, offset: 41357},
name: "TriplePlusPassthrough",
},
&ruleRefExpr{
pos: position{line: 1129, col: 40, offset: 41381},
name: "SinglePlusPassthrough",
},
&ruleRefExpr{
pos: position{line: 1129, col: 64, offset: 41405},
name: "PassthroughMacro",
},
},
},
},
{
name: "SinglePlusPassthroughPrefix",
pos: position{line: 1131, col: 1, offset: 41423},
expr: &litMatcher{
pos: position{line: 1131, col: 32, offset: 41454},
val: "+",
ignoreCase: false,
},
},
{
name: "SinglePlusPassthrough",
pos: position{line: 1133, col: 1, offset: 41459},
expr: &actionExpr{
pos: position{line: 1133, col: 26, offset: 41484},
run: (*parser).callonSinglePlusPassthrough1,
expr: &seqExpr{
pos: position{line: 1133, col: 26, offset: 41484},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 1133, col: 26, offset: 41484},
name: "SinglePlusPassthroughPrefix",
},
&labeledExpr{
pos: position{line: 1133, col: 54, offset: 41512},
label: "content",
expr: &ruleRefExpr{
pos: position{line: 1133, col: 63, offset: 41521},
name: "SinglePlusPassthroughContent",
},
},
&ruleRefExpr{
pos: position{line: 1133, col: 93, offset: 41551},
name: "SinglePlusPassthroughPrefix",
},
¬Expr{
pos: position{line: 1133, col: 121, offset: 41579},
expr: &ruleRefExpr{
pos: position{line: 1133, col: 122, offset: 41580},
name: "Alphanum",
},
},
},
},
},
},
{
name: "SinglePlusPassthroughContent",
pos: position{line: 1137, col: 1, offset: 41679},
expr: &choiceExpr{
pos: position{line: 1137, col: 33, offset: 41711},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 1137, col: 34, offset: 41712},
run: (*parser).callonSinglePlusPassthroughContent2,
expr: &seqExpr{
pos: position{line: 1137, col: 34, offset: 41712},
exprs: []interface{}{
&seqExpr{
pos: position{line: 1137, col: 35, offset: 41713},
exprs: []interface{}{
¬Expr{
pos: position{line: 1137, col: 35, offset: 41713},
expr: &ruleRefExpr{
pos: position{line: 1137, col: 36, offset: 41714},
name: "SinglePlusPassthroughPrefix",
},
},
¬Expr{
pos: position{line: 1137, col: 64, offset: 41742},
expr: &ruleRefExpr{
pos: position{line: 1137, col: 65, offset: 41743},
name: "WS",
},
},
¬Expr{
pos: position{line: 1137, col: 68, offset: 41746},
expr: &ruleRefExpr{
pos: position{line: 1137, col: 69, offset: 41747},
name: "Newline",
},
},
&anyMatcher{
line: 1137, col: 77, offset: 41755,
},
},
},
&zeroOrMoreExpr{
pos: position{line: 1137, col: 80, offset: 41758},
expr: &seqExpr{
pos: position{line: 1137, col: 81, offset: 41759},
exprs: []interface{}{
¬Expr{
pos: position{line: 1137, col: 81, offset: 41759},
expr: &seqExpr{
pos: position{line: 1137, col: 83, offset: 41761},
exprs: []interface{}{
&oneOrMoreExpr{
pos: position{line: 1137, col: 83, offset: 41761},
expr: &ruleRefExpr{
pos: position{line: 1137, col: 83, offset: 41761},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1137, col: 87, offset: 41765},
name: "SinglePlusPassthroughPrefix",
},
},
},
},
¬Expr{
pos: position{line: 1137, col: 116, offset: 41794},
expr: &ruleRefExpr{
pos: position{line: 1137, col: 117, offset: 41795},
name: "SinglePlusPassthroughPrefix",
},
},
¬Expr{
pos: position{line: 1137, col: 145, offset: 41823},
expr: &ruleRefExpr{
pos: position{line: 1137, col: 146, offset: 41824},
name: "Newline",
},
},
&anyMatcher{
line: 1137, col: 154, offset: 41832,
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 1139, col: 7, offset: 41974},
run: (*parser).callonSinglePlusPassthroughContent24,
expr: &seqExpr{
pos: position{line: 1139, col: 8, offset: 41975},
exprs: []interface{}{
¬Expr{
pos: position{line: 1139, col: 8, offset: 41975},
expr: &ruleRefExpr{
pos: position{line: 1139, col: 9, offset: 41976},
name: "WS",
},
},
¬Expr{
pos: position{line: 1139, col: 12, offset: 41979},
expr: &ruleRefExpr{
pos: position{line: 1139, col: 13, offset: 41980},
name: "Newline",
},
},
¬Expr{
pos: position{line: 1139, col: 21, offset: 41988},
expr: &ruleRefExpr{
pos: position{line: 1139, col: 22, offset: 41989},
name: "SinglePlusPassthroughPrefix",
},
},
&anyMatcher{
line: 1139, col: 50, offset: 42017,
},
},
},
},
},
},
},
{
name: "TriplePlusPassthroughPrefix",
pos: position{line: 1143, col: 1, offset: 42099},
expr: &litMatcher{
pos: position{line: 1143, col: 32, offset: 42130},
val: "+++",
ignoreCase: false,
},
},
{
name: "TriplePlusPassthrough",
pos: position{line: 1145, col: 1, offset: 42137},
expr: &actionExpr{
pos: position{line: 1145, col: 26, offset: 42162},
run: (*parser).callonTriplePlusPassthrough1,
expr: &seqExpr{
pos: position{line: 1145, col: 26, offset: 42162},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 1145, col: 26, offset: 42162},
name: "TriplePlusPassthroughPrefix",
},
&labeledExpr{
pos: position{line: 1145, col: 54, offset: 42190},
label: "content",
expr: &ruleRefExpr{
pos: position{line: 1145, col: 63, offset: 42199},
name: "TriplePlusPassthroughContent",
},
},
&ruleRefExpr{
pos: position{line: 1145, col: 93, offset: 42229},
name: "TriplePlusPassthroughPrefix",
},
¬Expr{
pos: position{line: 1145, col: 121, offset: 42257},
expr: &ruleRefExpr{
pos: position{line: 1145, col: 122, offset: 42258},
name: "Alphanum",
},
},
},
},
},
},
{
name: "TriplePlusPassthroughContent",
pos: position{line: 1149, col: 1, offset: 42357},
expr: &choiceExpr{
pos: position{line: 1149, col: 33, offset: 42389},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 1149, col: 34, offset: 42390},
run: (*parser).callonTriplePlusPassthroughContent2,
expr: &zeroOrMoreExpr{
pos: position{line: 1149, col: 34, offset: 42390},
expr: &seqExpr{
pos: position{line: 1149, col: 35, offset: 42391},
exprs: []interface{}{
¬Expr{
pos: position{line: 1149, col: 35, offset: 42391},
expr: &ruleRefExpr{
pos: position{line: 1149, col: 36, offset: 42392},
name: "TriplePlusPassthroughPrefix",
},
},
&anyMatcher{
line: 1149, col: 64, offset: 42420,
},
},
},
},
},
&actionExpr{
pos: position{line: 1151, col: 7, offset: 42585},
run: (*parser).callonTriplePlusPassthroughContent8,
expr: &zeroOrOneExpr{
pos: position{line: 1151, col: 7, offset: 42585},
expr: &seqExpr{
pos: position{line: 1151, col: 8, offset: 42586},
exprs: []interface{}{
¬Expr{
pos: position{line: 1151, col: 8, offset: 42586},
expr: &ruleRefExpr{
pos: position{line: 1151, col: 9, offset: 42587},
name: "WS",
},
},
¬Expr{
pos: position{line: 1151, col: 12, offset: 42590},
expr: &ruleRefExpr{
pos: position{line: 1151, col: 13, offset: 42591},
name: "Newline",
},
},
¬Expr{
pos: position{line: 1151, col: 21, offset: 42599},
expr: &ruleRefExpr{
pos: position{line: 1151, col: 22, offset: 42600},
name: "TriplePlusPassthroughPrefix",
},
},
&anyMatcher{
line: 1151, col: 50, offset: 42628,
},
},
},
},
},
},
},
},
{
name: "PassthroughMacro",
pos: position{line: 1155, col: 1, offset: 42711},
expr: &choiceExpr{
pos: position{line: 1155, col: 21, offset: 42731},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 1155, col: 21, offset: 42731},
run: (*parser).callonPassthroughMacro2,
expr: &seqExpr{
pos: position{line: 1155, col: 21, offset: 42731},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1155, col: 21, offset: 42731},
val: "pass:[",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1155, col: 30, offset: 42740},
label: "content",
expr: &zeroOrMoreExpr{
pos: position{line: 1155, col: 38, offset: 42748},
expr: &ruleRefExpr{
pos: position{line: 1155, col: 39, offset: 42749},
name: "PassthroughMacroCharacter",
},
},
},
&litMatcher{
pos: position{line: 1155, col: 67, offset: 42777},
val: "]",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 1157, col: 5, offset: 42867},
run: (*parser).callonPassthroughMacro9,
expr: &seqExpr{
pos: position{line: 1157, col: 5, offset: 42867},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1157, col: 5, offset: 42867},
val: "pass:q[",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1157, col: 15, offset: 42877},
label: "content",
expr: &zeroOrMoreExpr{
pos: position{line: 1157, col: 23, offset: 42885},
expr: &choiceExpr{
pos: position{line: 1157, col: 24, offset: 42886},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1157, col: 24, offset: 42886},
name: "QuotedText",
},
&ruleRefExpr{
pos: position{line: 1157, col: 37, offset: 42899},
name: "PassthroughMacroCharacter",
},
},
},
},
},
&litMatcher{
pos: position{line: 1157, col: 65, offset: 42927},
val: "]",
ignoreCase: false,
},
},
},
},
},
},
},
{
name: "PassthroughMacroCharacter",
pos: position{line: 1161, col: 1, offset: 43017},
expr: &choiceExpr{
pos: position{line: 1161, col: 31, offset: 43047},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1161, col: 31, offset: 43047},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 1161, col: 43, offset: 43059},
name: "Spaces",
},
&actionExpr{
pos: position{line: 1161, col: 52, offset: 43068},
run: (*parser).callonPassthroughMacroCharacter4,
expr: &seqExpr{
pos: position{line: 1161, col: 53, offset: 43069},
exprs: []interface{}{
¬Expr{
pos: position{line: 1161, col: 53, offset: 43069},
expr: &litMatcher{
pos: position{line: 1161, col: 54, offset: 43070},
val: "]",
ignoreCase: false,
},
},
&anyMatcher{
line: 1161, col: 58, offset: 43074,
},
},
},
},
},
},
},
{
name: "CrossReference",
pos: position{line: 1168, col: 1, offset: 43244},
expr: &choiceExpr{
pos: position{line: 1168, col: 19, offset: 43262},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1168, col: 19, offset: 43262},
name: "InternalCrossReference",
},
&ruleRefExpr{
pos: position{line: 1168, col: 44, offset: 43287},
name: "ExternalCrossReference",
},
},
},
},
{
name: "InternalCrossReference",
pos: position{line: 1170, col: 1, offset: 43312},
expr: &choiceExpr{
pos: position{line: 1170, col: 27, offset: 43338},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 1170, col: 27, offset: 43338},
run: (*parser).callonInternalCrossReference2,
expr: &seqExpr{
pos: position{line: 1170, col: 27, offset: 43338},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1170, col: 27, offset: 43338},
val: "<<",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1170, col: 32, offset: 43343},
label: "id",
expr: &ruleRefExpr{
pos: position{line: 1170, col: 36, offset: 43347},
name: "ID",
},
},
&zeroOrMoreExpr{
pos: position{line: 1170, col: 40, offset: 43351},
expr: &ruleRefExpr{
pos: position{line: 1170, col: 40, offset: 43351},
name: "WS",
},
},
&litMatcher{
pos: position{line: 1170, col: 44, offset: 43355},
val: ",",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1170, col: 48, offset: 43359},
label: "label",
expr: &ruleRefExpr{
pos: position{line: 1170, col: 55, offset: 43366},
name: "CrossReferenceLabel",
},
},
&litMatcher{
pos: position{line: 1170, col: 76, offset: 43387},
val: ">>",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 1172, col: 5, offset: 43470},
run: (*parser).callonInternalCrossReference13,
expr: &seqExpr{
pos: position{line: 1172, col: 5, offset: 43470},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1172, col: 5, offset: 43470},
val: "<<",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1172, col: 10, offset: 43475},
label: "id",
expr: &ruleRefExpr{
pos: position{line: 1172, col: 14, offset: 43479},
name: "ID",
},
},
&litMatcher{
pos: position{line: 1172, col: 18, offset: 43483},
val: ">>",
ignoreCase: false,
},
},
},
},
},
},
},
{
name: "ExternalCrossReference",
pos: position{line: 1176, col: 1, offset: 43555},
expr: &actionExpr{
pos: position{line: 1176, col: 27, offset: 43581},
run: (*parser).callonExternalCrossReference1,
expr: &seqExpr{
pos: position{line: 1176, col: 27, offset: 43581},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1176, col: 27, offset: 43581},
val: "xref:",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1176, col: 35, offset: 43589},
label: "url",
expr: &ruleRefExpr{
pos: position{line: 1176, col: 40, offset: 43594},
name: "FileLocation",
},
},
&labeledExpr{
pos: position{line: 1176, col: 54, offset: 43608},
label: "inlineAttributes",
expr: &ruleRefExpr{
pos: position{line: 1176, col: 72, offset: 43626},
name: "LinkAttributes",
},
},
},
},
},
},
{
name: "CrossReferenceLabel",
pos: position{line: 1180, col: 1, offset: 43756},
expr: &actionExpr{
pos: position{line: 1180, col: 24, offset: 43779},
run: (*parser).callonCrossReferenceLabel1,
expr: &oneOrMoreExpr{
pos: position{line: 1180, col: 24, offset: 43779},
expr: &choiceExpr{
pos: position{line: 1180, col: 25, offset: 43780},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1180, col: 25, offset: 43780},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 1180, col: 37, offset: 43792},
name: "Spaces",
},
&seqExpr{
pos: position{line: 1180, col: 47, offset: 43802},
exprs: []interface{}{
¬Expr{
pos: position{line: 1180, col: 47, offset: 43802},
expr: &litMatcher{
pos: position{line: 1180, col: 48, offset: 43803},
val: ">>",
ignoreCase: false,
},
},
&anyMatcher{
line: 1180, col: 54, offset: 43809,
},
},
},
},
},
},
},
},
{
name: "Link",
pos: position{line: 1187, col: 1, offset: 43951},
expr: &choiceExpr{
pos: position{line: 1187, col: 9, offset: 43959},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1187, col: 9, offset: 43959},
name: "RelativeLink",
},
&ruleRefExpr{
pos: position{line: 1187, col: 24, offset: 43974},
name: "ExternalLink",
},
},
},
},
{
name: "RelativeLink",
pos: position{line: 1190, col: 1, offset: 44055},
expr: &actionExpr{
pos: position{line: 1190, col: 17, offset: 44071},
run: (*parser).callonRelativeLink1,
expr: &seqExpr{
pos: position{line: 1190, col: 17, offset: 44071},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1190, col: 17, offset: 44071},
val: "link:",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1190, col: 25, offset: 44079},
label: "url",
expr: &choiceExpr{
pos: position{line: 1190, col: 30, offset: 44084},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1190, col: 30, offset: 44084},
name: "Location",
},
&ruleRefExpr{
pos: position{line: 1190, col: 41, offset: 44095},
name: "FileLocation",
},
},
},
},
&labeledExpr{
pos: position{line: 1190, col: 55, offset: 44109},
label: "inlineAttributes",
expr: &ruleRefExpr{
pos: position{line: 1190, col: 73, offset: 44127},
name: "LinkAttributes",
},
},
},
},
},
},
{
name: "ExternalLink",
pos: position{line: 1194, col: 1, offset: 44245},
expr: &actionExpr{
pos: position{line: 1194, col: 17, offset: 44261},
run: (*parser).callonExternalLink1,
expr: &seqExpr{
pos: position{line: 1194, col: 17, offset: 44261},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1194, col: 17, offset: 44261},
label: "url",
expr: &ruleRefExpr{
pos: position{line: 1194, col: 22, offset: 44266},
name: "Location",
},
},
&labeledExpr{
pos: position{line: 1194, col: 32, offset: 44276},
label: "inlineAttributes",
expr: &zeroOrOneExpr{
pos: position{line: 1194, col: 49, offset: 44293},
expr: &ruleRefExpr{
pos: position{line: 1194, col: 50, offset: 44294},
name: "LinkAttributes",
},
},
},
},
},
},
},
{
name: "LinkAttributes",
pos: position{line: 1198, col: 1, offset: 44387},
expr: &choiceExpr{
pos: position{line: 1198, col: 19, offset: 44405},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1198, col: 19, offset: 44405},
name: "TextOnlyLinkAttributes",
},
&ruleRefExpr{
pos: position{line: 1198, col: 44, offset: 44430},
name: "TextAndMoreLinkAttributes",
},
},
},
},
{
name: "TextOnlyLinkAttributes",
pos: position{line: 1200, col: 1, offset: 44457},
expr: &actionExpr{
pos: position{line: 1200, col: 27, offset: 44483},
run: (*parser).callonTextOnlyLinkAttributes1,
expr: &seqExpr{
pos: position{line: 1200, col: 27, offset: 44483},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1200, col: 27, offset: 44483},
val: "[",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1200, col: 31, offset: 44487},
label: "text",
expr: &zeroOrOneExpr{
pos: position{line: 1200, col: 36, offset: 44492},
expr: &choiceExpr{
pos: position{line: 1202, col: 5, offset: 44535},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 1202, col: 5, offset: 44535},
run: (*parser).callonTextOnlyLinkAttributes7,
expr: &seqExpr{
pos: position{line: 1202, col: 5, offset: 44535},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1202, col: 5, offset: 44535},
val: "\"",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1202, col: 10, offset: 44540},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 1202, col: 19, offset: 44549},
expr: &seqExpr{
pos: position{line: 1202, col: 20, offset: 44550},
exprs: []interface{}{
¬Expr{
pos: position{line: 1202, col: 20, offset: 44550},
expr: &litMatcher{
pos: position{line: 1202, col: 21, offset: 44551},
val: "\"",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1202, col: 26, offset: 44556},
expr: &litMatcher{
pos: position{line: 1202, col: 27, offset: 44557},
val: "]",
ignoreCase: false,
},
},
&choiceExpr{
pos: position{line: 1202, col: 32, offset: 44562},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1202, col: 32, offset: 44562},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 1202, col: 45, offset: 44575},
name: "Spaces",
},
&ruleRefExpr{
pos: position{line: 1202, col: 54, offset: 44584},
name: "QuotedText",
},
&ruleRefExpr{
pos: position{line: 1202, col: 67, offset: 44597},
name: "AnyChar",
},
},
},
},
},
},
},
&litMatcher{
pos: position{line: 1202, col: 78, offset: 44608},
val: "\"",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 1202, col: 83, offset: 44613},
expr: &ruleRefExpr{
pos: position{line: 1202, col: 83, offset: 44613},
name: "Spaces",
},
},
&andExpr{
pos: position{line: 1202, col: 91, offset: 44621},
expr: ¬Expr{
pos: position{line: 1202, col: 93, offset: 44623},
expr: &litMatcher{
pos: position{line: 1202, col: 94, offset: 44624},
val: "=",
ignoreCase: false,
},
},
},
},
},
},
&actionExpr{
pos: position{line: 1206, col: 5, offset: 44749},
run: (*parser).callonTextOnlyLinkAttributes28,
expr: &seqExpr{
pos: position{line: 1206, col: 5, offset: 44749},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1206, col: 5, offset: 44749},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 1206, col: 14, offset: 44758},
expr: &seqExpr{
pos: position{line: 1206, col: 15, offset: 44759},
exprs: []interface{}{
¬Expr{
pos: position{line: 1206, col: 15, offset: 44759},
expr: &litMatcher{
pos: position{line: 1206, col: 16, offset: 44760},
val: "=",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1206, col: 20, offset: 44764},
expr: &litMatcher{
pos: position{line: 1206, col: 21, offset: 44765},
val: "]",
ignoreCase: false,
},
},
&choiceExpr{
pos: position{line: 1206, col: 26, offset: 44770},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1206, col: 26, offset: 44770},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 1206, col: 39, offset: 44783},
name: "Spaces",
},
&ruleRefExpr{
pos: position{line: 1206, col: 48, offset: 44792},
name: "QuotedText",
},
&ruleRefExpr{
pos: position{line: 1206, col: 61, offset: 44805},
name: "AnyChar",
},
},
},
},
},
},
},
&andExpr{
pos: position{line: 1206, col: 72, offset: 44816},
expr: ¬Expr{
pos: position{line: 1206, col: 74, offset: 44818},
expr: &litMatcher{
pos: position{line: 1206, col: 75, offset: 44819},
val: "=",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
},
&litMatcher{
pos: position{line: 1208, col: 9, offset: 44899},
val: "]",
ignoreCase: false,
},
},
},
},
},
{
name: "TextAndMoreLinkAttributes",
pos: position{line: 1212, col: 1, offset: 44965},
expr: &actionExpr{
pos: position{line: 1212, col: 30, offset: 44994},
run: (*parser).callonTextAndMoreLinkAttributes1,
expr: &seqExpr{
pos: position{line: 1212, col: 30, offset: 44994},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1212, col: 30, offset: 44994},
val: "[",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1212, col: 34, offset: 44998},
label: "text",
expr: &zeroOrOneExpr{
pos: position{line: 1212, col: 39, offset: 45003},
expr: &choiceExpr{
pos: position{line: 1214, col: 5, offset: 45046},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 1214, col: 5, offset: 45046},
run: (*parser).callonTextAndMoreLinkAttributes7,
expr: &seqExpr{
pos: position{line: 1214, col: 5, offset: 45046},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1214, col: 5, offset: 45046},
val: "\"",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1214, col: 10, offset: 45051},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 1214, col: 19, offset: 45060},
expr: &seqExpr{
pos: position{line: 1214, col: 20, offset: 45061},
exprs: []interface{}{
¬Expr{
pos: position{line: 1214, col: 20, offset: 45061},
expr: &litMatcher{
pos: position{line: 1214, col: 21, offset: 45062},
val: "\"",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1214, col: 26, offset: 45067},
expr: &litMatcher{
pos: position{line: 1214, col: 27, offset: 45068},
val: "]",
ignoreCase: false,
},
},
&choiceExpr{
pos: position{line: 1214, col: 32, offset: 45073},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1214, col: 32, offset: 45073},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 1214, col: 45, offset: 45086},
name: "Spaces",
},
&ruleRefExpr{
pos: position{line: 1214, col: 54, offset: 45095},
name: "QuotedText",
},
&ruleRefExpr{
pos: position{line: 1214, col: 67, offset: 45108},
name: "AnyChar",
},
},
},
},
},
},
},
&litMatcher{
pos: position{line: 1214, col: 78, offset: 45119},
val: "\"",
ignoreCase: false,
},
&andExpr{
pos: position{line: 1214, col: 83, offset: 45124},
expr: ¬Expr{
pos: position{line: 1214, col: 85, offset: 45126},
expr: &litMatcher{
pos: position{line: 1214, col: 86, offset: 45127},
val: "=",
ignoreCase: false,
},
},
},
},
},
},
&actionExpr{
pos: position{line: 1218, col: 5, offset: 45252},
run: (*parser).callonTextAndMoreLinkAttributes26,
expr: &seqExpr{
pos: position{line: 1218, col: 5, offset: 45252},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1218, col: 5, offset: 45252},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 1218, col: 14, offset: 45261},
expr: &seqExpr{
pos: position{line: 1218, col: 15, offset: 45262},
exprs: []interface{}{
¬Expr{
pos: position{line: 1218, col: 15, offset: 45262},
expr: &litMatcher{
pos: position{line: 1218, col: 16, offset: 45263},
val: ",",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1218, col: 20, offset: 45267},
expr: &litMatcher{
pos: position{line: 1218, col: 21, offset: 45268},
val: "=",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1218, col: 25, offset: 45272},
expr: &litMatcher{
pos: position{line: 1218, col: 26, offset: 45273},
val: "]",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1218, col: 30, offset: 45277},
expr: &litMatcher{
pos: position{line: 1218, col: 31, offset: 45278},
val: "\"",
ignoreCase: false,
},
},
&choiceExpr{
pos: position{line: 1218, col: 37, offset: 45284},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1218, col: 37, offset: 45284},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 1218, col: 50, offset: 45297},
name: "Spaces",
},
&ruleRefExpr{
pos: position{line: 1218, col: 59, offset: 45306},
name: "QuotedText",
},
&ruleRefExpr{
pos: position{line: 1218, col: 72, offset: 45319},
name: "AnyChar",
},
},
},
},
},
},
},
&andExpr{
pos: position{line: 1218, col: 83, offset: 45330},
expr: ¬Expr{
pos: position{line: 1218, col: 85, offset: 45332},
expr: &litMatcher{
pos: position{line: 1218, col: 86, offset: 45333},
val: "=",
ignoreCase: false,
},
},
},
},
},
},
},
},
},
},
&zeroOrOneExpr{
pos: position{line: 1220, col: 9, offset: 45413},
expr: &litMatcher{
pos: position{line: 1220, col: 9, offset: 45413},
val: ",",
ignoreCase: false,
},
},
&zeroOrMoreExpr{
pos: position{line: 1220, col: 14, offset: 45418},
expr: &ruleRefExpr{
pos: position{line: 1220, col: 14, offset: 45418},
name: "WS",
},
},
&labeledExpr{
pos: position{line: 1220, col: 18, offset: 45422},
label: "otherattrs",
expr: &zeroOrMoreExpr{
pos: position{line: 1220, col: 29, offset: 45433},
expr: &ruleRefExpr{
pos: position{line: 1220, col: 30, offset: 45434},
name: "GenericAttribute",
},
},
},
&litMatcher{
pos: position{line: 1220, col: 49, offset: 45453},
val: "]",
ignoreCase: false,
},
},
},
},
},
{
name: "InlineLinks",
pos: position{line: 1225, col: 1, offset: 45609},
expr: &actionExpr{
pos: position{line: 1226, col: 5, offset: 45629},
run: (*parser).callonInlineLinks1,
expr: &seqExpr{
pos: position{line: 1226, col: 5, offset: 45629},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1226, col: 5, offset: 45629},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 1226, col: 14, offset: 45638},
expr: &choiceExpr{
pos: position{line: 1226, col: 15, offset: 45639},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1226, col: 15, offset: 45639},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 1227, col: 11, offset: 45660},
name: "Spaces",
},
&ruleRefExpr{
pos: position{line: 1228, col: 11, offset: 45678},
name: "ResolvedLink",
},
&ruleRefExpr{
pos: position{line: 1229, col: 11, offset: 45702},
name: "Parenthesis",
},
&ruleRefExpr{
pos: position{line: 1230, col: 11, offset: 45724},
name: "AnyChars",
},
&ruleRefExpr{
pos: position{line: 1231, col: 11, offset: 45743},
name: "AnyChar",
},
&ruleRefExpr{
pos: position{line: 1232, col: 11, offset: 45761},
name: "Newline",
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 1232, col: 21, offset: 45771},
name: "EOF",
},
},
},
},
},
{
name: "ResolvedLink",
pos: position{line: 1236, col: 1, offset: 45841},
expr: &choiceExpr{
pos: position{line: 1236, col: 17, offset: 45857},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1236, col: 17, offset: 45857},
name: "ResolvedRelativeLink",
},
&ruleRefExpr{
pos: position{line: 1236, col: 40, offset: 45880},
name: "ResolvedExternalLink",
},
},
},
},
{
name: "ResolvedRelativeLink",
pos: position{line: 1239, col: 1, offset: 46016},
expr: &actionExpr{
pos: position{line: 1239, col: 25, offset: 46040},
run: (*parser).callonResolvedRelativeLink1,
expr: &seqExpr{
pos: position{line: 1239, col: 25, offset: 46040},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1239, col: 25, offset: 46040},
val: "link:",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1239, col: 33, offset: 46048},
label: "url",
expr: &choiceExpr{
pos: position{line: 1239, col: 38, offset: 46053},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1239, col: 38, offset: 46053},
name: "ResolvedLocation",
},
&ruleRefExpr{
pos: position{line: 1239, col: 57, offset: 46072},
name: "ResolvedFileLocation",
},
},
},
},
&labeledExpr{
pos: position{line: 1239, col: 79, offset: 46094},
label: "inlineAttributes",
expr: &ruleRefExpr{
pos: position{line: 1239, col: 97, offset: 46112},
name: "LinkAttributes",
},
},
},
},
},
},
{
name: "ResolvedExternalLink",
pos: position{line: 1243, col: 1, offset: 46230},
expr: &actionExpr{
pos: position{line: 1243, col: 25, offset: 46254},
run: (*parser).callonResolvedExternalLink1,
expr: &seqExpr{
pos: position{line: 1243, col: 25, offset: 46254},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1243, col: 25, offset: 46254},
label: "url",
expr: &ruleRefExpr{
pos: position{line: 1243, col: 30, offset: 46259},
name: "ResolvedLocation",
},
},
&labeledExpr{
pos: position{line: 1243, col: 48, offset: 46277},
label: "inlineAttributes",
expr: &zeroOrOneExpr{
pos: position{line: 1243, col: 65, offset: 46294},
expr: &ruleRefExpr{
pos: position{line: 1243, col: 66, offset: 46295},
name: "LinkAttributes",
},
},
},
},
},
},
},
{
name: "QuotedLink",
pos: position{line: 1247, col: 1, offset: 46388},
expr: &choiceExpr{
pos: position{line: 1247, col: 15, offset: 46402},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1247, col: 15, offset: 46402},
name: "RelativeLink",
},
&ruleRefExpr{
pos: position{line: 1247, col: 30, offset: 46417},
name: "ExternalQuotedLink",
},
},
},
},
{
name: "ExternalQuotedLink",
pos: position{line: 1249, col: 1, offset: 46437},
expr: &actionExpr{
pos: position{line: 1249, col: 23, offset: 46459},
run: (*parser).callonExternalQuotedLink1,
expr: &seqExpr{
pos: position{line: 1249, col: 23, offset: 46459},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1249, col: 23, offset: 46459},
label: "url",
expr: &ruleRefExpr{
pos: position{line: 1249, col: 28, offset: 46464},
name: "Location",
},
},
&labeledExpr{
pos: position{line: 1249, col: 38, offset: 46474},
label: "inlineAttributes",
expr: &ruleRefExpr{
pos: position{line: 1249, col: 56, offset: 46492},
name: "LinkAttributes",
},
},
},
},
},
},
{
name: "ImageBlock",
pos: position{line: 1256, col: 1, offset: 46827},
expr: &actionExpr{
pos: position{line: 1256, col: 15, offset: 46841},
run: (*parser).callonImageBlock1,
expr: &seqExpr{
pos: position{line: 1256, col: 15, offset: 46841},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1256, col: 15, offset: 46841},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 1256, col: 26, offset: 46852},
expr: &ruleRefExpr{
pos: position{line: 1256, col: 27, offset: 46853},
name: "ElementAttributes",
},
},
},
&litMatcher{
pos: position{line: 1256, col: 47, offset: 46873},
val: "image::",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1256, col: 57, offset: 46883},
label: "path",
expr: &choiceExpr{
pos: position{line: 1256, col: 63, offset: 46889},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1256, col: 63, offset: 46889},
name: "Location",
},
&ruleRefExpr{
pos: position{line: 1256, col: 74, offset: 46900},
name: "FileLocation",
},
},
},
},
&labeledExpr{
pos: position{line: 1256, col: 88, offset: 46914},
label: "inlineAttributes",
expr: &ruleRefExpr{
pos: position{line: 1256, col: 106, offset: 46932},
name: "ImageAttributes",
},
},
&zeroOrMoreExpr{
pos: position{line: 1256, col: 123, offset: 46949},
expr: &ruleRefExpr{
pos: position{line: 1256, col: 123, offset: 46949},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1256, col: 127, offset: 46953},
name: "EOL",
},
},
},
},
},
{
name: "InlineImage",
pos: position{line: 1260, col: 1, offset: 47072},
expr: &actionExpr{
pos: position{line: 1260, col: 16, offset: 47087},
run: (*parser).callonInlineImage1,
expr: &seqExpr{
pos: position{line: 1260, col: 16, offset: 47087},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1260, col: 16, offset: 47087},
val: "image:",
ignoreCase: false,
},
¬Expr{
pos: position{line: 1260, col: 25, offset: 47096},
expr: &litMatcher{
pos: position{line: 1260, col: 26, offset: 47097},
val: ":",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 1260, col: 30, offset: 47101},
label: "path",
expr: &choiceExpr{
pos: position{line: 1260, col: 36, offset: 47107},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1260, col: 36, offset: 47107},
name: "Location",
},
&ruleRefExpr{
pos: position{line: 1260, col: 47, offset: 47118},
name: "FileLocation",
},
},
},
},
&labeledExpr{
pos: position{line: 1260, col: 61, offset: 47132},
label: "inlineAttributes",
expr: &ruleRefExpr{
pos: position{line: 1260, col: 79, offset: 47150},
name: "ImageAttributes",
},
},
},
},
},
},
{
name: "ImageAttributes",
pos: position{line: 1264, col: 1, offset: 47271},
expr: &actionExpr{
pos: position{line: 1264, col: 20, offset: 47290},
run: (*parser).callonImageAttributes1,
expr: &seqExpr{
pos: position{line: 1264, col: 20, offset: 47290},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1264, col: 20, offset: 47290},
val: "[",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1264, col: 24, offset: 47294},
label: "alt",
expr: &zeroOrOneExpr{
pos: position{line: 1264, col: 28, offset: 47298},
expr: &ruleRefExpr{
pos: position{line: 1264, col: 29, offset: 47299},
name: "StandaloneAttributeValue",
},
},
},
&zeroOrOneExpr{
pos: position{line: 1264, col: 56, offset: 47326},
expr: &litMatcher{
pos: position{line: 1264, col: 56, offset: 47326},
val: ",",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 1264, col: 61, offset: 47331},
label: "width",
expr: &zeroOrOneExpr{
pos: position{line: 1264, col: 67, offset: 47337},
expr: &ruleRefExpr{
pos: position{line: 1264, col: 68, offset: 47338},
name: "StandaloneAttributeValue",
},
},
},
&zeroOrOneExpr{
pos: position{line: 1264, col: 95, offset: 47365},
expr: &litMatcher{
pos: position{line: 1264, col: 95, offset: 47365},
val: ",",
ignoreCase: false,
},
},
&labeledExpr{
pos: position{line: 1264, col: 100, offset: 47370},
label: "height",
expr: &zeroOrOneExpr{
pos: position{line: 1264, col: 107, offset: 47377},
expr: &ruleRefExpr{
pos: position{line: 1264, col: 108, offset: 47378},
name: "StandaloneAttributeValue",
},
},
},
&zeroOrOneExpr{
pos: position{line: 1264, col: 135, offset: 47405},
expr: &litMatcher{
pos: position{line: 1264, col: 135, offset: 47405},
val: ",",
ignoreCase: false,
},
},
&zeroOrMoreExpr{
pos: position{line: 1264, col: 140, offset: 47410},
expr: &ruleRefExpr{
pos: position{line: 1264, col: 140, offset: 47410},
name: "WS",
},
},
&labeledExpr{
pos: position{line: 1264, col: 144, offset: 47414},
label: "otherattrs",
expr: &zeroOrMoreExpr{
pos: position{line: 1264, col: 155, offset: 47425},
expr: &ruleRefExpr{
pos: position{line: 1264, col: 156, offset: 47426},
name: "GenericAttribute",
},
},
},
&litMatcher{
pos: position{line: 1264, col: 175, offset: 47445},
val: "]",
ignoreCase: false,
},
},
},
},
},
{
name: "InlineFootnote",
pos: position{line: 1271, col: 1, offset: 47735},
expr: &choiceExpr{
pos: position{line: 1271, col: 19, offset: 47753},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 1271, col: 19, offset: 47753},
run: (*parser).callonInlineFootnote2,
expr: &seqExpr{
pos: position{line: 1271, col: 19, offset: 47753},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1271, col: 19, offset: 47753},
val: "footnote:[",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1271, col: 32, offset: 47766},
label: "content",
expr: &ruleRefExpr{
pos: position{line: 1271, col: 41, offset: 47775},
name: "FootnoteContent",
},
},
&litMatcher{
pos: position{line: 1271, col: 58, offset: 47792},
val: "]",
ignoreCase: false,
},
},
},
},
&actionExpr{
pos: position{line: 1273, col: 5, offset: 47860},
run: (*parser).callonInlineFootnote8,
expr: &seqExpr{
pos: position{line: 1273, col: 5, offset: 47860},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1273, col: 5, offset: 47860},
val: "footnote:",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1273, col: 17, offset: 47872},
label: "ref",
expr: &ruleRefExpr{
pos: position{line: 1273, col: 22, offset: 47877},
name: "FootnoteRef",
},
},
&litMatcher{
pos: position{line: 1273, col: 35, offset: 47890},
val: "[",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1273, col: 39, offset: 47894},
label: "content",
expr: &zeroOrOneExpr{
pos: position{line: 1273, col: 47, offset: 47902},
expr: &ruleRefExpr{
pos: position{line: 1273, col: 48, offset: 47903},
name: "FootnoteContent",
},
},
},
&litMatcher{
pos: position{line: 1273, col: 66, offset: 47921},
val: "]",
ignoreCase: false,
},
},
},
},
},
},
},
{
name: "FootnoteRef",
pos: position{line: 1277, col: 1, offset: 47982},
expr: &actionExpr{
pos: position{line: 1277, col: 16, offset: 47997},
run: (*parser).callonFootnoteRef1,
expr: &ruleRefExpr{
pos: position{line: 1277, col: 16, offset: 47997},
name: "Alphanums",
},
},
},
{
name: "FootnoteContent",
pos: position{line: 1281, col: 1, offset: 48044},
expr: &actionExpr{
pos: position{line: 1281, col: 20, offset: 48063},
run: (*parser).callonFootnoteContent1,
expr: &labeledExpr{
pos: position{line: 1281, col: 20, offset: 48063},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 1281, col: 29, offset: 48072},
expr: &seqExpr{
pos: position{line: 1281, col: 30, offset: 48073},
exprs: []interface{}{
¬Expr{
pos: position{line: 1281, col: 30, offset: 48073},
expr: &litMatcher{
pos: position{line: 1281, col: 31, offset: 48074},
val: "]",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1281, col: 35, offset: 48078},
expr: &ruleRefExpr{
pos: position{line: 1281, col: 36, offset: 48079},
name: "EOL",
},
},
&zeroOrMoreExpr{
pos: position{line: 1281, col: 40, offset: 48083},
expr: &ruleRefExpr{
pos: position{line: 1281, col: 40, offset: 48083},
name: "WS",
},
},
¬Expr{
pos: position{line: 1281, col: 44, offset: 48087},
expr: &ruleRefExpr{
pos: position{line: 1281, col: 45, offset: 48088},
name: "InlineElementID",
},
},
&ruleRefExpr{
pos: position{line: 1281, col: 61, offset: 48104},
name: "InlineElement",
},
&zeroOrMoreExpr{
pos: position{line: 1281, col: 75, offset: 48118},
expr: &ruleRefExpr{
pos: position{line: 1281, col: 75, offset: 48118},
name: "WS",
},
},
},
},
},
},
},
},
{
name: "DelimitedBlock",
pos: position{line: 1288, col: 1, offset: 48432},
expr: &actionExpr{
pos: position{line: 1288, col: 19, offset: 48450},
run: (*parser).callonDelimitedBlock1,
expr: &seqExpr{
pos: position{line: 1288, col: 19, offset: 48450},
exprs: []interface{}{
¬Expr{
pos: position{line: 1288, col: 19, offset: 48450},
expr: &ruleRefExpr{
pos: position{line: 1288, col: 20, offset: 48451},
name: "Alphanum",
},
},
&labeledExpr{
pos: position{line: 1289, col: 5, offset: 48480},
label: "block",
expr: &choiceExpr{
pos: position{line: 1289, col: 12, offset: 48487},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1289, col: 12, offset: 48487},
name: "FencedBlock",
},
&ruleRefExpr{
pos: position{line: 1290, col: 11, offset: 48510},
name: "ListingBlock",
},
&ruleRefExpr{
pos: position{line: 1291, col: 11, offset: 48534},
name: "ExampleBlock",
},
&ruleRefExpr{
pos: position{line: 1292, col: 11, offset: 48558},
name: "VerseBlock",
},
&ruleRefExpr{
pos: position{line: 1293, col: 11, offset: 48580},
name: "QuoteBlock",
},
&ruleRefExpr{
pos: position{line: 1294, col: 11, offset: 48602},
name: "SidebarBlock",
},
&ruleRefExpr{
pos: position{line: 1295, col: 11, offset: 48625},
name: "SingleLineComment",
},
&ruleRefExpr{
pos: position{line: 1296, col: 11, offset: 48653},
name: "Table",
},
&ruleRefExpr{
pos: position{line: 1297, col: 11, offset: 48669},
name: "CommentBlock",
},
},
},
},
},
},
},
},
{
name: "BlockDelimiter",
pos: position{line: 1301, col: 1, offset: 48710},
expr: &choiceExpr{
pos: position{line: 1301, col: 19, offset: 48728},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1301, col: 19, offset: 48728},
name: "LiteralBlockDelimiter",
},
&ruleRefExpr{
pos: position{line: 1302, col: 19, offset: 48769},
name: "FencedBlockDelimiter",
},
&ruleRefExpr{
pos: position{line: 1303, col: 19, offset: 48809},
name: "ListingBlockDelimiter",
},
&ruleRefExpr{
pos: position{line: 1304, col: 19, offset: 48850},
name: "ExampleBlockDelimiter",
},
&ruleRefExpr{
pos: position{line: 1305, col: 19, offset: 48891},
name: "CommentBlockDelimiter",
},
&ruleRefExpr{
pos: position{line: 1306, col: 19, offset: 48932},
name: "QuoteBlockDelimiter",
},
&ruleRefExpr{
pos: position{line: 1307, col: 19, offset: 48970},
name: "SidebarBlockDelimiter",
},
},
},
},
{
name: "FencedBlockDelimiter",
pos: position{line: 1313, col: 1, offset: 49189},
expr: &seqExpr{
pos: position{line: 1313, col: 25, offset: 49213},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1313, col: 25, offset: 49213},
val: "```",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 1313, col: 31, offset: 49219},
expr: &ruleRefExpr{
pos: position{line: 1313, col: 31, offset: 49219},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1313, col: 35, offset: 49223},
name: "EOL",
},
},
},
},
{
name: "FencedBlock",
pos: position{line: 1315, col: 1, offset: 49228},
expr: &actionExpr{
pos: position{line: 1315, col: 16, offset: 49243},
run: (*parser).callonFencedBlock1,
expr: &seqExpr{
pos: position{line: 1315, col: 16, offset: 49243},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1315, col: 16, offset: 49243},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 1315, col: 27, offset: 49254},
expr: &ruleRefExpr{
pos: position{line: 1315, col: 28, offset: 49255},
name: "ElementAttributes",
},
},
},
&ruleRefExpr{
pos: position{line: 1315, col: 48, offset: 49275},
name: "FencedBlockDelimiter",
},
&labeledExpr{
pos: position{line: 1315, col: 69, offset: 49296},
label: "content",
expr: &zeroOrMoreExpr{
pos: position{line: 1315, col: 77, offset: 49304},
expr: &ruleRefExpr{
pos: position{line: 1315, col: 78, offset: 49305},
name: "FencedBlockContent",
},
},
},
&choiceExpr{
pos: position{line: 1315, col: 100, offset: 49327},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1315, col: 100, offset: 49327},
name: "FencedBlockDelimiter",
},
&ruleRefExpr{
pos: position{line: 1315, col: 123, offset: 49350},
name: "EOF",
},
},
},
},
},
},
},
{
name: "FencedBlockContent",
pos: position{line: 1319, col: 1, offset: 49458},
expr: &choiceExpr{
pos: position{line: 1319, col: 23, offset: 49480},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1319, col: 23, offset: 49480},
name: "BlankLine",
},
&ruleRefExpr{
pos: position{line: 1319, col: 35, offset: 49492},
name: "FileInclusion",
},
&ruleRefExpr{
pos: position{line: 1319, col: 51, offset: 49508},
name: "ListItem",
},
&ruleRefExpr{
pos: position{line: 1319, col: 62, offset: 49519},
name: "FencedBlockParagraph",
},
},
},
},
{
name: "FencedBlockParagraph",
pos: position{line: 1322, col: 1, offset: 49559},
expr: &actionExpr{
pos: position{line: 1322, col: 25, offset: 49583},
run: (*parser).callonFencedBlockParagraph1,
expr: &labeledExpr{
pos: position{line: 1322, col: 25, offset: 49583},
label: "lines",
expr: &oneOrMoreExpr{
pos: position{line: 1322, col: 31, offset: 49589},
expr: &ruleRefExpr{
pos: position{line: 1322, col: 32, offset: 49590},
name: "FencedBlockParagraphLine",
},
},
},
},
},
{
name: "FencedBlockParagraphLine",
pos: position{line: 1326, col: 1, offset: 49703},
expr: &actionExpr{
pos: position{line: 1326, col: 29, offset: 49731},
run: (*parser).callonFencedBlockParagraphLine1,
expr: &seqExpr{
pos: position{line: 1326, col: 29, offset: 49731},
exprs: []interface{}{
¬Expr{
pos: position{line: 1326, col: 29, offset: 49731},
expr: &ruleRefExpr{
pos: position{line: 1326, col: 30, offset: 49732},
name: "FencedBlockDelimiter",
},
},
¬Expr{
pos: position{line: 1326, col: 51, offset: 49753},
expr: &ruleRefExpr{
pos: position{line: 1326, col: 52, offset: 49754},
name: "BlankLine",
},
},
&labeledExpr{
pos: position{line: 1326, col: 62, offset: 49764},
label: "line",
expr: &ruleRefExpr{
pos: position{line: 1326, col: 68, offset: 49770},
name: "InlineElements",
},
},
},
},
},
},
{
name: "ListingBlockDelimiter",
pos: position{line: 1333, col: 1, offset: 50008},
expr: &seqExpr{
pos: position{line: 1333, col: 26, offset: 50033},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1333, col: 26, offset: 50033},
val: "----",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 1333, col: 33, offset: 50040},
expr: &ruleRefExpr{
pos: position{line: 1333, col: 33, offset: 50040},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1333, col: 37, offset: 50044},
name: "EOL",
},
},
},
},
{
name: "ListingBlock",
pos: position{line: 1335, col: 1, offset: 50049},
expr: &actionExpr{
pos: position{line: 1335, col: 17, offset: 50065},
run: (*parser).callonListingBlock1,
expr: &seqExpr{
pos: position{line: 1335, col: 17, offset: 50065},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1335, col: 17, offset: 50065},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 1335, col: 28, offset: 50076},
expr: &ruleRefExpr{
pos: position{line: 1335, col: 29, offset: 50077},
name: "ElementAttributes",
},
},
},
&ruleRefExpr{
pos: position{line: 1335, col: 49, offset: 50097},
name: "ListingBlockDelimiter",
},
&labeledExpr{
pos: position{line: 1335, col: 71, offset: 50119},
label: "content",
expr: &zeroOrMoreExpr{
pos: position{line: 1335, col: 79, offset: 50127},
expr: &ruleRefExpr{
pos: position{line: 1335, col: 80, offset: 50128},
name: "ListingBlockElement",
},
},
},
&choiceExpr{
pos: position{line: 1335, col: 103, offset: 50151},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1335, col: 103, offset: 50151},
name: "ListingBlockDelimiter",
},
&ruleRefExpr{
pos: position{line: 1335, col: 127, offset: 50175},
name: "EOF",
},
},
},
},
},
},
},
{
name: "ListingBlockElement",
pos: position{line: 1339, col: 1, offset: 50284},
expr: &choiceExpr{
pos: position{line: 1339, col: 24, offset: 50307},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1339, col: 24, offset: 50307},
name: "FileInclusion",
},
&ruleRefExpr{
pos: position{line: 1339, col: 40, offset: 50323},
name: "ListingBlockParagraph",
},
&ruleRefExpr{
pos: position{line: 1339, col: 64, offset: 50347},
name: "BlankLine",
},
},
},
},
{
name: "ListingBlockParagraph",
pos: position{line: 1341, col: 1, offset: 50358},
expr: &actionExpr{
pos: position{line: 1341, col: 26, offset: 50383},
run: (*parser).callonListingBlockParagraph1,
expr: &labeledExpr{
pos: position{line: 1341, col: 26, offset: 50383},
label: "lines",
expr: &oneOrMoreExpr{
pos: position{line: 1341, col: 32, offset: 50389},
expr: &ruleRefExpr{
pos: position{line: 1341, col: 33, offset: 50390},
name: "ListingBlockParagraphLine",
},
},
},
},
},
{
name: "ListingBlockParagraphLine",
pos: position{line: 1345, col: 1, offset: 50509},
expr: &actionExpr{
pos: position{line: 1345, col: 30, offset: 50538},
run: (*parser).callonListingBlockParagraphLine1,
expr: &seqExpr{
pos: position{line: 1345, col: 30, offset: 50538},
exprs: []interface{}{
¬Expr{
pos: position{line: 1345, col: 30, offset: 50538},
expr: &ruleRefExpr{
pos: position{line: 1345, col: 31, offset: 50539},
name: "ListingBlockDelimiter",
},
},
&labeledExpr{
pos: position{line: 1345, col: 53, offset: 50561},
label: "line",
expr: &actionExpr{
pos: position{line: 1345, col: 59, offset: 50567},
run: (*parser).callonListingBlockParagraphLine6,
expr: &seqExpr{
pos: position{line: 1345, col: 59, offset: 50567},
exprs: []interface{}{
¬Expr{
pos: position{line: 1345, col: 59, offset: 50567},
expr: &ruleRefExpr{
pos: position{line: 1345, col: 60, offset: 50568},
name: "EOF",
},
},
&oneOrMoreExpr{
pos: position{line: 1345, col: 64, offset: 50572},
expr: &choiceExpr{
pos: position{line: 1345, col: 65, offset: 50573},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1345, col: 65, offset: 50573},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 1345, col: 77, offset: 50585},
name: "Spaces",
},
&seqExpr{
pos: position{line: 1345, col: 87, offset: 50595},
exprs: []interface{}{
¬Expr{
pos: position{line: 1345, col: 87, offset: 50595},
expr: &ruleRefExpr{
pos: position{line: 1345, col: 88, offset: 50596},
name: "EOL",
},
},
&anyMatcher{
line: 1345, col: 92, offset: 50600,
},
},
},
},
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 1345, col: 128, offset: 50636},
name: "EOL",
},
},
},
},
},
{
name: "ExampleBlockDelimiter",
pos: position{line: 1352, col: 1, offset: 50962},
expr: &seqExpr{
pos: position{line: 1352, col: 26, offset: 50987},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1352, col: 26, offset: 50987},
val: "====",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 1352, col: 33, offset: 50994},
expr: &ruleRefExpr{
pos: position{line: 1352, col: 33, offset: 50994},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1352, col: 37, offset: 50998},
name: "EOL",
},
},
},
},
{
name: "ExampleBlock",
pos: position{line: 1354, col: 1, offset: 51003},
expr: &actionExpr{
pos: position{line: 1354, col: 17, offset: 51019},
run: (*parser).callonExampleBlock1,
expr: &seqExpr{
pos: position{line: 1354, col: 17, offset: 51019},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1354, col: 17, offset: 51019},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 1354, col: 28, offset: 51030},
expr: &ruleRefExpr{
pos: position{line: 1354, col: 29, offset: 51031},
name: "ElementAttributes",
},
},
},
&ruleRefExpr{
pos: position{line: 1354, col: 49, offset: 51051},
name: "ExampleBlockDelimiter",
},
&labeledExpr{
pos: position{line: 1354, col: 71, offset: 51073},
label: "content",
expr: &zeroOrMoreExpr{
pos: position{line: 1354, col: 79, offset: 51081},
expr: &choiceExpr{
pos: position{line: 1354, col: 80, offset: 51082},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1354, col: 80, offset: 51082},
name: "BlankLine",
},
&ruleRefExpr{
pos: position{line: 1354, col: 92, offset: 51094},
name: "FileInclusion",
},
&ruleRefExpr{
pos: position{line: 1354, col: 108, offset: 51110},
name: "ListItem",
},
&ruleRefExpr{
pos: position{line: 1354, col: 119, offset: 51121},
name: "ExampleBlockParagraph",
},
},
},
},
},
&choiceExpr{
pos: position{line: 1354, col: 145, offset: 51147},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1354, col: 145, offset: 51147},
name: "ExampleBlockDelimiter",
},
&ruleRefExpr{
pos: position{line: 1354, col: 169, offset: 51171},
name: "EOF",
},
},
},
},
},
},
},
{
name: "ExampleBlockParagraph",
pos: position{line: 1359, col: 1, offset: 51298},
expr: &actionExpr{
pos: position{line: 1359, col: 26, offset: 51323},
run: (*parser).callonExampleBlockParagraph1,
expr: &labeledExpr{
pos: position{line: 1359, col: 26, offset: 51323},
label: "lines",
expr: &oneOrMoreExpr{
pos: position{line: 1359, col: 32, offset: 51329},
expr: &ruleRefExpr{
pos: position{line: 1359, col: 33, offset: 51330},
name: "ExampleBlockParagraphLine",
},
},
},
},
},
{
name: "ExampleBlockParagraphLine",
pos: position{line: 1363, col: 1, offset: 51444},
expr: &actionExpr{
pos: position{line: 1363, col: 30, offset: 51473},
run: (*parser).callonExampleBlockParagraphLine1,
expr: &seqExpr{
pos: position{line: 1363, col: 30, offset: 51473},
exprs: []interface{}{
¬Expr{
pos: position{line: 1363, col: 30, offset: 51473},
expr: &ruleRefExpr{
pos: position{line: 1363, col: 31, offset: 51474},
name: "ExampleBlockDelimiter",
},
},
¬Expr{
pos: position{line: 1363, col: 53, offset: 51496},
expr: &ruleRefExpr{
pos: position{line: 1363, col: 54, offset: 51497},
name: "BlankLine",
},
},
&labeledExpr{
pos: position{line: 1363, col: 64, offset: 51507},
label: "line",
expr: &ruleRefExpr{
pos: position{line: 1363, col: 70, offset: 51513},
name: "InlineElements",
},
},
},
},
},
},
{
name: "QuoteBlockDelimiter",
pos: position{line: 1370, col: 1, offset: 51749},
expr: &seqExpr{
pos: position{line: 1370, col: 24, offset: 51772},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1370, col: 24, offset: 51772},
val: "____",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 1370, col: 31, offset: 51779},
expr: &ruleRefExpr{
pos: position{line: 1370, col: 31, offset: 51779},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1370, col: 35, offset: 51783},
name: "EOL",
},
},
},
},
{
name: "QuoteBlock",
pos: position{line: 1372, col: 1, offset: 51813},
expr: &actionExpr{
pos: position{line: 1372, col: 15, offset: 51827},
run: (*parser).callonQuoteBlock1,
expr: &seqExpr{
pos: position{line: 1372, col: 15, offset: 51827},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1372, col: 15, offset: 51827},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 1372, col: 26, offset: 51838},
expr: &ruleRefExpr{
pos: position{line: 1372, col: 27, offset: 51839},
name: "ElementAttributes",
},
},
},
&ruleRefExpr{
pos: position{line: 1372, col: 47, offset: 51859},
name: "QuoteBlockDelimiter",
},
&labeledExpr{
pos: position{line: 1372, col: 67, offset: 51879},
label: "content",
expr: &zeroOrMoreExpr{
pos: position{line: 1372, col: 75, offset: 51887},
expr: &ruleRefExpr{
pos: position{line: 1372, col: 76, offset: 51888},
name: "QuoteBlockElement",
},
},
},
&choiceExpr{
pos: position{line: 1372, col: 97, offset: 51909},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1372, col: 97, offset: 51909},
name: "QuoteBlockDelimiter",
},
&ruleRefExpr{
pos: position{line: 1372, col: 119, offset: 51931},
name: "EOF",
},
},
},
},
},
},
},
{
name: "QuoteBlockElement",
pos: position{line: 1376, col: 1, offset: 52038},
expr: &actionExpr{
pos: position{line: 1377, col: 5, offset: 52064},
run: (*parser).callonQuoteBlockElement1,
expr: &seqExpr{
pos: position{line: 1377, col: 5, offset: 52064},
exprs: []interface{}{
¬Expr{
pos: position{line: 1377, col: 5, offset: 52064},
expr: &ruleRefExpr{
pos: position{line: 1377, col: 6, offset: 52065},
name: "QuoteBlockDelimiter",
},
},
¬Expr{
pos: position{line: 1377, col: 26, offset: 52085},
expr: &ruleRefExpr{
pos: position{line: 1377, col: 27, offset: 52086},
name: "EOF",
},
},
&labeledExpr{
pos: position{line: 1377, col: 31, offset: 52090},
label: "element",
expr: &choiceExpr{
pos: position{line: 1377, col: 40, offset: 52099},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1377, col: 40, offset: 52099},
name: "BlankLine",
},
&ruleRefExpr{
pos: position{line: 1378, col: 15, offset: 52124},
name: "FileInclusion",
},
&ruleRefExpr{
pos: position{line: 1379, col: 15, offset: 52152},
name: "ImageBlock",
},
&ruleRefExpr{
pos: position{line: 1380, col: 15, offset: 52178},
name: "ListItem",
},
&ruleRefExpr{
pos: position{line: 1381, col: 15, offset: 52201},
name: "FencedBlock",
},
&ruleRefExpr{
pos: position{line: 1382, col: 15, offset: 52227},
name: "ListingBlock",
},
&ruleRefExpr{
pos: position{line: 1383, col: 15, offset: 52254},
name: "ExampleBlock",
},
&ruleRefExpr{
pos: position{line: 1384, col: 15, offset: 52281},
name: "CommentBlock",
},
&ruleRefExpr{
pos: position{line: 1385, col: 15, offset: 52308},
name: "SingleLineComment",
},
&ruleRefExpr{
pos: position{line: 1386, col: 15, offset: 52340},
name: "QuoteBlock",
},
&ruleRefExpr{
pos: position{line: 1387, col: 15, offset: 52366},
name: "SidebarBlock",
},
&ruleRefExpr{
pos: position{line: 1388, col: 15, offset: 52393},
name: "Table",
},
&ruleRefExpr{
pos: position{line: 1389, col: 15, offset: 52414},
name: "LiteralBlock",
},
&ruleRefExpr{
pos: position{line: 1390, col: 15, offset: 52442},
name: "DocumentAttributeDeclaration",
},
&ruleRefExpr{
pos: position{line: 1391, col: 15, offset: 52486},
name: "DocumentAttributeReset",
},
&ruleRefExpr{
pos: position{line: 1392, col: 15, offset: 52524},
name: "TableOfContentsPlaceHolder",
},
&ruleRefExpr{
pos: position{line: 1393, col: 15, offset: 52565},
name: "QuoteBlockParagraph",
},
},
},
},
},
},
},
},
{
name: "QuoteBlockParagraph",
pos: position{line: 1397, col: 1, offset: 52624},
expr: &actionExpr{
pos: position{line: 1397, col: 24, offset: 52647},
run: (*parser).callonQuoteBlockParagraph1,
expr: &labeledExpr{
pos: position{line: 1397, col: 24, offset: 52647},
label: "lines",
expr: &oneOrMoreExpr{
pos: position{line: 1397, col: 30, offset: 52653},
expr: &ruleRefExpr{
pos: position{line: 1397, col: 31, offset: 52654},
name: "InlineElements",
},
},
},
},
},
{
name: "VerseBlock",
pos: position{line: 1406, col: 1, offset: 53000},
expr: &actionExpr{
pos: position{line: 1406, col: 15, offset: 53014},
run: (*parser).callonVerseBlock1,
expr: &seqExpr{
pos: position{line: 1406, col: 15, offset: 53014},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1406, col: 15, offset: 53014},
label: "attributes",
expr: &ruleRefExpr{
pos: position{line: 1406, col: 27, offset: 53026},
name: "ElementAttributes",
},
},
&andCodeExpr{
pos: position{line: 1407, col: 5, offset: 53050},
run: (*parser).callonVerseBlock5,
},
&ruleRefExpr{
pos: position{line: 1411, col: 5, offset: 53236},
name: "QuoteBlockDelimiter",
},
&labeledExpr{
pos: position{line: 1411, col: 25, offset: 53256},
label: "content",
expr: &zeroOrMoreExpr{
pos: position{line: 1411, col: 33, offset: 53264},
expr: &ruleRefExpr{
pos: position{line: 1411, col: 34, offset: 53265},
name: "VerseBlockElement",
},
},
},
&choiceExpr{
pos: position{line: 1411, col: 55, offset: 53286},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1411, col: 55, offset: 53286},
name: "QuoteBlockDelimiter",
},
&ruleRefExpr{
pos: position{line: 1411, col: 77, offset: 53308},
name: "EOF",
},
},
},
},
},
},
},
{
name: "VerseBlockElement",
pos: position{line: 1415, col: 1, offset: 53423},
expr: &choiceExpr{
pos: position{line: 1415, col: 22, offset: 53444},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1415, col: 22, offset: 53444},
name: "VerseFileInclude",
},
&ruleRefExpr{
pos: position{line: 1415, col: 41, offset: 53463},
name: "BlankLine",
},
&ruleRefExpr{
pos: position{line: 1415, col: 53, offset: 53475},
name: "VerseBlockParagraph",
},
},
},
},
{
name: "VerseFileInclude",
pos: position{line: 1417, col: 1, offset: 53496},
expr: &actionExpr{
pos: position{line: 1417, col: 21, offset: 53516},
run: (*parser).callonVerseFileInclude1,
expr: &seqExpr{
pos: position{line: 1417, col: 21, offset: 53516},
exprs: []interface{}{
¬Expr{
pos: position{line: 1417, col: 21, offset: 53516},
expr: &ruleRefExpr{
pos: position{line: 1417, col: 22, offset: 53517},
name: "QuoteBlockDelimiter",
},
},
&labeledExpr{
pos: position{line: 1417, col: 42, offset: 53537},
label: "include",
expr: &ruleRefExpr{
pos: position{line: 1417, col: 51, offset: 53546},
name: "FileInclusion",
},
},
},
},
},
},
{
name: "VerseBlockParagraph",
pos: position{line: 1422, col: 1, offset: 53608},
expr: &actionExpr{
pos: position{line: 1422, col: 24, offset: 53631},
run: (*parser).callonVerseBlockParagraph1,
expr: &labeledExpr{
pos: position{line: 1422, col: 24, offset: 53631},
label: "lines",
expr: &oneOrMoreExpr{
pos: position{line: 1422, col: 30, offset: 53637},
expr: &ruleRefExpr{
pos: position{line: 1422, col: 31, offset: 53638},
name: "VerseBlockParagraphLine",
},
},
},
},
},
{
name: "VerseBlockParagraphLine",
pos: position{line: 1426, col: 1, offset: 53728},
expr: &actionExpr{
pos: position{line: 1426, col: 28, offset: 53755},
run: (*parser).callonVerseBlockParagraphLine1,
expr: &seqExpr{
pos: position{line: 1426, col: 28, offset: 53755},
exprs: []interface{}{
¬Expr{
pos: position{line: 1426, col: 28, offset: 53755},
expr: &ruleRefExpr{
pos: position{line: 1426, col: 29, offset: 53756},
name: "QuoteBlockDelimiter",
},
},
¬Expr{
pos: position{line: 1426, col: 49, offset: 53776},
expr: &ruleRefExpr{
pos: position{line: 1426, col: 50, offset: 53777},
name: "BlankLine",
},
},
&labeledExpr{
pos: position{line: 1426, col: 60, offset: 53787},
label: "line",
expr: &actionExpr{
pos: position{line: 1426, col: 66, offset: 53793},
run: (*parser).callonVerseBlockParagraphLine8,
expr: &seqExpr{
pos: position{line: 1426, col: 66, offset: 53793},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1426, col: 66, offset: 53793},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 1426, col: 75, offset: 53802},
expr: &ruleRefExpr{
pos: position{line: 1426, col: 76, offset: 53803},
name: "VerseBlockParagraphLineElement",
},
},
},
&ruleRefExpr{
pos: position{line: 1426, col: 109, offset: 53836},
name: "EOL",
},
},
},
},
},
},
},
},
},
{
name: "VerseBlockParagraphLineElement",
pos: position{line: 1432, col: 1, offset: 53932},
expr: &actionExpr{
pos: position{line: 1432, col: 35, offset: 53966},
run: (*parser).callonVerseBlockParagraphLineElement1,
expr: &seqExpr{
pos: position{line: 1432, col: 35, offset: 53966},
exprs: []interface{}{
¬Expr{
pos: position{line: 1432, col: 35, offset: 53966},
expr: &ruleRefExpr{
pos: position{line: 1432, col: 36, offset: 53967},
name: "EOL",
},
},
¬Expr{
pos: position{line: 1432, col: 40, offset: 53971},
expr: &ruleRefExpr{
pos: position{line: 1432, col: 41, offset: 53972},
name: "LineBreak",
},
},
&labeledExpr{
pos: position{line: 1433, col: 5, offset: 53987},
label: "element",
expr: &choiceExpr{
pos: position{line: 1433, col: 14, offset: 53996},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1433, col: 14, offset: 53996},
name: "Spaces",
},
&ruleRefExpr{
pos: position{line: 1434, col: 11, offset: 54014},
name: "InlineImage",
},
&ruleRefExpr{
pos: position{line: 1435, col: 11, offset: 54037},
name: "Link",
},
&ruleRefExpr{
pos: position{line: 1436, col: 11, offset: 54053},
name: "Passthrough",
},
&ruleRefExpr{
pos: position{line: 1437, col: 11, offset: 54076},
name: "InlineFootnote",
},
&ruleRefExpr{
pos: position{line: 1438, col: 11, offset: 54102},
name: "QuotedText",
},
&ruleRefExpr{
pos: position{line: 1439, col: 11, offset: 54124},
name: "CrossReference",
},
&ruleRefExpr{
pos: position{line: 1440, col: 11, offset: 54150},
name: "InlineUserMacro",
},
&ruleRefExpr{
pos: position{line: 1441, col: 11, offset: 54177},
name: "DocumentAttributeSubstitution",
},
&ruleRefExpr{
pos: position{line: 1442, col: 11, offset: 54218},
name: "InlineElementID",
},
&ruleRefExpr{
pos: position{line: 1443, col: 11, offset: 54245},
name: "Parenthesis",
},
&ruleRefExpr{
pos: position{line: 1444, col: 11, offset: 54267},
name: "AnyChars",
},
&ruleRefExpr{
pos: position{line: 1445, col: 11, offset: 54286},
name: "AnyChar",
},
},
},
},
},
},
},
},
{
name: "SidebarBlockDelimiter",
pos: position{line: 1452, col: 1, offset: 54515},
expr: &seqExpr{
pos: position{line: 1452, col: 26, offset: 54540},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1452, col: 26, offset: 54540},
val: "****",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 1452, col: 33, offset: 54547},
expr: &ruleRefExpr{
pos: position{line: 1452, col: 33, offset: 54547},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1452, col: 37, offset: 54551},
name: "EOL",
},
},
},
},
{
name: "SidebarBlock",
pos: position{line: 1454, col: 1, offset: 54556},
expr: &actionExpr{
pos: position{line: 1454, col: 17, offset: 54572},
run: (*parser).callonSidebarBlock1,
expr: &seqExpr{
pos: position{line: 1454, col: 17, offset: 54572},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1454, col: 17, offset: 54572},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 1454, col: 28, offset: 54583},
expr: &ruleRefExpr{
pos: position{line: 1454, col: 29, offset: 54584},
name: "ElementAttributes",
},
},
},
&ruleRefExpr{
pos: position{line: 1454, col: 49, offset: 54604},
name: "SidebarBlockDelimiter",
},
&labeledExpr{
pos: position{line: 1454, col: 71, offset: 54626},
label: "content",
expr: &zeroOrMoreExpr{
pos: position{line: 1454, col: 79, offset: 54634},
expr: &ruleRefExpr{
pos: position{line: 1454, col: 80, offset: 54635},
name: "SidebarBlockContent",
},
},
},
&choiceExpr{
pos: position{line: 1454, col: 104, offset: 54659},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1454, col: 104, offset: 54659},
name: "SidebarBlockDelimiter",
},
&ruleRefExpr{
pos: position{line: 1454, col: 128, offset: 54683},
name: "EOF",
},
},
},
},
},
},
},
{
name: "SidebarBlockContent",
pos: position{line: 1458, col: 1, offset: 54792},
expr: &choiceExpr{
pos: position{line: 1458, col: 24, offset: 54815},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1458, col: 24, offset: 54815},
name: "BlankLine",
},
&ruleRefExpr{
pos: position{line: 1458, col: 36, offset: 54827},
name: "FileInclusion",
},
&ruleRefExpr{
pos: position{line: 1458, col: 52, offset: 54843},
name: "ListItem",
},
&ruleRefExpr{
pos: position{line: 1458, col: 63, offset: 54854},
name: "NonSidebarBlock",
},
&ruleRefExpr{
pos: position{line: 1458, col: 81, offset: 54872},
name: "SidebarBlockParagraph",
},
},
},
},
{
name: "NonSidebarBlock",
pos: position{line: 1460, col: 1, offset: 54895},
expr: &actionExpr{
pos: position{line: 1460, col: 20, offset: 54914},
run: (*parser).callonNonSidebarBlock1,
expr: &seqExpr{
pos: position{line: 1460, col: 20, offset: 54914},
exprs: []interface{}{
¬Expr{
pos: position{line: 1460, col: 20, offset: 54914},
expr: &ruleRefExpr{
pos: position{line: 1460, col: 21, offset: 54915},
name: "SidebarBlock",
},
},
&labeledExpr{
pos: position{line: 1460, col: 34, offset: 54928},
label: "content",
expr: &ruleRefExpr{
pos: position{line: 1460, col: 43, offset: 54937},
name: "DelimitedBlock",
},
},
},
},
},
},
{
name: "SidebarBlockParagraph",
pos: position{line: 1465, col: 1, offset: 55000},
expr: &actionExpr{
pos: position{line: 1465, col: 26, offset: 55025},
run: (*parser).callonSidebarBlockParagraph1,
expr: &labeledExpr{
pos: position{line: 1465, col: 26, offset: 55025},
label: "lines",
expr: &oneOrMoreExpr{
pos: position{line: 1465, col: 32, offset: 55031},
expr: &ruleRefExpr{
pos: position{line: 1465, col: 33, offset: 55032},
name: "SidebarBlockParagraphLine",
},
},
},
},
},
{
name: "SidebarBlockParagraphLine",
pos: position{line: 1469, col: 1, offset: 55146},
expr: &actionExpr{
pos: position{line: 1469, col: 30, offset: 55175},
run: (*parser).callonSidebarBlockParagraphLine1,
expr: &seqExpr{
pos: position{line: 1469, col: 30, offset: 55175},
exprs: []interface{}{
¬Expr{
pos: position{line: 1469, col: 30, offset: 55175},
expr: &ruleRefExpr{
pos: position{line: 1469, col: 31, offset: 55176},
name: "SidebarBlockDelimiter",
},
},
¬Expr{
pos: position{line: 1469, col: 53, offset: 55198},
expr: &ruleRefExpr{
pos: position{line: 1469, col: 54, offset: 55199},
name: "BlankLine",
},
},
&labeledExpr{
pos: position{line: 1469, col: 64, offset: 55209},
label: "line",
expr: &ruleRefExpr{
pos: position{line: 1469, col: 70, offset: 55215},
name: "InlineElements",
},
},
},
},
},
},
{
name: "Table",
pos: position{line: 1477, col: 1, offset: 55446},
expr: &actionExpr{
pos: position{line: 1477, col: 10, offset: 55455},
run: (*parser).callonTable1,
expr: &seqExpr{
pos: position{line: 1477, col: 10, offset: 55455},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1477, col: 10, offset: 55455},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 1477, col: 21, offset: 55466},
expr: &ruleRefExpr{
pos: position{line: 1477, col: 22, offset: 55467},
name: "ElementAttributes",
},
},
},
&ruleRefExpr{
pos: position{line: 1477, col: 42, offset: 55487},
name: "TableDelimiter",
},
&labeledExpr{
pos: position{line: 1478, col: 5, offset: 55506},
label: "header",
expr: &zeroOrOneExpr{
pos: position{line: 1478, col: 12, offset: 55513},
expr: &ruleRefExpr{
pos: position{line: 1478, col: 13, offset: 55514},
name: "TableLineHeader",
},
},
},
&labeledExpr{
pos: position{line: 1479, col: 5, offset: 55536},
label: "lines",
expr: &zeroOrMoreExpr{
pos: position{line: 1479, col: 11, offset: 55542},
expr: &ruleRefExpr{
pos: position{line: 1479, col: 12, offset: 55543},
name: "TableLine",
},
},
},
&choiceExpr{
pos: position{line: 1480, col: 6, offset: 55560},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1480, col: 6, offset: 55560},
name: "TableDelimiter",
},
&ruleRefExpr{
pos: position{line: 1480, col: 23, offset: 55577},
name: "EOF",
},
},
},
},
},
},
},
{
name: "TableCellSeparator",
pos: position{line: 1484, col: 1, offset: 55692},
expr: &seqExpr{
pos: position{line: 1484, col: 23, offset: 55714},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1484, col: 23, offset: 55714},
val: "|",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 1484, col: 27, offset: 55718},
expr: &ruleRefExpr{
pos: position{line: 1484, col: 27, offset: 55718},
name: "WS",
},
},
},
},
},
{
name: "TableDelimiter",
pos: position{line: 1486, col: 1, offset: 55723},
expr: &seqExpr{
pos: position{line: 1486, col: 19, offset: 55741},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1486, col: 19, offset: 55741},
val: "|===",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 1486, col: 26, offset: 55748},
expr: &ruleRefExpr{
pos: position{line: 1486, col: 26, offset: 55748},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1486, col: 30, offset: 55752},
name: "EOL",
},
},
},
},
{
name: "TableLineHeader",
pos: position{line: 1489, col: 1, offset: 55820},
expr: &actionExpr{
pos: position{line: 1489, col: 20, offset: 55839},
run: (*parser).callonTableLineHeader1,
expr: &seqExpr{
pos: position{line: 1489, col: 20, offset: 55839},
exprs: []interface{}{
¬Expr{
pos: position{line: 1489, col: 20, offset: 55839},
expr: &ruleRefExpr{
pos: position{line: 1489, col: 21, offset: 55840},
name: "TableDelimiter",
},
},
&labeledExpr{
pos: position{line: 1489, col: 36, offset: 55855},
label: "cells",
expr: &oneOrMoreExpr{
pos: position{line: 1489, col: 42, offset: 55861},
expr: &ruleRefExpr{
pos: position{line: 1489, col: 43, offset: 55862},
name: "TableCell",
},
},
},
&ruleRefExpr{
pos: position{line: 1489, col: 55, offset: 55874},
name: "EOL",
},
&ruleRefExpr{
pos: position{line: 1489, col: 59, offset: 55878},
name: "BlankLine",
},
},
},
},
},
{
name: "TableLine",
pos: position{line: 1493, col: 1, offset: 55946},
expr: &actionExpr{
pos: position{line: 1493, col: 14, offset: 55959},
run: (*parser).callonTableLine1,
expr: &seqExpr{
pos: position{line: 1493, col: 14, offset: 55959},
exprs: []interface{}{
¬Expr{
pos: position{line: 1493, col: 14, offset: 55959},
expr: &ruleRefExpr{
pos: position{line: 1493, col: 15, offset: 55960},
name: "TableDelimiter",
},
},
&labeledExpr{
pos: position{line: 1493, col: 30, offset: 55975},
label: "cells",
expr: &oneOrMoreExpr{
pos: position{line: 1493, col: 36, offset: 55981},
expr: &ruleRefExpr{
pos: position{line: 1493, col: 37, offset: 55982},
name: "TableCell",
},
},
},
&ruleRefExpr{
pos: position{line: 1493, col: 49, offset: 55994},
name: "EOL",
},
&zeroOrMoreExpr{
pos: position{line: 1493, col: 53, offset: 55998},
expr: &ruleRefExpr{
pos: position{line: 1493, col: 53, offset: 55998},
name: "BlankLine",
},
},
},
},
},
},
{
name: "TableCell",
pos: position{line: 1497, col: 1, offset: 56067},
expr: &actionExpr{
pos: position{line: 1497, col: 14, offset: 56080},
run: (*parser).callonTableCell1,
expr: &seqExpr{
pos: position{line: 1497, col: 14, offset: 56080},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 1497, col: 14, offset: 56080},
name: "TableCellSeparator",
},
&labeledExpr{
pos: position{line: 1497, col: 33, offset: 56099},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 1497, col: 42, offset: 56108},
expr: &seqExpr{
pos: position{line: 1497, col: 43, offset: 56109},
exprs: []interface{}{
¬Expr{
pos: position{line: 1497, col: 43, offset: 56109},
expr: &ruleRefExpr{
pos: position{line: 1497, col: 44, offset: 56110},
name: "TableCellSeparator",
},
},
¬Expr{
pos: position{line: 1497, col: 63, offset: 56129},
expr: &ruleRefExpr{
pos: position{line: 1497, col: 64, offset: 56130},
name: "EOL",
},
},
&zeroOrMoreExpr{
pos: position{line: 1497, col: 68, offset: 56134},
expr: &ruleRefExpr{
pos: position{line: 1497, col: 68, offset: 56134},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1497, col: 72, offset: 56138},
name: "InlineElement",
},
&zeroOrMoreExpr{
pos: position{line: 1497, col: 86, offset: 56152},
expr: &ruleRefExpr{
pos: position{line: 1497, col: 86, offset: 56152},
name: "WS",
},
},
},
},
},
},
},
},
},
},
{
name: "CommentBlockDelimiter",
pos: position{line: 1504, col: 1, offset: 56398},
expr: &litMatcher{
pos: position{line: 1504, col: 26, offset: 56423},
val: "////",
ignoreCase: false,
},
},
{
name: "CommentBlock",
pos: position{line: 1506, col: 1, offset: 56431},
expr: &actionExpr{
pos: position{line: 1506, col: 17, offset: 56447},
run: (*parser).callonCommentBlock1,
expr: &seqExpr{
pos: position{line: 1506, col: 17, offset: 56447},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 1506, col: 17, offset: 56447},
name: "CommentBlockDelimiter",
},
&zeroOrMoreExpr{
pos: position{line: 1506, col: 39, offset: 56469},
expr: &ruleRefExpr{
pos: position{line: 1506, col: 39, offset: 56469},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1506, col: 43, offset: 56473},
name: "Newline",
},
&labeledExpr{
pos: position{line: 1506, col: 51, offset: 56481},
label: "content",
expr: &zeroOrMoreExpr{
pos: position{line: 1506, col: 59, offset: 56489},
expr: &ruleRefExpr{
pos: position{line: 1506, col: 60, offset: 56490},
name: "CommentBlockLine",
},
},
},
&choiceExpr{
pos: position{line: 1506, col: 81, offset: 56511},
alternatives: []interface{}{
&seqExpr{
pos: position{line: 1506, col: 82, offset: 56512},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 1506, col: 82, offset: 56512},
name: "CommentBlockDelimiter",
},
&zeroOrMoreExpr{
pos: position{line: 1506, col: 104, offset: 56534},
expr: &ruleRefExpr{
pos: position{line: 1506, col: 104, offset: 56534},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1506, col: 108, offset: 56538},
name: "EOL",
},
},
},
&ruleRefExpr{
pos: position{line: 1506, col: 115, offset: 56545},
name: "EOF",
},
},
},
},
},
},
},
{
name: "CommentBlockLine",
pos: position{line: 1510, col: 1, offset: 56651},
expr: &actionExpr{
pos: position{line: 1510, col: 21, offset: 56671},
run: (*parser).callonCommentBlockLine1,
expr: &seqExpr{
pos: position{line: 1510, col: 21, offset: 56671},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 1510, col: 21, offset: 56671},
expr: &choiceExpr{
pos: position{line: 1510, col: 22, offset: 56672},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1510, col: 22, offset: 56672},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 1510, col: 34, offset: 56684},
name: "Spaces",
},
&seqExpr{
pos: position{line: 1510, col: 44, offset: 56694},
exprs: []interface{}{
¬Expr{
pos: position{line: 1510, col: 44, offset: 56694},
expr: &ruleRefExpr{
pos: position{line: 1510, col: 45, offset: 56695},
name: "CommentBlockDelimiter",
},
},
¬Expr{
pos: position{line: 1510, col: 67, offset: 56717},
expr: &ruleRefExpr{
pos: position{line: 1510, col: 68, offset: 56718},
name: "EOL",
},
},
&anyMatcher{
line: 1510, col: 72, offset: 56722,
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 1510, col: 77, offset: 56727},
name: "EOL",
},
},
},
},
},
{
name: "SingleLineComment",
pos: position{line: 1514, col: 1, offset: 56767},
expr: &actionExpr{
pos: position{line: 1514, col: 22, offset: 56788},
run: (*parser).callonSingleLineComment1,
expr: &seqExpr{
pos: position{line: 1514, col: 22, offset: 56788},
exprs: []interface{}{
¬Expr{
pos: position{line: 1514, col: 22, offset: 56788},
expr: &ruleRefExpr{
pos: position{line: 1514, col: 23, offset: 56789},
name: "CommentBlockDelimiter",
},
},
&zeroOrMoreExpr{
pos: position{line: 1514, col: 45, offset: 56811},
expr: &ruleRefExpr{
pos: position{line: 1514, col: 45, offset: 56811},
name: "WS",
},
},
&litMatcher{
pos: position{line: 1514, col: 49, offset: 56815},
val: "//",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1514, col: 54, offset: 56820},
label: "content",
expr: &ruleRefExpr{
pos: position{line: 1514, col: 63, offset: 56829},
name: "SingleLineCommentContent",
},
},
&ruleRefExpr{
pos: position{line: 1514, col: 89, offset: 56855},
name: "EOL",
},
},
},
},
},
{
name: "SingleLineCommentContent",
pos: position{line: 1518, col: 1, offset: 56920},
expr: &actionExpr{
pos: position{line: 1518, col: 29, offset: 56948},
run: (*parser).callonSingleLineCommentContent1,
expr: &zeroOrMoreExpr{
pos: position{line: 1518, col: 29, offset: 56948},
expr: &choiceExpr{
pos: position{line: 1518, col: 30, offset: 56949},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1518, col: 30, offset: 56949},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 1518, col: 42, offset: 56961},
name: "Spaces",
},
&seqExpr{
pos: position{line: 1518, col: 52, offset: 56971},
exprs: []interface{}{
¬Expr{
pos: position{line: 1518, col: 52, offset: 56971},
expr: &ruleRefExpr{
pos: position{line: 1518, col: 53, offset: 56972},
name: "EOL",
},
},
&anyMatcher{
line: 1518, col: 58, offset: 56977,
},
},
},
},
},
},
},
},
{
name: "LiteralBlock",
pos: position{line: 1526, col: 1, offset: 57286},
expr: &choiceExpr{
pos: position{line: 1526, col: 17, offset: 57302},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1526, col: 17, offset: 57302},
name: "ParagraphWithLiteralAttribute",
},
&ruleRefExpr{
pos: position{line: 1526, col: 49, offset: 57334},
name: "ParagraphWithHeadingSpaces",
},
&ruleRefExpr{
pos: position{line: 1526, col: 78, offset: 57363},
name: "ParagraphWithLiteralBlockDelimiter",
},
},
},
},
{
name: "LiteralBlockDelimiter",
pos: position{line: 1528, col: 1, offset: 57399},
expr: &litMatcher{
pos: position{line: 1528, col: 26, offset: 57424},
val: "....",
ignoreCase: false,
},
},
{
name: "ParagraphWithHeadingSpaces",
pos: position{line: 1531, col: 1, offset: 57496},
expr: &actionExpr{
pos: position{line: 1531, col: 31, offset: 57526},
run: (*parser).callonParagraphWithHeadingSpaces1,
expr: &seqExpr{
pos: position{line: 1531, col: 31, offset: 57526},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1531, col: 31, offset: 57526},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 1531, col: 42, offset: 57537},
expr: &ruleRefExpr{
pos: position{line: 1531, col: 43, offset: 57538},
name: "ElementAttributes",
},
},
},
&labeledExpr{
pos: position{line: 1531, col: 63, offset: 57558},
label: "lines",
expr: &ruleRefExpr{
pos: position{line: 1531, col: 70, offset: 57565},
name: "ParagraphWithHeadingSpacesLines",
},
},
},
},
},
},
{
name: "ParagraphWithHeadingSpacesLines",
pos: position{line: 1536, col: 1, offset: 57795},
expr: &actionExpr{
pos: position{line: 1537, col: 5, offset: 57835},
run: (*parser).callonParagraphWithHeadingSpacesLines1,
expr: &seqExpr{
pos: position{line: 1537, col: 5, offset: 57835},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1537, col: 5, offset: 57835},
label: "firstLine",
expr: &actionExpr{
pos: position{line: 1537, col: 16, offset: 57846},
run: (*parser).callonParagraphWithHeadingSpacesLines4,
expr: &seqExpr{
pos: position{line: 1537, col: 16, offset: 57846},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 1537, col: 16, offset: 57846},
name: "WS",
},
&oneOrMoreExpr{
pos: position{line: 1537, col: 19, offset: 57849},
expr: &choiceExpr{
pos: position{line: 1537, col: 20, offset: 57850},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1537, col: 20, offset: 57850},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 1537, col: 32, offset: 57862},
name: "Spaces",
},
&actionExpr{
pos: position{line: 1537, col: 41, offset: 57871},
run: (*parser).callonParagraphWithHeadingSpacesLines11,
expr: &seqExpr{
pos: position{line: 1537, col: 42, offset: 57872},
exprs: []interface{}{
¬Expr{
pos: position{line: 1537, col: 42, offset: 57872},
expr: &ruleRefExpr{
pos: position{line: 1537, col: 43, offset: 57873},
name: "EOL",
},
},
&anyMatcher{
line: 1537, col: 48, offset: 57878,
},
},
},
},
},
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 1541, col: 8, offset: 57969},
name: "EOL",
},
&labeledExpr{
pos: position{line: 1542, col: 5, offset: 58032},
label: "otherLines",
expr: &zeroOrMoreExpr{
pos: position{line: 1542, col: 16, offset: 58043},
expr: &actionExpr{
pos: position{line: 1543, col: 9, offset: 58053},
run: (*parser).callonParagraphWithHeadingSpacesLines19,
expr: &seqExpr{
pos: position{line: 1543, col: 9, offset: 58053},
exprs: []interface{}{
¬Expr{
pos: position{line: 1543, col: 9, offset: 58053},
expr: &ruleRefExpr{
pos: position{line: 1543, col: 10, offset: 58054},
name: "BlankLine",
},
},
&labeledExpr{
pos: position{line: 1544, col: 9, offset: 58073},
label: "otherLine",
expr: &actionExpr{
pos: position{line: 1544, col: 20, offset: 58084},
run: (*parser).callonParagraphWithHeadingSpacesLines24,
expr: &oneOrMoreExpr{
pos: position{line: 1544, col: 20, offset: 58084},
expr: &choiceExpr{
pos: position{line: 1544, col: 21, offset: 58085},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1544, col: 21, offset: 58085},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 1544, col: 33, offset: 58097},
name: "Spaces",
},
&seqExpr{
pos: position{line: 1544, col: 43, offset: 58107},
exprs: []interface{}{
¬Expr{
pos: position{line: 1544, col: 43, offset: 58107},
expr: &ruleRefExpr{
pos: position{line: 1544, col: 44, offset: 58108},
name: "EOL",
},
},
&anyMatcher{
line: 1544, col: 49, offset: 58113,
},
},
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 1546, col: 12, offset: 58170},
name: "EOL",
},
},
},
},
},
},
},
},
},
},
{
name: "ParagraphWithLiteralBlockDelimiter",
pos: position{line: 1553, col: 1, offset: 58400},
expr: &actionExpr{
pos: position{line: 1553, col: 39, offset: 58438},
run: (*parser).callonParagraphWithLiteralBlockDelimiter1,
expr: &seqExpr{
pos: position{line: 1553, col: 39, offset: 58438},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1553, col: 39, offset: 58438},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 1553, col: 50, offset: 58449},
expr: &ruleRefExpr{
pos: position{line: 1553, col: 51, offset: 58450},
name: "ElementAttributes",
},
},
},
&ruleRefExpr{
pos: position{line: 1554, col: 9, offset: 58478},
name: "LiteralBlockDelimiter",
},
&zeroOrMoreExpr{
pos: position{line: 1554, col: 31, offset: 58500},
expr: &ruleRefExpr{
pos: position{line: 1554, col: 31, offset: 58500},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1554, col: 35, offset: 58504},
name: "Newline",
},
&labeledExpr{
pos: position{line: 1554, col: 43, offset: 58512},
label: "lines",
expr: &ruleRefExpr{
pos: position{line: 1554, col: 50, offset: 58519},
name: "ParagraphWithLiteralBlockDelimiterLines",
},
},
&choiceExpr{
pos: position{line: 1554, col: 92, offset: 58561},
alternatives: []interface{}{
&seqExpr{
pos: position{line: 1554, col: 93, offset: 58562},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 1554, col: 93, offset: 58562},
name: "LiteralBlockDelimiter",
},
&zeroOrMoreExpr{
pos: position{line: 1554, col: 115, offset: 58584},
expr: &ruleRefExpr{
pos: position{line: 1554, col: 115, offset: 58584},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1554, col: 119, offset: 58588},
name: "EOL",
},
},
},
&ruleRefExpr{
pos: position{line: 1554, col: 126, offset: 58595},
name: "EOF",
},
},
},
},
},
},
},
{
name: "ParagraphWithLiteralBlockDelimiterLines",
pos: position{line: 1559, col: 1, offset: 58754},
expr: &actionExpr{
pos: position{line: 1559, col: 44, offset: 58797},
run: (*parser).callonParagraphWithLiteralBlockDelimiterLines1,
expr: &labeledExpr{
pos: position{line: 1559, col: 44, offset: 58797},
label: "lines",
expr: &zeroOrMoreExpr{
pos: position{line: 1559, col: 50, offset: 58803},
expr: &ruleRefExpr{
pos: position{line: 1559, col: 51, offset: 58804},
name: "ParagraphWithLiteralBlockDelimiterLine",
},
},
},
},
},
{
name: "ParagraphWithLiteralBlockDelimiterLine",
pos: position{line: 1563, col: 1, offset: 58888},
expr: &actionExpr{
pos: position{line: 1564, col: 5, offset: 58943},
run: (*parser).callonParagraphWithLiteralBlockDelimiterLine1,
expr: &seqExpr{
pos: position{line: 1564, col: 5, offset: 58943},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1564, col: 5, offset: 58943},
label: "line",
expr: &actionExpr{
pos: position{line: 1564, col: 11, offset: 58949},
run: (*parser).callonParagraphWithLiteralBlockDelimiterLine4,
expr: &zeroOrMoreExpr{
pos: position{line: 1564, col: 11, offset: 58949},
expr: &choiceExpr{
pos: position{line: 1564, col: 12, offset: 58950},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1564, col: 12, offset: 58950},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 1564, col: 24, offset: 58962},
name: "Spaces",
},
&seqExpr{
pos: position{line: 1564, col: 34, offset: 58972},
exprs: []interface{}{
¬Expr{
pos: position{line: 1564, col: 34, offset: 58972},
expr: &ruleRefExpr{
pos: position{line: 1564, col: 35, offset: 58973},
name: "LiteralBlockDelimiter",
},
},
¬Expr{
pos: position{line: 1564, col: 57, offset: 58995},
expr: &ruleRefExpr{
pos: position{line: 1564, col: 58, offset: 58996},
name: "EOL",
},
},
&anyMatcher{
line: 1564, col: 62, offset: 59000,
},
},
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 1566, col: 8, offset: 59049},
name: "EOL",
},
},
},
},
},
{
name: "ParagraphWithLiteralAttribute",
pos: position{line: 1571, col: 1, offset: 59175},
expr: &actionExpr{
pos: position{line: 1572, col: 5, offset: 59213},
run: (*parser).callonParagraphWithLiteralAttribute1,
expr: &seqExpr{
pos: position{line: 1572, col: 5, offset: 59213},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1572, col: 5, offset: 59213},
label: "attributes",
expr: &zeroOrOneExpr{
pos: position{line: 1572, col: 16, offset: 59224},
expr: &ruleRefExpr{
pos: position{line: 1572, col: 17, offset: 59225},
name: "ElementAttributes",
},
},
},
&andCodeExpr{
pos: position{line: 1573, col: 5, offset: 59249},
run: (*parser).callonParagraphWithLiteralAttribute6,
},
&labeledExpr{
pos: position{line: 1580, col: 5, offset: 59463},
label: "lines",
expr: &ruleRefExpr{
pos: position{line: 1580, col: 12, offset: 59470},
name: "ParagraphWithLiteralAttributeLines",
},
},
},
},
},
},
{
name: "LiteralKind",
pos: position{line: 1584, col: 1, offset: 59620},
expr: &actionExpr{
pos: position{line: 1584, col: 16, offset: 59635},
run: (*parser).callonLiteralKind1,
expr: &litMatcher{
pos: position{line: 1584, col: 16, offset: 59635},
val: "literal",
ignoreCase: false,
},
},
},
{
name: "ParagraphWithLiteralAttributeLines",
pos: position{line: 1589, col: 1, offset: 59718},
expr: &actionExpr{
pos: position{line: 1589, col: 39, offset: 59756},
run: (*parser).callonParagraphWithLiteralAttributeLines1,
expr: &labeledExpr{
pos: position{line: 1589, col: 39, offset: 59756},
label: "lines",
expr: &oneOrMoreExpr{
pos: position{line: 1589, col: 45, offset: 59762},
expr: &ruleRefExpr{
pos: position{line: 1589, col: 46, offset: 59763},
name: "ParagraphWithLiteralAttributeLine",
},
},
},
},
},
{
name: "ParagraphWithLiteralAttributeLine",
pos: position{line: 1593, col: 1, offset: 59843},
expr: &actionExpr{
pos: position{line: 1593, col: 38, offset: 59880},
run: (*parser).callonParagraphWithLiteralAttributeLine1,
expr: &seqExpr{
pos: position{line: 1593, col: 38, offset: 59880},
exprs: []interface{}{
&labeledExpr{
pos: position{line: 1593, col: 38, offset: 59880},
label: "line",
expr: &actionExpr{
pos: position{line: 1593, col: 44, offset: 59886},
run: (*parser).callonParagraphWithLiteralAttributeLine4,
expr: &seqExpr{
pos: position{line: 1593, col: 44, offset: 59886},
exprs: []interface{}{
¬Expr{
pos: position{line: 1593, col: 44, offset: 59886},
expr: &ruleRefExpr{
pos: position{line: 1593, col: 46, offset: 59888},
name: "BlankLine",
},
},
&oneOrMoreExpr{
pos: position{line: 1593, col: 57, offset: 59899},
expr: &choiceExpr{
pos: position{line: 1593, col: 58, offset: 59900},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1593, col: 58, offset: 59900},
name: "Alphanums",
},
&ruleRefExpr{
pos: position{line: 1593, col: 70, offset: 59912},
name: "Spaces",
},
&seqExpr{
pos: position{line: 1593, col: 80, offset: 59922},
exprs: []interface{}{
¬Expr{
pos: position{line: 1593, col: 80, offset: 59922},
expr: &ruleRefExpr{
pos: position{line: 1593, col: 81, offset: 59923},
name: "EOL",
},
},
&anyMatcher{
line: 1593, col: 86, offset: 59928,
},
},
},
},
},
},
},
},
},
},
&ruleRefExpr{
pos: position{line: 1595, col: 4, offset: 59969},
name: "EOL",
},
},
},
},
},
{
name: "IndexTerm",
pos: position{line: 1602, col: 1, offset: 60143},
expr: &actionExpr{
pos: position{line: 1602, col: 14, offset: 60156},
run: (*parser).callonIndexTerm1,
expr: &seqExpr{
pos: position{line: 1602, col: 14, offset: 60156},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1602, col: 14, offset: 60156},
val: "((",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1602, col: 19, offset: 60161},
label: "term",
expr: &ruleRefExpr{
pos: position{line: 1602, col: 25, offset: 60167},
name: "IndexTermContent",
},
},
&litMatcher{
pos: position{line: 1602, col: 43, offset: 60185},
val: "))",
ignoreCase: false,
},
},
},
},
},
{
name: "IndexTermContent",
pos: position{line: 1606, col: 1, offset: 60250},
expr: &actionExpr{
pos: position{line: 1606, col: 21, offset: 60270},
run: (*parser).callonIndexTermContent1,
expr: &labeledExpr{
pos: position{line: 1606, col: 21, offset: 60270},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 1606, col: 30, offset: 60279},
expr: &choiceExpr{
pos: position{line: 1606, col: 31, offset: 60280},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1606, col: 31, offset: 60280},
name: "SimpleWord",
},
&ruleRefExpr{
pos: position{line: 1606, col: 44, offset: 60293},
name: "QuotedText",
},
&ruleRefExpr{
pos: position{line: 1606, col: 57, offset: 60306},
name: "WS",
},
&ruleRefExpr{
pos: position{line: 1606, col: 62, offset: 60311},
name: "AnyChars",
},
&actionExpr{
pos: position{line: 1606, col: 73, offset: 60322},
run: (*parser).callonIndexTermContent9,
expr: &oneOrMoreExpr{
pos: position{line: 1606, col: 73, offset: 60322},
expr: &seqExpr{
pos: position{line: 1606, col: 74, offset: 60323},
exprs: []interface{}{
¬Expr{
pos: position{line: 1606, col: 74, offset: 60323},
expr: &litMatcher{
pos: position{line: 1606, col: 75, offset: 60324},
val: "))",
ignoreCase: false,
},
},
&anyMatcher{
line: 1606, col: 80, offset: 60329,
},
},
},
},
},
},
},
},
},
},
},
{
name: "ConcealedIndexTerm",
pos: position{line: 1612, col: 1, offset: 60436},
expr: &actionExpr{
pos: position{line: 1612, col: 23, offset: 60458},
run: (*parser).callonConcealedIndexTerm1,
expr: &seqExpr{
pos: position{line: 1612, col: 23, offset: 60458},
exprs: []interface{}{
&litMatcher{
pos: position{line: 1612, col: 23, offset: 60458},
val: "(((",
ignoreCase: false,
},
&labeledExpr{
pos: position{line: 1612, col: 29, offset: 60464},
label: "term1",
expr: &ruleRefExpr{
pos: position{line: 1612, col: 36, offset: 60471},
name: "ConcealedIndexTermContent",
},
},
&labeledExpr{
pos: position{line: 1613, col: 5, offset: 60503},
label: "term2",
expr: &zeroOrOneExpr{
pos: position{line: 1613, col: 11, offset: 60509},
expr: &actionExpr{
pos: position{line: 1613, col: 12, offset: 60510},
run: (*parser).callonConcealedIndexTerm8,
expr: &seqExpr{
pos: position{line: 1613, col: 12, offset: 60510},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 1613, col: 12, offset: 60510},
expr: &ruleRefExpr{
pos: position{line: 1613, col: 12, offset: 60510},
name: "WS",
},
},
&litMatcher{
pos: position{line: 1613, col: 16, offset: 60514},
val: ",",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 1613, col: 20, offset: 60518},
expr: &ruleRefExpr{
pos: position{line: 1613, col: 20, offset: 60518},
name: "WS",
},
},
&labeledExpr{
pos: position{line: 1613, col: 24, offset: 60522},
label: "content",
expr: &ruleRefExpr{
pos: position{line: 1613, col: 33, offset: 60531},
name: "ConcealedIndexTermContent",
},
},
},
},
},
},
},
&labeledExpr{
pos: position{line: 1614, col: 5, offset: 60589},
label: "term3",
expr: &zeroOrOneExpr{
pos: position{line: 1614, col: 11, offset: 60595},
expr: &actionExpr{
pos: position{line: 1614, col: 12, offset: 60596},
run: (*parser).callonConcealedIndexTerm19,
expr: &seqExpr{
pos: position{line: 1614, col: 12, offset: 60596},
exprs: []interface{}{
&zeroOrMoreExpr{
pos: position{line: 1614, col: 12, offset: 60596},
expr: &ruleRefExpr{
pos: position{line: 1614, col: 12, offset: 60596},
name: "WS",
},
},
&litMatcher{
pos: position{line: 1614, col: 16, offset: 60600},
val: ",",
ignoreCase: false,
},
&zeroOrMoreExpr{
pos: position{line: 1614, col: 20, offset: 60604},
expr: &ruleRefExpr{
pos: position{line: 1614, col: 20, offset: 60604},
name: "WS",
},
},
&labeledExpr{
pos: position{line: 1614, col: 24, offset: 60608},
label: "content",
expr: &ruleRefExpr{
pos: position{line: 1614, col: 33, offset: 60617},
name: "ConcealedIndexTermContent",
},
},
},
},
},
},
},
&litMatcher{
pos: position{line: 1615, col: 5, offset: 60675},
val: ")))",
ignoreCase: false,
},
},
},
},
},
{
name: "ConcealedIndexTermContent",
pos: position{line: 1619, col: 1, offset: 60754},
expr: &actionExpr{
pos: position{line: 1619, col: 30, offset: 60783},
run: (*parser).callonConcealedIndexTermContent1,
expr: &oneOrMoreExpr{
pos: position{line: 1619, col: 30, offset: 60783},
expr: &choiceExpr{
pos: position{line: 1619, col: 31, offset: 60784},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1619, col: 31, offset: 60784},
name: "Alphanum",
},
&ruleRefExpr{
pos: position{line: 1619, col: 42, offset: 60795},
name: "WS",
},
},
},
},
},
},
{
name: "BlankLine",
pos: position{line: 1625, col: 1, offset: 60940},
expr: &actionExpr{
pos: position{line: 1625, col: 14, offset: 60953},
run: (*parser).callonBlankLine1,
expr: &seqExpr{
pos: position{line: 1625, col: 14, offset: 60953},
exprs: []interface{}{
¬Expr{
pos: position{line: 1625, col: 14, offset: 60953},
expr: &ruleRefExpr{
pos: position{line: 1625, col: 15, offset: 60954},
name: "EOF",
},
},
&zeroOrMoreExpr{
pos: position{line: 1625, col: 19, offset: 60958},
expr: &ruleRefExpr{
pos: position{line: 1625, col: 19, offset: 60958},
name: "WS",
},
},
&ruleRefExpr{
pos: position{line: 1625, col: 23, offset: 60962},
name: "EOL",
},
},
},
},
},
{
name: "Alphanum",
pos: position{line: 1632, col: 1, offset: 61109},
expr: &charClassMatcher{
pos: position{line: 1632, col: 13, offset: 61121},
val: "[\\pL0-9]",
ranges: []rune{'0', '9'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
},
{
name: "Parenthesis",
pos: position{line: 1634, col: 1, offset: 61131},
expr: &choiceExpr{
pos: position{line: 1634, col: 16, offset: 61146},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 1634, col: 16, offset: 61146},
val: "(",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1634, col: 22, offset: 61152},
val: ")",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1634, col: 28, offset: 61158},
val: "[",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1634, col: 34, offset: 61164},
val: "]",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1634, col: 40, offset: 61170},
val: "{",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1634, col: 46, offset: 61176},
val: "}",
ignoreCase: false,
},
},
},
},
{
name: "Alphanums",
pos: position{line: 1636, col: 1, offset: 61182},
expr: &actionExpr{
pos: position{line: 1636, col: 14, offset: 61195},
run: (*parser).callonAlphanums1,
expr: &oneOrMoreExpr{
pos: position{line: 1636, col: 14, offset: 61195},
expr: &charClassMatcher{
pos: position{line: 1636, col: 14, offset: 61195},
val: "[\\pL0-9]",
ranges: []rune{'0', '9'},
classes: []*unicode.RangeTable{rangeTable("L")},
ignoreCase: false,
inverted: false,
},
},
},
},
{
name: "PunctuationMark",
pos: position{line: 1640, col: 1, offset: 61241},
expr: &choiceExpr{
pos: position{line: 1640, col: 20, offset: 61260},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 1640, col: 20, offset: 61260},
val: ".",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1640, col: 26, offset: 61266},
val: "?",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1640, col: 32, offset: 61272},
val: "!",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1640, col: 38, offset: 61278},
val: ",",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1640, col: 44, offset: 61284},
val: ";",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1640, col: 50, offset: 61290},
val: ":",
ignoreCase: false,
},
},
},
},
{
name: "SimpleWord",
pos: position{line: 1642, col: 1, offset: 61295},
expr: &actionExpr{
pos: position{line: 1642, col: 15, offset: 61309},
run: (*parser).callonSimpleWord1,
expr: &seqExpr{
pos: position{line: 1642, col: 15, offset: 61309},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 1642, col: 15, offset: 61309},
name: "Alphanums",
},
&andExpr{
pos: position{line: 1642, col: 25, offset: 61319},
expr: &choiceExpr{
pos: position{line: 1642, col: 27, offset: 61321},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1642, col: 27, offset: 61321},
name: "WS",
},
&litMatcher{
pos: position{line: 1642, col: 32, offset: 61326},
val: ",",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1642, col: 38, offset: 61332},
val: "]",
ignoreCase: false,
},
&ruleRefExpr{
pos: position{line: 1642, col: 44, offset: 61338},
name: "EOL",
},
},
},
},
},
},
},
},
{
name: "AnyChars",
pos: position{line: 1646, col: 1, offset: 61545},
expr: &choiceExpr{
pos: position{line: 1646, col: 13, offset: 61557},
alternatives: []interface{}{
&oneOrMoreExpr{
pos: position{line: 1646, col: 13, offset: 61557},
expr: &choiceExpr{
pos: position{line: 1648, col: 5, offset: 61714},
alternatives: []interface{}{
&actionExpr{
pos: position{line: 1648, col: 5, offset: 61714},
run: (*parser).callonAnyChars4,
expr: &seqExpr{
pos: position{line: 1648, col: 6, offset: 61715},
exprs: []interface{}{
¬Expr{
pos: position{line: 1648, col: 6, offset: 61715},
expr: &choiceExpr{
pos: position{line: 1648, col: 8, offset: 61717},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1648, col: 8, offset: 61717},
name: "Alphanum",
},
&litMatcher{
pos: position{line: 1648, col: 19, offset: 61728},
val: ",",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1648, col: 25, offset: 61734},
val: ";",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1648, col: 31, offset: 61740},
val: "}",
ignoreCase: false,
},
},
},
},
&ruleRefExpr{
pos: position{line: 1648, col: 36, offset: 61745},
name: "ConstrainedQuotedTextMarker",
},
},
},
},
&actionExpr{
pos: position{line: 1652, col: 8, offset: 61893},
run: (*parser).callonAnyChars13,
expr: &seqExpr{
pos: position{line: 1652, col: 9, offset: 61894},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 1652, col: 9, offset: 61894},
name: "Alphanums",
},
&zeroOrOneExpr{
pos: position{line: 1652, col: 19, offset: 61904},
expr: &seqExpr{
pos: position{line: 1652, col: 20, offset: 61905},
exprs: []interface{}{
¬Expr{
pos: position{line: 1652, col: 20, offset: 61905},
expr: &ruleRefExpr{
pos: position{line: 1652, col: 21, offset: 61906},
name: "Newline",
},
},
¬Expr{
pos: position{line: 1652, col: 29, offset: 61914},
expr: &ruleRefExpr{
pos: position{line: 1652, col: 30, offset: 61915},
name: "WS",
},
},
¬Expr{
pos: position{line: 1652, col: 33, offset: 61918},
expr: &ruleRefExpr{
pos: position{line: 1652, col: 34, offset: 61919},
name: "Parenthesis",
},
},
¬Expr{
pos: position{line: 1652, col: 46, offset: 61931},
expr: &ruleRefExpr{
pos: position{line: 1652, col: 47, offset: 61932},
name: "UnconstrainedQuotedTextPrefix",
},
},
¬Expr{
pos: position{line: 1652, col: 77, offset: 61962},
expr: &ruleRefExpr{
pos: position{line: 1652, col: 78, offset: 61963},
name: "LabeledListItemSeparator",
},
},
¬Expr{
pos: position{line: 1652, col: 103, offset: 61988},
expr: &ruleRefExpr{
pos: position{line: 1652, col: 104, offset: 61989},
name: "PunctuationMark",
},
},
&anyMatcher{
line: 1652, col: 120, offset: 62005,
},
},
},
},
},
},
},
},
},
},
&actionExpr{
pos: position{line: 1655, col: 7, offset: 62063},
run: (*parser).callonAnyChars31,
expr: &ruleRefExpr{
pos: position{line: 1655, col: 7, offset: 62063},
name: "PunctuationMark",
},
},
},
},
},
{
name: "AnyChar",
pos: position{line: 1660, col: 1, offset: 62353},
expr: &actionExpr{
pos: position{line: 1660, col: 12, offset: 62364},
run: (*parser).callonAnyChar1,
expr: &seqExpr{
pos: position{line: 1660, col: 12, offset: 62364},
exprs: []interface{}{
¬Expr{
pos: position{line: 1660, col: 12, offset: 62364},
expr: &ruleRefExpr{
pos: position{line: 1660, col: 13, offset: 62365},
name: "EOF",
},
},
&anyMatcher{
line: 1660, col: 17, offset: 62369,
},
},
},
},
},
{
name: "Spaces",
pos: position{line: 1664, col: 1, offset: 62521},
expr: &oneOrMoreExpr{
pos: position{line: 1664, col: 11, offset: 62531},
expr: &ruleRefExpr{
pos: position{line: 1664, col: 11, offset: 62531},
name: "WS",
},
},
},
{
name: "FileLocation",
pos: position{line: 1666, col: 1, offset: 62537},
expr: &actionExpr{
pos: position{line: 1666, col: 17, offset: 62553},
run: (*parser).callonFileLocation1,
expr: &labeledExpr{
pos: position{line: 1666, col: 17, offset: 62553},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 1666, col: 26, offset: 62562},
expr: &choiceExpr{
pos: position{line: 1666, col: 27, offset: 62563},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1666, col: 27, offset: 62563},
name: "FILENAME",
},
&ruleRefExpr{
pos: position{line: 1666, col: 38, offset: 62574},
name: "DocumentAttributeSubstitution",
},
},
},
},
},
},
},
{
name: "ResolvedFileLocation",
pos: position{line: 1670, col: 1, offset: 62666},
expr: &actionExpr{
pos: position{line: 1670, col: 25, offset: 62690},
run: (*parser).callonResolvedFileLocation1,
expr: &labeledExpr{
pos: position{line: 1670, col: 25, offset: 62690},
label: "elements",
expr: &oneOrMoreExpr{
pos: position{line: 1670, col: 34, offset: 62699},
expr: &seqExpr{
pos: position{line: 1670, col: 35, offset: 62700},
exprs: []interface{}{
¬Expr{
pos: position{line: 1670, col: 35, offset: 62700},
expr: &ruleRefExpr{
pos: position{line: 1670, col: 36, offset: 62701},
name: "EOL",
},
},
¬Expr{
pos: position{line: 1670, col: 40, offset: 62705},
expr: &ruleRefExpr{
pos: position{line: 1670, col: 41, offset: 62706},
name: "WS",
},
},
¬Expr{
pos: position{line: 1670, col: 44, offset: 62709},
expr: &litMatcher{
pos: position{line: 1670, col: 45, offset: 62710},
val: "[",
ignoreCase: false,
},
},
&anyMatcher{
line: 1670, col: 49, offset: 62714,
},
},
},
},
},
},
},
{
name: "Location",
pos: position{line: 1674, col: 1, offset: 62778},
expr: &actionExpr{
pos: position{line: 1674, col: 13, offset: 62790},
run: (*parser).callonLocation1,
expr: &labeledExpr{
pos: position{line: 1674, col: 13, offset: 62790},
label: "elements",
expr: &seqExpr{
pos: position{line: 1674, col: 23, offset: 62800},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 1674, col: 23, offset: 62800},
name: "URL_SCHEME",
},
&oneOrMoreExpr{
pos: position{line: 1674, col: 34, offset: 62811},
expr: &choiceExpr{
pos: position{line: 1674, col: 35, offset: 62812},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1674, col: 35, offset: 62812},
name: "FILENAME",
},
&ruleRefExpr{
pos: position{line: 1674, col: 46, offset: 62823},
name: "DocumentAttributeSubstitution",
},
},
},
},
},
},
},
},
},
{
name: "FILENAME",
pos: position{line: 1678, col: 1, offset: 62916},
expr: &oneOrMoreExpr{
pos: position{line: 1678, col: 13, offset: 62928},
expr: &choiceExpr{
pos: position{line: 1678, col: 14, offset: 62929},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 1678, col: 14, offset: 62929},
val: "[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~:/?#@!$&;=()*+,_%]",
chars: []rune{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '~', ':', '/', '?', '#', '@', '!', '$', '&', ';', '=', '(', ')', '*', '+', ',', '_', '%'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 1678, col: 99, offset: 63014},
val: "-",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1678, col: 105, offset: 63020},
val: ".",
ignoreCase: false,
},
},
},
},
},
{
name: "ResolvedLocation",
pos: position{line: 1680, col: 1, offset: 63141},
expr: &actionExpr{
pos: position{line: 1680, col: 21, offset: 63161},
run: (*parser).callonResolvedLocation1,
expr: &labeledExpr{
pos: position{line: 1680, col: 21, offset: 63161},
label: "elements",
expr: &seqExpr{
pos: position{line: 1680, col: 31, offset: 63171},
exprs: []interface{}{
&ruleRefExpr{
pos: position{line: 1680, col: 31, offset: 63171},
name: "URL_SCHEME",
},
&ruleRefExpr{
pos: position{line: 1680, col: 42, offset: 63182},
name: "RESOLVED_FILENAME",
},
},
},
},
},
},
{
name: "RESOLVED_FILENAME",
pos: position{line: 1684, col: 1, offset: 63261},
expr: &oneOrMoreExpr{
pos: position{line: 1684, col: 22, offset: 63282},
expr: &choiceExpr{
pos: position{line: 1684, col: 23, offset: 63283},
alternatives: []interface{}{
&charClassMatcher{
pos: position{line: 1684, col: 23, offset: 63283},
val: "[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~:/?#@!$&;=()*+_,%{}]",
chars: []rune{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '~', ':', '/', '?', '#', '@', '!', '$', '&', ';', '=', '(', ')', '*', '+', '_', ',', '%', '{', '}'},
ignoreCase: false,
inverted: false,
},
&litMatcher{
pos: position{line: 1684, col: 110, offset: 63370},
val: "-",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1684, col: 116, offset: 63376},
val: ".",
ignoreCase: false,
},
},
},
},
},
{
name: "URL",
pos: position{line: 1686, col: 1, offset: 63425},
expr: &actionExpr{
pos: position{line: 1686, col: 8, offset: 63432},
run: (*parser).callonURL1,
expr: &oneOrMoreExpr{
pos: position{line: 1686, col: 8, offset: 63432},
expr: &choiceExpr{
pos: position{line: 1686, col: 9, offset: 63433},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1686, col: 9, offset: 63433},
name: "Alphanums",
},
&seqExpr{
pos: position{line: 1686, col: 22, offset: 63446},
exprs: []interface{}{
¬Expr{
pos: position{line: 1686, col: 22, offset: 63446},
expr: &ruleRefExpr{
pos: position{line: 1686, col: 23, offset: 63447},
name: "Newline",
},
},
¬Expr{
pos: position{line: 1686, col: 31, offset: 63455},
expr: &ruleRefExpr{
pos: position{line: 1686, col: 32, offset: 63456},
name: "WS",
},
},
¬Expr{
pos: position{line: 1686, col: 35, offset: 63459},
expr: &litMatcher{
pos: position{line: 1686, col: 36, offset: 63460},
val: "[",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1686, col: 40, offset: 63464},
expr: &litMatcher{
pos: position{line: 1686, col: 41, offset: 63465},
val: "]",
ignoreCase: false,
},
},
&anyMatcher{
line: 1686, col: 46, offset: 63470,
},
},
},
},
},
},
},
},
{
name: "URL_SCHEME",
pos: position{line: 1690, col: 1, offset: 63511},
expr: &choiceExpr{
pos: position{line: 1690, col: 15, offset: 63525},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 1690, col: 15, offset: 63525},
val: "http://",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1690, col: 27, offset: 63537},
val: "https://",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1690, col: 40, offset: 63550},
val: "ftp://",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1690, col: 51, offset: 63561},
val: "irc://",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1690, col: 62, offset: 63572},
val: "mailto:",
ignoreCase: false,
},
},
},
},
{
name: "ID",
pos: position{line: 1692, col: 1, offset: 63583},
expr: &actionExpr{
pos: position{line: 1692, col: 7, offset: 63589},
run: (*parser).callonID1,
expr: &oneOrMoreExpr{
pos: position{line: 1692, col: 7, offset: 63589},
expr: &choiceExpr{
pos: position{line: 1692, col: 8, offset: 63590},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1692, col: 8, offset: 63590},
name: "Alphanums",
},
&seqExpr{
pos: position{line: 1692, col: 21, offset: 63603},
exprs: []interface{}{
¬Expr{
pos: position{line: 1692, col: 21, offset: 63603},
expr: &ruleRefExpr{
pos: position{line: 1692, col: 22, offset: 63604},
name: "Newline",
},
},
¬Expr{
pos: position{line: 1692, col: 30, offset: 63612},
expr: &ruleRefExpr{
pos: position{line: 1692, col: 31, offset: 63613},
name: "WS",
},
},
¬Expr{
pos: position{line: 1692, col: 34, offset: 63616},
expr: &litMatcher{
pos: position{line: 1692, col: 35, offset: 63617},
val: "[",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1692, col: 39, offset: 63621},
expr: &litMatcher{
pos: position{line: 1692, col: 40, offset: 63622},
val: "]",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1692, col: 44, offset: 63626},
expr: &litMatcher{
pos: position{line: 1692, col: 45, offset: 63627},
val: "<<",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1692, col: 50, offset: 63632},
expr: &litMatcher{
pos: position{line: 1692, col: 51, offset: 63633},
val: ">>",
ignoreCase: false,
},
},
¬Expr{
pos: position{line: 1692, col: 56, offset: 63638},
expr: &litMatcher{
pos: position{line: 1692, col: 57, offset: 63639},
val: ",",
ignoreCase: false,
},
},
&anyMatcher{
line: 1692, col: 62, offset: 63644,
},
},
},
},
},
},
},
},
{
name: "DIGIT",
pos: position{line: 1696, col: 1, offset: 63685},
expr: &actionExpr{
pos: position{line: 1696, col: 10, offset: 63694},
run: (*parser).callonDIGIT1,
expr: &charClassMatcher{
pos: position{line: 1696, col: 10, offset: 63694},
val: "[0-9]",
ranges: []rune{'0', '9'},
ignoreCase: false,
inverted: false,
},
},
},
{
name: "NUMBER",
pos: position{line: 1700, col: 1, offset: 63736},
expr: &actionExpr{
pos: position{line: 1700, col: 11, offset: 63746},
run: (*parser).callonNUMBER1,
expr: &seqExpr{
pos: position{line: 1700, col: 11, offset: 63746},
exprs: []interface{}{
&zeroOrOneExpr{
pos: position{line: 1700, col: 11, offset: 63746},
expr: &litMatcher{
pos: position{line: 1700, col: 11, offset: 63746},
val: "-",
ignoreCase: false,
},
},
&oneOrMoreExpr{
pos: position{line: 1700, col: 16, offset: 63751},
expr: &ruleRefExpr{
pos: position{line: 1700, col: 16, offset: 63751},
name: "DIGIT",
},
},
},
},
},
},
{
name: "WS",
pos: position{line: 1704, col: 1, offset: 63803},
expr: &choiceExpr{
pos: position{line: 1704, col: 7, offset: 63809},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 1704, col: 7, offset: 63809},
val: " ",
ignoreCase: false,
},
&actionExpr{
pos: position{line: 1704, col: 13, offset: 63815},
run: (*parser).callonWS3,
expr: &litMatcher{
pos: position{line: 1704, col: 13, offset: 63815},
val: "\t",
ignoreCase: false,
},
},
},
},
},
{
name: "Newline",
pos: position{line: 1708, col: 1, offset: 63856},
expr: &choiceExpr{
pos: position{line: 1708, col: 12, offset: 63867},
alternatives: []interface{}{
&litMatcher{
pos: position{line: 1708, col: 12, offset: 63867},
val: "\r\n",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1708, col: 21, offset: 63876},
val: "\r",
ignoreCase: false,
},
&litMatcher{
pos: position{line: 1708, col: 28, offset: 63883},
val: "\n",
ignoreCase: false,
},
},
},
},
{
name: "EOF",
pos: position{line: 1710, col: 1, offset: 63889},
expr: ¬Expr{
pos: position{line: 1710, col: 8, offset: 63896},
expr: &anyMatcher{
line: 1710, col: 9, offset: 63897,
},
},
},
{
name: "EOL",
pos: position{line: 1712, col: 1, offset: 63900},
expr: &choiceExpr{
pos: position{line: 1712, col: 8, offset: 63907},
alternatives: []interface{}{
&ruleRefExpr{
pos: position{line: 1712, col: 8, offset: 63907},
name: "Newline",
},
&ruleRefExpr{
pos: position{line: 1712, col: 18, offset: 63917},
name: "EOF",
},
},
},
},
},
}
func (c *current) onAsciidocDocument1(frontmatter, blocks interface{}) (interface{}, error) {
return types.NewDraftDocument(frontmatter, blocks.([]interface{}))
}
func (p *parser) callonAsciidocDocument1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAsciidocDocument1(stack["frontmatter"], stack["blocks"])
}
func (c *current) onAsciidocDocumentWithinDelimitedBlock1(frontmatter, blocks interface{}) (interface{}, error) {
return types.NewDraftDocument(frontmatter, blocks.([]interface{}))
}
func (p *parser) callonAsciidocDocumentWithinDelimitedBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAsciidocDocumentWithinDelimitedBlock1(stack["frontmatter"], stack["blocks"])
}
func (c *current) onTextDocument1(blocks interface{}) (interface{}, error) {
return types.NewDraftDocument(nil, blocks.([]interface{}))
}
func (p *parser) callonTextDocument1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTextDocument1(stack["blocks"])
}
func (c *current) onAsciidocDocumentBlocks1(header, others interface{}) (interface{}, error) {
if header != nil && others != nil {
return append([]interface{}{header}, others.([]interface{})...), nil
} else if others != nil {
return others.([]interface{}), nil
}
return []interface{}{}, nil
}
func (p *parser) callonAsciidocDocumentBlocks1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAsciidocDocumentBlocks1(stack["header"], stack["others"])
}
func (c *current) onDocumentBlock1(block interface{}) (interface{}, error) {
return block, nil
}
func (p *parser) callonDocumentBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentBlock1(stack["block"])
}
func (c *current) onDocumentBlockWithinDelimitedBlock1(block interface{}) (interface{}, error) {
return block, nil
}
func (p *parser) callonDocumentBlockWithinDelimitedBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentBlockWithinDelimitedBlock1(stack["block"])
}
func (c *current) onTextDocumentBlock1(block interface{}) (interface{}, error) {
return block, nil
}
func (p *parser) callonTextDocumentBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTextDocumentBlock1(stack["block"])
}
func (c *current) onYamlFrontMatter1(content interface{}) (interface{}, error) {
return types.NewYamlFrontMatter(content.(string))
}
func (p *parser) callonYamlFrontMatter1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onYamlFrontMatter1(stack["content"])
}
func (c *current) onYamlFrontMatterContent1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonYamlFrontMatterContent1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onYamlFrontMatterContent1()
}
func (c *current) onDocumentHeader1(title, id, authors, revision interface{}) (interface{}, error) {
return types.NewDocumentHeader(title.([]interface{}), authors, revision)
}
func (p *parser) callonDocumentHeader1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentHeader1(stack["title"], stack["id"], stack["authors"], stack["revision"])
}
func (c *current) onDocumentAuthorsInlineForm1(authors interface{}) (interface{}, error) {
return types.NewDocumentAuthors(authors.([]interface{}))
}
func (p *parser) callonDocumentAuthorsInlineForm1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentAuthorsInlineForm1(stack["authors"])
}
func (c *current) onDocumentAuthorsAttributeForm1(author interface{}) (interface{}, error) {
return []types.DocumentAuthor{author.(types.DocumentAuthor)}, nil
}
func (p *parser) callonDocumentAuthorsAttributeForm1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentAuthorsAttributeForm1(stack["author"])
}
func (c *current) onDocumentAuthor1(fullname, email interface{}) (interface{}, error) {
return types.NewDocumentAuthor(fullname, email)
}
func (p *parser) callonDocumentAuthor1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentAuthor1(stack["fullname"], stack["email"])
}
func (c *current) onDocumentAuthorName1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonDocumentAuthorName1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentAuthorName1()
}
func (c *current) onDocumentAuthorEmail5() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonDocumentAuthorEmail5() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentAuthorEmail5()
}
func (c *current) onDocumentAuthorEmail1(email interface{}) (interface{}, error) {
return email, nil
}
func (p *parser) callonDocumentAuthorEmail1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentAuthorEmail1(stack["email"])
}
func (c *current) onDocumentRevision9(revnumber, revdate, revremark interface{}) (interface{}, error) {
return types.NewDocumentRevision(revnumber, revdate, revremark)
}
func (p *parser) callonDocumentRevision9() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentRevision9(stack["revnumber"], stack["revdate"], stack["revremark"])
}
func (c *current) onDocumentRevision23(revdate, revremark interface{}) (interface{}, error) {
return types.NewDocumentRevision(nil, revdate, revremark)
}
func (p *parser) callonDocumentRevision23() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentRevision23(stack["revdate"], stack["revremark"])
}
func (c *current) onDocumentRevision1(revision interface{}) (interface{}, error) {
return revision, nil
}
func (p *parser) callonDocumentRevision1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentRevision1(stack["revision"])
}
func (c *current) onDocumentRevisionNumber2() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonDocumentRevisionNumber2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentRevisionNumber2()
}
func (c *current) onDocumentRevisionNumber18() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonDocumentRevisionNumber18() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentRevisionNumber18()
}
func (c *current) onDocumentRevisionDate1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonDocumentRevisionDate1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentRevisionDate1()
}
func (c *current) onDocumentRevisionRemark1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonDocumentRevisionRemark1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentRevisionRemark1()
}
func (c *current) onDocumentAttributeDeclaration9(value interface{}) (interface{}, error) {
return value, nil
}
func (p *parser) callonDocumentAttributeDeclaration9() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentAttributeDeclaration9(stack["value"])
}
func (c *current) onDocumentAttributeDeclaration1(name, value interface{}) (interface{}, error) {
return types.NewDocumentAttributeDeclaration(name.(string), value)
}
func (p *parser) callonDocumentAttributeDeclaration1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentAttributeDeclaration1(stack["name"], stack["value"])
}
func (c *current) onDocumentAttributeName1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonDocumentAttributeName1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentAttributeName1()
}
func (c *current) onDocumentAttributeValue1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonDocumentAttributeValue1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentAttributeValue1()
}
func (c *current) onDocumentAttributeReset2(name interface{}) (interface{}, error) {
return types.NewDocumentAttributeReset(name.(string))
}
func (p *parser) callonDocumentAttributeReset2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentAttributeReset2(stack["name"])
}
func (c *current) onDocumentAttributeReset11(name interface{}) (interface{}, error) {
return types.NewDocumentAttributeReset(name.(string))
}
func (p *parser) callonDocumentAttributeReset11() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentAttributeReset11(stack["name"])
}
func (c *current) onDocumentAttributeSubstitution1(name interface{}) (interface{}, error) {
return types.NewDocumentAttributeSubstitution(name.(string))
}
func (p *parser) callonDocumentAttributeSubstitution1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDocumentAttributeSubstitution1(stack["name"])
}
func (c *current) onElementAttributes1(attrs interface{}) (interface{}, error) {
return types.NewElementAttributes(attrs.([]interface{})), nil
}
func (p *parser) callonElementAttributes1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onElementAttributes1(stack["attrs"])
}
func (c *current) onElementAttribute1(attr interface{}) (interface{}, error) {
return attr, nil // avoid returning something like `[]interface{}{attr, EOL}`
}
func (p *parser) callonElementAttribute1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onElementAttribute1(stack["attr"])
}
func (c *current) onElementID2(id interface{}) (interface{}, error) {
return types.NewElementID(id.(string))
}
func (p *parser) callonElementID2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onElementID2(stack["id"])
}
func (c *current) onElementID11(id interface{}) (interface{}, error) {
return types.NewElementID(id.(string))
}
func (p *parser) callonElementID11() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onElementID11(stack["id"])
}
func (c *current) onInlineElementID1(id interface{}) (interface{}, error) {
// no EOL here since there can be multiple InlineElementID on the same line
return types.NewInlineElementID(id.(string))
}
func (p *parser) callonInlineElementID1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInlineElementID1(stack["id"])
}
func (c *current) onElementTitle5() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonElementTitle5() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onElementTitle5()
}
func (c *current) onElementTitle1(title interface{}) (interface{}, error) {
return types.NewElementTitle(title.(string))
}
func (p *parser) callonElementTitle1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onElementTitle1(stack["title"])
}
func (c *current) onElementRole5() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonElementRole5() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onElementRole5()
}
func (c *current) onElementRole1(role interface{}) (interface{}, error) {
return types.NewElementRole(role.(string))
}
func (p *parser) callonElementRole1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onElementRole1(stack["role"])
}
func (c *current) onLiteralAttribute1() (interface{}, error) {
return types.NewLiteralAttribute()
}
func (p *parser) callonLiteralAttribute1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLiteralAttribute1()
}
func (c *current) onAdmonitionMarkerAttribute1(k interface{}) (interface{}, error) {
return types.NewAdmonitionAttribute(k.(types.AdmonitionKind))
}
func (p *parser) callonAdmonitionMarkerAttribute1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAdmonitionMarkerAttribute1(stack["k"])
}
func (c *current) onSourceAttributes6(attr interface{}) (interface{}, error) {
return attr, nil
}
func (p *parser) callonSourceAttributes6() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSourceAttributes6(stack["attr"])
}
func (c *current) onSourceAttributes14(attr interface{}) (interface{}, error) {
return attr, nil
}
func (p *parser) callonSourceAttributes14() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSourceAttributes14(stack["attr"])
}
func (c *current) onSourceAttributes1(language, others interface{}) (interface{}, error) {
return types.NewSourceAttributes(language, others.([]interface{})...)
}
func (p *parser) callonSourceAttributes1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSourceAttributes1(stack["language"], stack["others"])
}
func (c *current) onAttributeGroup1(attributes interface{}) (interface{}, error) {
return types.NewAttributeGroup(attributes.([]interface{}))
}
func (p *parser) callonAttributeGroup1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAttributeGroup1(stack["attributes"])
}
func (c *current) onGenericAttributeWithValue1(key, value interface{}) (interface{}, error) {
// value is (optionally) set
return types.NewGenericAttribute(key.(string), value)
}
func (p *parser) callonGenericAttributeWithValue1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onGenericAttributeWithValue1(stack["key"], stack["value"])
}
func (c *current) onGenericAttributeWithoutValue1(key interface{}) (interface{}, error) {
// value is not set
return types.NewGenericAttribute(key.(string), nil)
}
func (p *parser) callonGenericAttributeWithoutValue1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onGenericAttributeWithoutValue1(stack["key"])
}
func (c *current) onAttributeKey1(key interface{}) (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonAttributeKey1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAttributeKey1(stack["key"])
}
func (c *current) onAttributeValue1(value interface{}) (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonAttributeValue1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAttributeValue1(stack["value"])
}
func (c *current) onStandaloneAttributeValue1(value interface{}) (interface{}, error) {
// standalone attribute value cannot be followed by a `=`, otherwise it causes troubles for standalone values (eg: in images)
return string(c.text), nil
}
func (p *parser) callonStandaloneAttributeValue1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onStandaloneAttributeValue1(stack["value"])
}
func (c *current) onHorizontalLayout1() (interface{}, error) {
return types.ElementAttributes{"layout": "horizontal"}, nil
}
func (p *parser) callonHorizontalLayout1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onHorizontalLayout1()
}
func (c *current) onQuoteAttributes1(author, title interface{}) (interface{}, error) {
return types.NewQuoteAttributes("quote", author, title)
}
func (p *parser) callonQuoteAttributes1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onQuoteAttributes1(stack["author"], stack["title"])
}
func (c *current) onVerseAttributes1(author, title interface{}) (interface{}, error) {
return types.NewQuoteAttributes("verse", author.(string), title.(string))
}
func (p *parser) callonVerseAttributes1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerseAttributes1(stack["author"], stack["title"])
}
func (c *current) onQuoteAttribute1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonQuoteAttribute1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onQuoteAttribute1()
}
func (c *current) onInlineAttributes1(attrs interface{}) (interface{}, error) {
return types.NewInlineAttributes(attrs.([]interface{}))
}
func (p *parser) callonInlineAttributes1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInlineAttributes1(stack["attrs"])
}
func (c *current) onSection7() (interface{}, error) {
// `=` is level 0, etc.
return (len(c.text) - 1), nil
}
func (p *parser) callonSection7() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSection7()
}
func (c *current) onSection10(attributes, level interface{}) (bool, error) {
// use a predicate to make sure that only `=` (level 0) to `======` (level 5) are allowed
return level.(int) <= 5, nil
}
func (p *parser) callonSection10() (bool, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSection10(stack["attributes"], stack["level"])
}
func (c *current) onSection1(attributes, level, title, id interface{}) (interface{}, error) {
return types.NewSection(level.(int), title.([]interface{}), id.([]interface{}), attributes)
}
func (p *parser) callonSection1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSection1(stack["attributes"], stack["level"], stack["title"], stack["id"])
}
func (c *current) onTitleElements1(elements interface{}) (interface{}, error) {
// absorbs heading and trailing spaces
return types.NewInlineElements(elements.([]interface{}))
}
func (p *parser) callonTitleElements1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTitleElements1(stack["elements"])
}
func (c *current) onTitleElement1(element interface{}) (interface{}, error) {
return element, nil
}
func (p *parser) callonTitleElement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTitleElement1(stack["element"])
}
func (c *current) onUserMacroBlock1(name, value, attrs interface{}) (interface{}, error) {
return types.NewUserMacroBlock(name.(string), value.(string), attrs.(types.ElementAttributes), string(c.text))
}
func (p *parser) callonUserMacroBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUserMacroBlock1(stack["name"], stack["value"], stack["attrs"])
}
func (c *current) onInlineUserMacro1(name, value, attrs interface{}) (interface{}, error) {
return types.NewInlineUserMacro(name.(string), value.(string), attrs.(types.ElementAttributes), string(c.text))
}
func (p *parser) callonInlineUserMacro1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInlineUserMacro1(stack["name"], stack["value"], stack["attrs"])
}
func (c *current) onUserMacroName1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonUserMacroName1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUserMacroName1()
}
func (c *current) onUserMacroValue1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonUserMacroValue1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUserMacroValue1()
}
func (c *current) onUserMacroAttributes1(attrs interface{}) (interface{}, error) {
return types.NewInlineAttributes(attrs.([]interface{}))
}
func (p *parser) callonUserMacroAttributes1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUserMacroAttributes1(stack["attrs"])
}
func (c *current) onFileInclusion4(path, inlineAttributes interface{}) (interface{}, error) {
return types.NewFileInclusion(path.(types.Location), inlineAttributes.(types.ElementAttributes), string(c.text))
}
func (p *parser) callonFileInclusion4() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onFileInclusion4(stack["path"], stack["inlineAttributes"])
}
func (c *current) onFileInclusion1(incl interface{}) (interface{}, error) {
return incl.(types.FileInclusion), nil
}
func (p *parser) callonFileInclusion1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onFileInclusion1(stack["incl"])
}
func (c *current) onFileIncludeAttributes1(attrs interface{}) (interface{}, error) {
return types.NewInlineAttributes(attrs.([]interface{}))
}
func (p *parser) callonFileIncludeAttributes1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onFileIncludeAttributes1(stack["attrs"])
}
func (c *current) onLineRangesAttribute1(lines interface{}) (interface{}, error) {
return types.NewLineRangesAttribute(lines)
}
func (p *parser) callonLineRangesAttribute1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLineRangesAttribute1(stack["lines"])
}
func (c *current) onLineRangesAttributeValue1(value interface{}) (interface{}, error) {
return value, nil
}
func (p *parser) callonLineRangesAttributeValue1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLineRangesAttributeValue1(stack["value"])
}
func (c *current) onMultipleLineRanges9(other interface{}) (interface{}, error) {
return other, nil
}
func (p *parser) callonMultipleLineRanges9() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMultipleLineRanges9(stack["other"])
}
func (c *current) onMultipleLineRanges1(first, others interface{}) (interface{}, error) {
return append([]interface{}{first}, others.([]interface{})...), nil
}
func (p *parser) callonMultipleLineRanges1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMultipleLineRanges1(stack["first"], stack["others"])
}
func (c *current) onMultipleQuotedLineRanges10(other interface{}) (interface{}, error) {
return other, nil
}
func (p *parser) callonMultipleQuotedLineRanges10() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMultipleQuotedLineRanges10(stack["other"])
}
func (c *current) onMultipleQuotedLineRanges1(first, others interface{}) (interface{}, error) {
return append([]interface{}{first}, others.([]interface{})...), nil
}
func (p *parser) callonMultipleQuotedLineRanges1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMultipleQuotedLineRanges1(stack["first"], stack["others"])
}
func (c *current) onMultiLineRange1(start, end interface{}) (interface{}, error) {
// eg: lines=12..14
return types.NewLineRange(start.(int), end.(int))
}
func (p *parser) callonMultiLineRange1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMultiLineRange1(stack["start"], stack["end"])
}
func (c *current) onMultiLineQuotedRange1(start, end interface{}) (interface{}, error) {
// eg: lines=12..14
return types.NewLineRange(start.(int), end.(int))
}
func (p *parser) callonMultiLineQuotedRange1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMultiLineQuotedRange1(stack["start"], stack["end"])
}
func (c *current) onSingleLineRange1(singleline interface{}) (interface{}, error) {
// eg: lines=12
return types.NewLineRange(singleline.(int), singleline.(int))
}
func (p *parser) callonSingleLineRange1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSingleLineRange1(stack["singleline"])
}
func (c *current) onSingleLineQuotedRange1(singleline interface{}) (interface{}, error) {
// eg: lines=12
return types.NewLineRange(singleline.(int), singleline.(int))
}
func (p *parser) callonSingleLineQuotedRange1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSingleLineQuotedRange1(stack["singleline"])
}
func (c *current) onUndefinedLineRange1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonUndefinedLineRange1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUndefinedLineRange1()
}
func (c *current) onTagRangesAttribute1(tags interface{}) (interface{}, error) {
//TODO: check if 'tags'/'tag' is allowed for both single and multiple values
return types.NewTagRangesAttribute(tags.([]interface{}))
}
func (p *parser) callonTagRangesAttribute1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTagRangesAttribute1(stack["tags"])
}
func (c *current) onTagRangesAttributeValue1(value interface{}) (interface{}, error) {
return value, nil
}
func (p *parser) callonTagRangesAttributeValue1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTagRangesAttributeValue1(stack["value"])
}
func (c *current) onMultipleTagRanges7(other interface{}) (interface{}, error) {
return other, nil
}
func (p *parser) callonMultipleTagRanges7() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMultipleTagRanges7(stack["other"])
}
func (c *current) onMultipleTagRanges1(first, others interface{}) (interface{}, error) {
return append([]interface{}{first}, others.([]interface{})...), nil
}
func (p *parser) callonMultipleTagRanges1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onMultipleTagRanges1(stack["first"], stack["others"])
}
func (c *current) onTagRange2(tag interface{}) (interface{}, error) {
return types.NewTagRange(tag.(string), true)
}
func (p *parser) callonTagRange2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTagRange2(stack["tag"])
}
func (c *current) onTagRange7(tag interface{}) (interface{}, error) {
return types.NewTagRange(tag.(string), false)
}
func (p *parser) callonTagRange7() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTagRange7(stack["tag"])
}
func (c *current) onTagWildcard4() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonTagWildcard4() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTagWildcard4()
}
func (c *current) onTagWildcard7(stars interface{}) (bool, error) {
// use a predicate to make sure that only `*` and `**` are allowed
return len(stars.(string)) <= 2, nil
}
func (p *parser) callonTagWildcard7() (bool, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTagWildcard7(stack["stars"])
}
func (c *current) onTagWildcard1(stars interface{}) (interface{}, error) {
return stars, nil
}
func (p *parser) callonTagWildcard1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTagWildcard1(stack["stars"])
}
func (c *current) onIncludedFileLine8() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonIncludedFileLine8() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onIncludedFileLine8()
}
func (c *current) onIncludedFileLine1(content interface{}) (interface{}, error) {
return types.NewIncludedFileLine(content.([]interface{}))
}
func (p *parser) callonIncludedFileLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onIncludedFileLine1(stack["content"])
}
func (c *current) onIncludedFileStartTag5() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonIncludedFileStartTag5() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onIncludedFileStartTag5()
}
func (c *current) onIncludedFileStartTag1(tag interface{}) (interface{}, error) {
return types.NewIncludedFileStartTag(tag.(string))
}
func (p *parser) callonIncludedFileStartTag1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onIncludedFileStartTag1(stack["tag"])
}
func (c *current) onIncludedFileEndTag5() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonIncludedFileEndTag5() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onIncludedFileEndTag5()
}
func (c *current) onIncludedFileEndTag1(tag interface{}) (interface{}, error) {
return types.NewIncludedFileEndTag(tag.(string))
}
func (p *parser) callonIncludedFileEndTag1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onIncludedFileEndTag1(stack["tag"])
}
func (c *current) onListParagraph2(comment interface{}) (interface{}, error) {
return comment, nil
}
func (p *parser) callonListParagraph2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onListParagraph2(stack["comment"])
}
func (c *current) onListParagraph5(lines interface{}) (interface{}, error) {
return types.NewParagraph(lines.([]interface{}), nil)
}
func (p *parser) callonListParagraph5() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onListParagraph5(stack["lines"])
}
func (c *current) onListParagraphLine24(elements, linebreak interface{}) (interface{}, error) {
// absorbs heading and trailing spaces
return types.NewInlineElements(append(elements.([]interface{}), linebreak))
}
func (p *parser) callonListParagraphLine24() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onListParagraphLine24(stack["elements"], stack["linebreak"])
}
func (c *current) onListParagraphLine1(line interface{}) (interface{}, error) {
return line, nil
}
func (p *parser) callonListParagraphLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onListParagraphLine1(stack["line"])
}
func (c *current) onContinuedListItemElement1(blanklines, element interface{}) (interface{}, error) {
return types.NewContinuedListItemElement(-len(blanklines.([]interface{})), element) // offset is negative
}
func (p *parser) callonContinuedListItemElement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onContinuedListItemElement1(stack["blanklines"], stack["element"])
}
func (c *current) onContinuedListItemBlock1(block interface{}) (interface{}, error) {
return block, nil
}
func (p *parser) callonContinuedListItemBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onContinuedListItemBlock1(stack["block"])
}
func (c *current) onOrderedListItem1(attributes, prefix, content interface{}) (interface{}, error) {
return types.NewOrderedListItem(prefix.(types.OrderedListItemPrefix), content.([]interface{}), attributes)
}
func (p *parser) callonOrderedListItem1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOrderedListItem1(stack["attributes"], stack["prefix"], stack["content"])
}
func (c *current) onOrderedListItemPrefix10() (interface{}, error) {
// `.` is 1, etc.
return (len(c.text)), nil
}
func (p *parser) callonOrderedListItemPrefix10() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOrderedListItemPrefix10()
}
func (c *current) onOrderedListItemPrefix13(depth interface{}) (bool, error) {
// use a predicate to make sure that only `.` to `.....` are allowed
return depth.(int) <= 5, nil
}
func (p *parser) callonOrderedListItemPrefix13() (bool, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOrderedListItemPrefix13(stack["depth"])
}
func (c *current) onOrderedListItemPrefix7(depth interface{}) (interface{}, error) {
switch depth.(int) {
case 1:
return types.NewOrderedListItemPrefix(types.Arabic, 1)
case 2:
return types.NewOrderedListItemPrefix(types.LowerAlpha, 2)
case 3:
return types.NewOrderedListItemPrefix(types.LowerRoman, 3)
case 4:
return types.NewOrderedListItemPrefix(types.UpperAlpha, 4)
default:
return types.NewOrderedListItemPrefix(types.UpperRoman, 5)
}
}
func (p *parser) callonOrderedListItemPrefix7() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOrderedListItemPrefix7(stack["depth"])
}
func (c *current) onOrderedListItemPrefix14() (interface{}, error) {
// numbering style: "1."
return types.NewOrderedListItemPrefix(types.Arabic, 1)
}
func (p *parser) callonOrderedListItemPrefix14() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOrderedListItemPrefix14()
}
func (c *current) onOrderedListItemPrefix19() (interface{}, error) {
// numbering style: "a."
return types.NewOrderedListItemPrefix(types.LowerAlpha, 1)
}
func (p *parser) callonOrderedListItemPrefix19() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOrderedListItemPrefix19()
}
func (c *current) onOrderedListItemPrefix23() (interface{}, error) {
// numbering style: "A."
return types.NewOrderedListItemPrefix(types.UpperAlpha, 1)
}
func (p *parser) callonOrderedListItemPrefix23() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOrderedListItemPrefix23()
}
func (c *current) onOrderedListItemPrefix27() (interface{}, error) {
// numbering style: "i)"
return types.NewOrderedListItemPrefix(types.LowerRoman, 1)
}
func (p *parser) callonOrderedListItemPrefix27() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOrderedListItemPrefix27()
}
func (c *current) onOrderedListItemPrefix32() (interface{}, error) {
// numbering style: "I)"
return types.NewOrderedListItemPrefix(types.UpperRoman, 1)
}
func (p *parser) callonOrderedListItemPrefix32() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOrderedListItemPrefix32()
}
func (c *current) onOrderedListItemPrefix1(prefix interface{}) (interface{}, error) {
return prefix, nil
}
func (p *parser) callonOrderedListItemPrefix1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOrderedListItemPrefix1(stack["prefix"])
}
func (c *current) onOrderedListItemContent1(elements interface{}) (interface{}, error) {
return types.NewListItemContent(elements.([]interface{}))
}
func (p *parser) callonOrderedListItemContent1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOrderedListItemContent1(stack["elements"])
}
func (c *current) onUnorderedListItem1(attributes, prefix, checkstyle, content interface{}) (interface{}, error) {
return types.NewUnorderedListItem(prefix.(types.UnorderedListItemPrefix), checkstyle, content.([]interface{}), attributes)
}
func (p *parser) callonUnorderedListItem1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUnorderedListItem1(stack["attributes"], stack["prefix"], stack["checkstyle"], stack["content"])
}
func (c *current) onUnorderedListItemPrefix10() (interface{}, error) {
// `*` is 1, etc.
return (len(c.text)), nil
}
func (p *parser) callonUnorderedListItemPrefix10() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUnorderedListItemPrefix10()
}
func (c *current) onUnorderedListItemPrefix13(depth interface{}) (bool, error) {
// use a predicate to make sure that only `*` to `*****` are allowed
return depth.(int) <= 5, nil
}
func (p *parser) callonUnorderedListItemPrefix13() (bool, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUnorderedListItemPrefix13(stack["depth"])
}
func (c *current) onUnorderedListItemPrefix7(depth interface{}) (interface{}, error) {
switch depth.(int) {
case 1:
return types.NewUnorderedListItemPrefix(types.OneAsterisk, 1)
case 2:
return types.NewUnorderedListItemPrefix(types.TwoAsterisks, 2)
case 3:
return types.NewUnorderedListItemPrefix(types.ThreeAsterisks, 3)
case 4:
return types.NewUnorderedListItemPrefix(types.FourAsterisks, 4)
default:
return types.NewUnorderedListItemPrefix(types.FiveAsterisks, 5)
}
}
func (p *parser) callonUnorderedListItemPrefix7() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUnorderedListItemPrefix7(stack["depth"])
}
func (c *current) onUnorderedListItemPrefix15() (interface{}, error) {
return types.NewUnorderedListItemPrefix(types.Dash, 1)
}
func (p *parser) callonUnorderedListItemPrefix15() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUnorderedListItemPrefix15()
}
func (c *current) onUnorderedListItemPrefix1(prefix interface{}) (interface{}, error) {
return prefix, nil
}
func (p *parser) callonUnorderedListItemPrefix1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUnorderedListItemPrefix1(stack["prefix"])
}
func (c *current) onUnorderedListItemCheckStyle7() (interface{}, error) {
return types.Unchecked, nil
}
func (p *parser) callonUnorderedListItemCheckStyle7() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUnorderedListItemCheckStyle7()
}
func (c *current) onUnorderedListItemCheckStyle9() (interface{}, error) {
return types.Checked, nil
}
func (p *parser) callonUnorderedListItemCheckStyle9() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUnorderedListItemCheckStyle9()
}
func (c *current) onUnorderedListItemCheckStyle11() (interface{}, error) {
return types.Checked, nil
}
func (p *parser) callonUnorderedListItemCheckStyle11() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUnorderedListItemCheckStyle11()
}
func (c *current) onUnorderedListItemCheckStyle1(style interface{}) (interface{}, error) {
return style, nil
}
func (p *parser) callonUnorderedListItemCheckStyle1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUnorderedListItemCheckStyle1(stack["style"])
}
func (c *current) onUnorderedListItemContent1(elements interface{}) (interface{}, error) {
// Another list or a literal paragraph immediately following a list item will be implicitly included in the list item
return types.NewListItemContent(elements.([]interface{}))
}
func (p *parser) callonUnorderedListItemContent1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onUnorderedListItemContent1(stack["elements"])
}
func (c *current) onLabeledListItem1(attributes, term, separator, description interface{}) (interface{}, error) {
return types.NewLabeledListItem(len(separator.(string))-1, term.([]interface{}), description, attributes)
}
func (p *parser) callonLabeledListItem1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLabeledListItem1(stack["attributes"], stack["term"], stack["separator"], stack["description"])
}
func (c *current) onSimpleLabeledListItemTerm3() (interface{}, error) {
return types.NewStringElement(strings.TrimSpace(string(c.text)))
}
func (p *parser) callonSimpleLabeledListItemTerm3() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSimpleLabeledListItemTerm3()
}
func (c *current) onSimpleLabeledListItemTerm1(content interface{}) (interface{}, error) {
return types.NewInlineElements(content)
}
func (p *parser) callonSimpleLabeledListItemTerm1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSimpleLabeledListItemTerm1(stack["content"])
}
func (c *current) onLabeledListItemTerm1(elements interface{}) (interface{}, error) {
// absorbs heading and trailing spaces
return types.NewInlineElements(elements.([]interface{}))
}
func (p *parser) callonLabeledListItemTerm1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLabeledListItemTerm1(stack["elements"])
}
func (c *current) onLabeledListItemTermElement1(element interface{}) (interface{}, error) {
return element, nil
}
func (p *parser) callonLabeledListItemTermElement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLabeledListItemTermElement1(stack["element"])
}
func (c *current) onLabeledListItemSeparator4() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonLabeledListItemSeparator4() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLabeledListItemSeparator4()
}
func (c *current) onLabeledListItemSeparator7(separator interface{}) (bool, error) {
// use a predicate to make sure that only `::` to `::::` are allowed
return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil
}
func (p *parser) callonLabeledListItemSeparator7() (bool, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLabeledListItemSeparator7(stack["separator"])
}
func (c *current) onLabeledListItemSeparator1(separator interface{}) (interface{}, error) {
return separator, nil
}
func (p *parser) callonLabeledListItemSeparator1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLabeledListItemSeparator1(stack["separator"])
}
func (c *current) onLabeledListItemDescription1(elements interface{}) (interface{}, error) {
return types.NewListItemContent(elements.([]interface{}))
}
func (p *parser) callonLabeledListItemDescription1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLabeledListItemDescription1(stack["elements"])
}
func (c *current) onAdmonitionKind2() (interface{}, error) {
return types.Tip, nil
}
func (p *parser) callonAdmonitionKind2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAdmonitionKind2()
}
func (c *current) onAdmonitionKind4() (interface{}, error) {
return types.Note, nil
}
func (p *parser) callonAdmonitionKind4() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAdmonitionKind4()
}
func (c *current) onAdmonitionKind6() (interface{}, error) {
return types.Important, nil
}
func (p *parser) callonAdmonitionKind6() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAdmonitionKind6()
}
func (c *current) onAdmonitionKind8() (interface{}, error) {
return types.Warning, nil
}
func (p *parser) callonAdmonitionKind8() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAdmonitionKind8()
}
func (c *current) onAdmonitionKind10() (interface{}, error) {
return types.Caution, nil
}
func (p *parser) callonAdmonitionKind10() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAdmonitionKind10()
}
func (c *current) onParagraph2(attributes, t, lines interface{}) (interface{}, error) {
return types.NewAdmonitionParagraph(lines.([]interface{}), t.(types.AdmonitionKind), attributes)
}
func (p *parser) callonParagraph2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraph2(stack["attributes"], stack["t"], stack["lines"])
}
func (c *current) onParagraph13(attributes, lines interface{}) (interface{}, error) {
return types.NewParagraph(lines.([]interface{}), attributes)
}
func (p *parser) callonParagraph13() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraph13(stack["attributes"], stack["lines"])
}
func (c *current) onSimpleParagraph6(attributes interface{}) (bool, error) {
// skip if the '[literal]' attribute was set on this paragraph
if attrs, ok := attributes.(types.ElementAttributes); ok {
kind, found := attrs[types.AttrKind]
return !found || kind != types.Literal, nil
}
return true, nil
}
func (p *parser) callonSimpleParagraph6() (bool, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSimpleParagraph6(stack["attributes"])
}
func (c *current) onSimpleParagraph1(attributes, firstLine, otherLines interface{}) (interface{}, error) {
return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...), attributes)
}
func (p *parser) callonSimpleParagraph1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSimpleParagraph1(stack["attributes"], stack["firstLine"], stack["otherLines"])
}
func (c *current) onContinuedParagraph2(attributes, t, lines interface{}) (interface{}, error) {
return types.NewAdmonitionParagraph(lines.([]interface{}), t.(types.AdmonitionKind), attributes)
}
func (p *parser) callonContinuedParagraph2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onContinuedParagraph2(stack["attributes"], stack["t"], stack["lines"])
}
func (c *current) onContinuedParagraph12(attributes, lines interface{}) (interface{}, error) {
return types.NewParagraph(lines.([]interface{}), attributes)
}
func (p *parser) callonContinuedParagraph12() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onContinuedParagraph12(stack["attributes"], stack["lines"])
}
func (c *current) onContinuedParagraphLines1(firstLine, otherLines interface{}) (interface{}, error) {
return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil
}
func (p *parser) callonContinuedParagraphLines1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onContinuedParagraphLines1(stack["firstLine"], stack["otherLines"])
}
func (c *current) onFirstParagraphLine1(elements, linebreak interface{}) (interface{}, error) {
return types.NewInlineElements(append(elements.([]interface{}), linebreak))
}
func (p *parser) callonFirstParagraphLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onFirstParagraphLine1(stack["elements"], stack["linebreak"])
}
func (c *current) onOtherParagraphLine1(elements interface{}) (interface{}, error) {
return elements, nil
}
func (p *parser) callonOtherParagraphLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOtherParagraphLine1(stack["elements"])
}
func (c *current) onVerseParagraph7(attributes interface{}) (bool, error) {
if attrs, ok := attributes.(types.ElementAttributes); ok {
kind, ok := attrs[types.AttrKind]
return ok && kind == types.Verse, nil
}
return false, nil
}
func (p *parser) callonVerseParagraph7() (bool, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerseParagraph7(stack["attributes"])
}
func (c *current) onVerseParagraph2(attributes, t, lines interface{}) (interface{}, error) {
return types.NewAdmonitionParagraph(lines.([]interface{}), t.(types.AdmonitionKind), attributes)
}
func (p *parser) callonVerseParagraph2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerseParagraph2(stack["attributes"], stack["t"], stack["lines"])
}
func (c *current) onVerseParagraph19(attributes interface{}) (bool, error) {
if attrs, ok := attributes.(types.ElementAttributes); ok {
kind, ok := attrs[types.AttrKind]
return ok && kind == types.Verse, nil
}
return false, nil
}
func (p *parser) callonVerseParagraph19() (bool, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerseParagraph19(stack["attributes"])
}
func (c *current) onVerseParagraph14(attributes, lines interface{}) (interface{}, error) {
return types.NewParagraph(lines.([]interface{}), attributes)
}
func (p *parser) callonVerseParagraph14() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerseParagraph14(stack["attributes"], stack["lines"])
}
func (c *current) onInlineElements9(comment interface{}) (interface{}, error) {
return types.NewInlineElements([]interface{}{comment})
}
func (p *parser) callonInlineElements9() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInlineElements9(stack["comment"])
}
func (c *current) onInlineElements12(elements, linebreak interface{}) (interface{}, error) {
return types.NewInlineElements(append(elements.([]interface{}), linebreak))
}
func (p *parser) callonInlineElements12() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInlineElements12(stack["elements"], stack["linebreak"])
}
func (c *current) onInlineElements1(elements interface{}) (interface{}, error) {
return elements, nil
}
func (p *parser) callonInlineElements1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInlineElements1(stack["elements"])
}
func (c *current) onInlineElement1(element interface{}) (interface{}, error) {
return element, nil
}
func (p *parser) callonInlineElement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInlineElement1(stack["element"])
}
func (c *current) onInlineElementsWithoutSubtitution1(elements, linebreak interface{}) (interface{}, error) {
return types.NewInlineElements(append(elements.([]interface{}), linebreak))
}
func (p *parser) callonInlineElementsWithoutSubtitution1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInlineElementsWithoutSubtitution1(stack["elements"], stack["linebreak"])
}
func (c *current) onInlineElementWithoutSubtitution1(element interface{}) (interface{}, error) {
return element, nil
}
func (p *parser) callonInlineElementWithoutSubtitution1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInlineElementWithoutSubtitution1(stack["element"])
}
func (c *current) onVerbatimParagraph8(line interface{}) (interface{}, error) {
return line, nil
}
func (p *parser) callonVerbatimParagraph8() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerbatimParagraph8(stack["line"])
}
func (c *current) onVerbatimParagraph1(attributes, lines interface{}) (interface{}, error) {
return types.NewParagraph(lines.([]interface{}), attributes)
}
func (p *parser) callonVerbatimParagraph1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerbatimParagraph1(stack["attributes"], stack["lines"])
}
func (c *current) onVerbatimParagraphLine1(elements, linebreak interface{}) (interface{}, error) {
return types.NewInlineElements(append(elements.([]interface{}), linebreak))
}
func (p *parser) callonVerbatimParagraphLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerbatimParagraphLine1(stack["elements"], stack["linebreak"])
}
func (c *current) onVerbatimParagraphLineElement1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonVerbatimParagraphLineElement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerbatimParagraphLineElement1()
}
func (c *current) onLineBreak1() (interface{}, error) {
return types.NewLineBreak()
}
func (p *parser) callonLineBreak1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLineBreak1()
}
func (c *current) onConstrainedQuotedText1(text interface{}) (interface{}, error) {
// if a '^' or '~' is alone (ie, badly formatted superscript or subscript, then accept it as-is)
return text, nil
}
func (p *parser) callonConstrainedQuotedText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onConstrainedQuotedText1(stack["text"])
}
func (c *current) onSubscriptOrSuperscriptPrefix3() (interface{}, error) {
// rule used withn `words` to detect superscript or subscript portions, eg in math formulae.
return string(c.text), nil
}
func (p *parser) callonSubscriptOrSuperscriptPrefix3() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSubscriptOrSuperscriptPrefix3()
}
func (c *current) onOneOrMoreBackslashes1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonOneOrMoreBackslashes1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onOneOrMoreBackslashes1()
}
func (c *current) onTwoOrMoreBackslashes1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonTwoOrMoreBackslashes1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTwoOrMoreBackslashes1()
}
func (c *current) onDoubleQuoteBoldText1(elements interface{}) (interface{}, error) {
return types.NewQuotedText(types.Bold, elements.([]interface{}))
}
func (p *parser) callonDoubleQuoteBoldText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDoubleQuoteBoldText1(stack["elements"])
}
func (c *current) onDoubleQuoteBoldTextElement1(element interface{}) (interface{}, error) {
// word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop
return element, nil
}
func (p *parser) callonDoubleQuoteBoldTextElement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDoubleQuoteBoldTextElement1(stack["element"])
}
func (c *current) onNonDoubleQuoteBoldText1() (interface{}, error) {
return types.NewStringElement(string(c.text))
}
func (p *parser) callonNonDoubleQuoteBoldText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onNonDoubleQuoteBoldText1()
}
func (c *current) onSingleQuoteBoldText2(elements interface{}) (interface{}, error) {
// single punctuation cannot be followed by a character (needs '**' to emphazise a portion of a word)
return types.NewQuotedText(types.Bold, elements.([]interface{}))
}
func (p *parser) callonSingleQuoteBoldText2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSingleQuoteBoldText2(stack["elements"])
}
func (c *current) onSingleQuoteBoldText12(elements interface{}) (interface{}, error) {
// unbalanced `**` vs `*` punctuation.
return types.NewQuotedText(types.Bold, elements.([]interface{})) // include the second heading `*` as a regular StringElement in the bold content
}
func (p *parser) callonSingleQuoteBoldText12() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSingleQuoteBoldText12(stack["elements"])
}
func (c *current) onSingleQuoteBoldTextElement1(element interface{}) (interface{}, error) {
// word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop
return element, nil
}
func (p *parser) callonSingleQuoteBoldTextElement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSingleQuoteBoldTextElement1(stack["element"])
}
func (c *current) onNonSingleQuoteBoldText1() (interface{}, error) {
return types.NewStringElement(string(c.text))
}
func (p *parser) callonNonSingleQuoteBoldText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onNonSingleQuoteBoldText1()
}
func (c *current) onEscapedBoldText2(backslashes, elements interface{}) (interface{}, error) {
// double punctuation must be evaluated first
return types.NewEscapedQuotedText(backslashes.(string), "**", elements.([]interface{}))
}
func (p *parser) callonEscapedBoldText2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onEscapedBoldText2(stack["backslashes"], stack["elements"])
}
func (c *current) onEscapedBoldText10(backslashes, elements interface{}) (interface{}, error) {
// unbalanced `**` vs `*` punctuation
result := append([]interface{}{"*"}, elements.([]interface{}))
return types.NewEscapedQuotedText(backslashes.(string), "*", result)
}
func (p *parser) callonEscapedBoldText10() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onEscapedBoldText10(stack["backslashes"], stack["elements"])
}
func (c *current) onEscapedBoldText18(backslashes, elements interface{}) (interface{}, error) {
// simple punctuation must be evaluated last
return types.NewEscapedQuotedText(backslashes.(string), "*", elements.([]interface{}))
}
func (p *parser) callonEscapedBoldText18() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onEscapedBoldText18(stack["backslashes"], stack["elements"])
}
func (c *current) onDoubleQuoteItalicText1(elements interface{}) (interface{}, error) {
// double punctuation must be evaluated first
return types.NewQuotedText(types.Italic, elements.([]interface{}))
}
func (p *parser) callonDoubleQuoteItalicText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDoubleQuoteItalicText1(stack["elements"])
}
func (c *current) onDoubleQuoteItalicTextElement1(element interface{}) (interface{}, error) {
// word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop
return element, nil
}
func (p *parser) callonDoubleQuoteItalicTextElement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDoubleQuoteItalicTextElement1(stack["element"])
}
func (c *current) onNonDoubleQuoteItalicText1() (interface{}, error) {
return types.NewStringElement(string(c.text))
}
func (p *parser) callonNonDoubleQuoteItalicText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onNonDoubleQuoteItalicText1()
}
func (c *current) onSingleQuoteItalicText2(elements interface{}) (interface{}, error) {
// single punctuation cannot be followed by a character (needs '__' to emphazise a portion of a word)
return types.NewQuotedText(types.Italic, elements.([]interface{}))
}
func (p *parser) callonSingleQuoteItalicText2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSingleQuoteItalicText2(stack["elements"])
}
func (c *current) onSingleQuoteItalicText12(elements interface{}) (interface{}, error) {
// unbalanced `__` vs `_` punctuation.
return types.NewQuotedText(types.Italic, elements.([]interface{})) // include the second heading `_` as a regular StringElement in the italic content
}
func (p *parser) callonSingleQuoteItalicText12() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSingleQuoteItalicText12(stack["elements"])
}
func (c *current) onSingleQuoteItalicTextElement1(element interface{}) (interface{}, error) {
// word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop
return element, nil
}
func (p *parser) callonSingleQuoteItalicTextElement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSingleQuoteItalicTextElement1(stack["element"])
}
func (c *current) onNonSingleQuoteItalicText1() (interface{}, error) {
return types.NewStringElement(string(c.text))
}
func (p *parser) callonNonSingleQuoteItalicText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onNonSingleQuoteItalicText1()
}
func (c *current) onEscapedItalicText2(backslashes, elements interface{}) (interface{}, error) {
// double punctuation must be evaluated first
return types.NewEscapedQuotedText(backslashes.(string), "__", elements.([]interface{}))
}
func (p *parser) callonEscapedItalicText2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onEscapedItalicText2(stack["backslashes"], stack["elements"])
}
func (c *current) onEscapedItalicText10(backslashes, elements interface{}) (interface{}, error) {
// unbalanced `__` vs `_` punctuation
result := append([]interface{}{"_"}, elements.([]interface{}))
return types.NewEscapedQuotedText(backslashes.(string), "_", result)
}
func (p *parser) callonEscapedItalicText10() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onEscapedItalicText10(stack["backslashes"], stack["elements"])
}
func (c *current) onEscapedItalicText18(backslashes, elements interface{}) (interface{}, error) {
// simple punctuation must be evaluated last
return types.NewEscapedQuotedText(backslashes.(string), "_", elements.([]interface{}))
}
func (p *parser) callonEscapedItalicText18() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onEscapedItalicText18(stack["backslashes"], stack["elements"])
}
func (c *current) onDoubleQuoteMonospaceText1(elements interface{}) (interface{}, error) {
// double punctuation must be evaluated first
return types.NewQuotedText(types.Monospace, elements.([]interface{}))
}
func (p *parser) callonDoubleQuoteMonospaceText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDoubleQuoteMonospaceText1(stack["elements"])
}
func (c *current) onDoubleQuoteMonospaceTextElement1(element interface{}) (interface{}, error) {
// word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop
return element, nil
}
func (p *parser) callonDoubleQuoteMonospaceTextElement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDoubleQuoteMonospaceTextElement1(stack["element"])
}
func (c *current) onNonDoubleQuoteMonospaceText1() (interface{}, error) {
return types.NewStringElement(string(c.text))
}
func (p *parser) callonNonDoubleQuoteMonospaceText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onNonDoubleQuoteMonospaceText1()
}
func (c *current) onSingleQuoteMonospaceText2(elements interface{}) (interface{}, error) {
// single punctuation cannot be followed by a character (needs "``" to emphazise a portion of a word)
return types.NewQuotedText(types.Monospace, elements.([]interface{}))
}
func (p *parser) callonSingleQuoteMonospaceText2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSingleQuoteMonospaceText2(stack["elements"])
}
func (c *current) onSingleQuoteMonospaceText12(elements interface{}) (interface{}, error) {
// unbalanced "``" vs "`" punctuation.
return types.NewQuotedText(types.Monospace, elements.([]interface{})) // include the second heading "`" as a regular StringElement in the monospace content
}
func (p *parser) callonSingleQuoteMonospaceText12() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSingleQuoteMonospaceText12(stack["elements"])
}
func (c *current) onSingleQuoteMonospaceTextElement1(element interface{}) (interface{}, error) {
// word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop
return element, nil
}
func (p *parser) callonSingleQuoteMonospaceTextElement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSingleQuoteMonospaceTextElement1(stack["element"])
}
func (c *current) onNonSingleQuoteMonospaceText1() (interface{}, error) {
// break at multiline
return types.NewStringElement(string(c.text))
}
func (p *parser) callonNonSingleQuoteMonospaceText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onNonSingleQuoteMonospaceText1()
}
func (c *current) onEscapedMonospaceText2(backslashes, elements interface{}) (interface{}, error) {
// double punctuation must be evaluated first
return types.NewEscapedQuotedText(backslashes.(string), "``", elements.([]interface{}))
}
func (p *parser) callonEscapedMonospaceText2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onEscapedMonospaceText2(stack["backslashes"], stack["elements"])
}
func (c *current) onEscapedMonospaceText10(backslashes, elements interface{}) (interface{}, error) {
// unbalanced "``" vs "`" punctuation
result := append([]interface{}{"`"}, elements.([]interface{}))
return types.NewEscapedQuotedText(backslashes.(string), "`", result)
}
func (p *parser) callonEscapedMonospaceText10() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onEscapedMonospaceText10(stack["backslashes"], stack["elements"])
}
func (c *current) onEscapedMonospaceText18(backslashes, elements interface{}) (interface{}, error) {
// simple punctuation must be evaluated last
return types.NewEscapedQuotedText(backslashes.(string), "`", elements.([]interface{}))
}
func (p *parser) callonEscapedMonospaceText18() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onEscapedMonospaceText18(stack["backslashes"], stack["elements"])
}
func (c *current) onSubscriptText1(element interface{}) (interface{}, error) {
// wraps a single word
return types.NewQuotedText(types.Subscript, element)
}
func (p *parser) callonSubscriptText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSubscriptText1(stack["element"])
}
func (c *current) onNonSubscriptText1() (interface{}, error) {
return c.text, nil
}
func (p *parser) callonNonSubscriptText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onNonSubscriptText1()
}
func (c *current) onEscapedSubscriptText1(backslashes, element interface{}) (interface{}, error) {
// simple punctuation must be evaluated last
return types.NewEscapedQuotedText(backslashes.(string), "~", element)
}
func (p *parser) callonEscapedSubscriptText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onEscapedSubscriptText1(stack["backslashes"], stack["element"])
}
func (c *current) onSuperscriptText1(element interface{}) (interface{}, error) {
// wraps a single word
return types.NewQuotedText(types.Superscript, element)
}
func (p *parser) callonSuperscriptText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSuperscriptText1(stack["element"])
}
func (c *current) onNonSuperscriptText1() (interface{}, error) {
return c.text, nil
}
func (p *parser) callonNonSuperscriptText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onNonSuperscriptText1()
}
func (c *current) onEscapedSuperscriptText1(backslashes, element interface{}) (interface{}, error) {
// simple punctuation must be evaluated last
return types.NewEscapedQuotedText(backslashes.(string), "^", element)
}
func (p *parser) callonEscapedSuperscriptText1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onEscapedSuperscriptText1(stack["backslashes"], stack["element"])
}
func (c *current) onSinglePlusPassthrough1(content interface{}) (interface{}, error) {
return types.NewPassthrough(types.SinglePlusPassthrough, []interface{}{content})
}
func (p *parser) callonSinglePlusPassthrough1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSinglePlusPassthrough1(stack["content"])
}
func (c *current) onSinglePlusPassthroughContent2() (interface{}, error) {
// no space in the first or last position of the content, but allowed elsewhere
return types.NewStringElement(string(c.text))
}
func (p *parser) callonSinglePlusPassthroughContent2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSinglePlusPassthroughContent2()
}
func (c *current) onSinglePlusPassthroughContent24() (interface{}, error) {
// a single character
return types.NewStringElement(string(c.text))
}
func (p *parser) callonSinglePlusPassthroughContent24() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSinglePlusPassthroughContent24()
}
func (c *current) onTriplePlusPassthrough1(content interface{}) (interface{}, error) {
return types.NewPassthrough(types.TriplePlusPassthrough, []interface{}{content})
}
func (p *parser) callonTriplePlusPassthrough1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTriplePlusPassthrough1(stack["content"])
}
func (c *current) onTriplePlusPassthroughContent2() (interface{}, error) {
// spaces and newlines are also allowed in the first or last position of the content and elsewhere too
return types.NewStringElement(string(c.text))
}
func (p *parser) callonTriplePlusPassthroughContent2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTriplePlusPassthroughContent2()
}
func (c *current) onTriplePlusPassthroughContent8() (interface{}, error) {
// a single character
return types.NewStringElement(string(c.text))
}
func (p *parser) callonTriplePlusPassthroughContent8() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTriplePlusPassthroughContent8()
}
func (c *current) onPassthroughMacro2(content interface{}) (interface{}, error) {
return types.NewPassthrough(types.PassthroughMacro, []interface{}{content})
}
func (p *parser) callonPassthroughMacro2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPassthroughMacro2(stack["content"])
}
func (c *current) onPassthroughMacro9(content interface{}) (interface{}, error) {
return types.NewPassthrough(types.PassthroughMacro, content.([]interface{}))
}
func (p *parser) callonPassthroughMacro9() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPassthroughMacro9(stack["content"])
}
func (c *current) onPassthroughMacroCharacter4() (interface{}, error) {
return types.NewStringElement(string(c.text))
}
func (p *parser) callonPassthroughMacroCharacter4() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onPassthroughMacroCharacter4()
}
func (c *current) onInternalCrossReference2(id, label interface{}) (interface{}, error) {
return types.NewInternalCrossReference(id.(string), label.(string))
}
func (p *parser) callonInternalCrossReference2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInternalCrossReference2(stack["id"], stack["label"])
}
func (c *current) onInternalCrossReference13(id interface{}) (interface{}, error) {
return types.NewInternalCrossReference(id.(string), nil)
}
func (p *parser) callonInternalCrossReference13() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInternalCrossReference13(stack["id"])
}
func (c *current) onExternalCrossReference1(url, inlineAttributes interface{}) (interface{}, error) {
return types.NewExternalCrossReference(url.(types.Location), inlineAttributes.(types.ElementAttributes))
}
func (p *parser) callonExternalCrossReference1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onExternalCrossReference1(stack["url"], stack["inlineAttributes"])
}
func (c *current) onCrossReferenceLabel1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonCrossReferenceLabel1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onCrossReferenceLabel1()
}
func (c *current) onRelativeLink1(url, inlineAttributes interface{}) (interface{}, error) {
return types.NewInlineLink(url.(types.Location), inlineAttributes.(types.ElementAttributes))
}
func (p *parser) callonRelativeLink1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onRelativeLink1(stack["url"], stack["inlineAttributes"])
}
func (c *current) onExternalLink1(url, inlineAttributes interface{}) (interface{}, error) {
return types.NewInlineLink(url.(types.Location), inlineAttributes)
}
func (p *parser) callonExternalLink1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onExternalLink1(stack["url"], stack["inlineAttributes"])
}
func (c *current) onTextOnlyLinkAttributes7(elements interface{}) (interface{}, error) {
return types.NewInlineElements(elements.([]interface{}))
}
func (p *parser) callonTextOnlyLinkAttributes7() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTextOnlyLinkAttributes7(stack["elements"])
}
func (c *current) onTextOnlyLinkAttributes28(elements interface{}) (interface{}, error) {
return types.NewInlineElements(elements.([]interface{}))
}
func (p *parser) callonTextOnlyLinkAttributes28() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTextOnlyLinkAttributes28(stack["elements"])
}
func (c *current) onTextOnlyLinkAttributes1(text interface{}) (interface{}, error) {
return types.NewInlineLinkAttributes(text, nil)
}
func (p *parser) callonTextOnlyLinkAttributes1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTextOnlyLinkAttributes1(stack["text"])
}
func (c *current) onTextAndMoreLinkAttributes7(elements interface{}) (interface{}, error) {
return types.NewInlineElements(elements.([]interface{}))
}
func (p *parser) callonTextAndMoreLinkAttributes7() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTextAndMoreLinkAttributes7(stack["elements"])
}
func (c *current) onTextAndMoreLinkAttributes26(elements interface{}) (interface{}, error) {
return types.NewInlineElements(elements.([]interface{}))
}
func (p *parser) callonTextAndMoreLinkAttributes26() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTextAndMoreLinkAttributes26(stack["elements"])
}
func (c *current) onTextAndMoreLinkAttributes1(text, otherattrs interface{}) (interface{}, error) {
return types.NewInlineLinkAttributes(text, otherattrs.([]interface{}))
}
func (p *parser) callonTextAndMoreLinkAttributes1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTextAndMoreLinkAttributes1(stack["text"], stack["otherattrs"])
}
func (c *current) onInlineLinks1(elements interface{}) (interface{}, error) {
return types.NewInlineElements(elements.([]interface{}))
}
func (p *parser) callonInlineLinks1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInlineLinks1(stack["elements"])
}
func (c *current) onResolvedRelativeLink1(url, inlineAttributes interface{}) (interface{}, error) {
return types.NewInlineLink(url.(types.Location), inlineAttributes.(types.ElementAttributes))
}
func (p *parser) callonResolvedRelativeLink1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onResolvedRelativeLink1(stack["url"], stack["inlineAttributes"])
}
func (c *current) onResolvedExternalLink1(url, inlineAttributes interface{}) (interface{}, error) {
return types.NewInlineLink(url.(types.Location), inlineAttributes)
}
func (p *parser) callonResolvedExternalLink1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onResolvedExternalLink1(stack["url"], stack["inlineAttributes"])
}
func (c *current) onExternalQuotedLink1(url, inlineAttributes interface{}) (interface{}, error) {
// here attributes are required, so we can safely use the `_` and `*` characters in the URL without messing with the bold or italic markers.
return types.NewInlineLink(url.(types.Location), inlineAttributes)
}
func (p *parser) callonExternalQuotedLink1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onExternalQuotedLink1(stack["url"], stack["inlineAttributes"])
}
func (c *current) onImageBlock1(attributes, path, inlineAttributes interface{}) (interface{}, error) {
return types.NewImageBlock(path.(types.Location), inlineAttributes.(types.ElementAttributes), attributes)
}
func (p *parser) callonImageBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onImageBlock1(stack["attributes"], stack["path"], stack["inlineAttributes"])
}
func (c *current) onInlineImage1(path, inlineAttributes interface{}) (interface{}, error) {
return types.NewInlineImage(path.(types.Location), inlineAttributes.(types.ElementAttributes))
}
func (p *parser) callonInlineImage1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInlineImage1(stack["path"], stack["inlineAttributes"])
}
func (c *current) onImageAttributes1(alt, width, height, otherattrs interface{}) (interface{}, error) {
return types.NewImageAttributes(alt, width, height, otherattrs.([]interface{}))
}
func (p *parser) callonImageAttributes1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onImageAttributes1(stack["alt"], stack["width"], stack["height"], stack["otherattrs"])
}
func (c *current) onInlineFootnote2(content interface{}) (interface{}, error) {
return types.NewFootnote("", content.([]interface{}))
}
func (p *parser) callonInlineFootnote2() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInlineFootnote2(stack["content"])
}
func (c *current) onInlineFootnote8(ref, content interface{}) (interface{}, error) {
return types.NewFootnote(ref.(string), content)
}
func (p *parser) callonInlineFootnote8() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onInlineFootnote8(stack["ref"], stack["content"])
}
func (c *current) onFootnoteRef1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonFootnoteRef1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onFootnoteRef1()
}
func (c *current) onFootnoteContent1(elements interface{}) (interface{}, error) {
// footnote content may span multiple lines
return types.NewInlineElements(elements.([]interface{}))
}
func (p *parser) callonFootnoteContent1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onFootnoteContent1(stack["elements"])
}
func (c *current) onDelimitedBlock1(block interface{}) (interface{}, error) {
return block, nil
}
func (p *parser) callonDelimitedBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDelimitedBlock1(stack["block"])
}
func (c *current) onFencedBlock1(attributes, content interface{}) (interface{}, error) {
return types.NewDelimitedBlock(types.Fenced, content.([]interface{}), types.None, attributes)
}
func (p *parser) callonFencedBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onFencedBlock1(stack["attributes"], stack["content"])
}
func (c *current) onFencedBlockParagraph1(lines interface{}) (interface{}, error) {
return types.NewParagraph(lines.([]interface{}), types.ElementAttributes{})
}
func (p *parser) callonFencedBlockParagraph1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onFencedBlockParagraph1(stack["lines"])
}
func (c *current) onFencedBlockParagraphLine1(line interface{}) (interface{}, error) {
return line, nil
}
func (p *parser) callonFencedBlockParagraphLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onFencedBlockParagraphLine1(stack["line"])
}
func (c *current) onListingBlock1(attributes, content interface{}) (interface{}, error) {
return types.NewDelimitedBlock(types.Listing, content.([]interface{}), types.None, attributes)
}
func (p *parser) callonListingBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onListingBlock1(stack["attributes"], stack["content"])
}
func (c *current) onListingBlockParagraph1(lines interface{}) (interface{}, error) {
return types.NewParagraph(lines.([]interface{}), nil) // no attributes supported
}
func (p *parser) callonListingBlockParagraph1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onListingBlockParagraph1(stack["lines"])
}
func (c *current) onListingBlockParagraphLine6() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonListingBlockParagraphLine6() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onListingBlockParagraphLine6()
}
func (c *current) onListingBlockParagraphLine1(line interface{}) (interface{}, error) {
// skip EOL in line content, and stop when quote block delimiter is encountered
return types.NewInlineElements(line)
}
func (p *parser) callonListingBlockParagraphLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onListingBlockParagraphLine1(stack["line"])
}
func (c *current) onExampleBlock1(attributes, content interface{}) (interface{}, error) {
return types.NewDelimitedBlock(types.Example, content.([]interface{}), types.None, attributes)
}
func (p *parser) callonExampleBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onExampleBlock1(stack["attributes"], stack["content"])
}
func (c *current) onExampleBlockParagraph1(lines interface{}) (interface{}, error) {
return types.NewParagraph(lines.([]interface{}), types.ElementAttributes{})
}
func (p *parser) callonExampleBlockParagraph1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onExampleBlockParagraph1(stack["lines"])
}
func (c *current) onExampleBlockParagraphLine1(line interface{}) (interface{}, error) {
return line, nil
}
func (p *parser) callonExampleBlockParagraphLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onExampleBlockParagraphLine1(stack["line"])
}
func (c *current) onQuoteBlock1(attributes, content interface{}) (interface{}, error) {
return types.NewDelimitedBlock(types.Quote, content.([]interface{}), types.None, attributes)
}
func (p *parser) callonQuoteBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onQuoteBlock1(stack["attributes"], stack["content"])
}
func (c *current) onQuoteBlockElement1(element interface{}) (interface{}, error) {
return element, nil
}
func (p *parser) callonQuoteBlockElement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onQuoteBlockElement1(stack["element"])
}
func (c *current) onQuoteBlockParagraph1(lines interface{}) (interface{}, error) {
return types.NewParagraph(lines.([]interface{}), types.ElementAttributes{})
}
func (p *parser) callonQuoteBlockParagraph1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onQuoteBlockParagraph1(stack["lines"])
}
func (c *current) onVerseBlock5(attributes interface{}) (bool, error) {
kind := attributes.(types.ElementAttributes).GetAsString("kind") // once we got the attributes, check that `[verse]` was set
return kind == "verse", nil
}
func (p *parser) callonVerseBlock5() (bool, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerseBlock5(stack["attributes"])
}
func (c *current) onVerseBlock1(attributes, content interface{}) (interface{}, error) {
return types.NewDelimitedBlock(types.Verse, content.([]interface{}), types.None, attributes)
}
func (p *parser) callonVerseBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerseBlock1(stack["attributes"], stack["content"])
}
func (c *current) onVerseFileInclude1(include interface{}) (interface{}, error) {
return include, nil
}
func (p *parser) callonVerseFileInclude1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerseFileInclude1(stack["include"])
}
func (c *current) onVerseBlockParagraph1(lines interface{}) (interface{}, error) {
return types.NewParagraph(lines.([]interface{}), nil)
}
func (p *parser) callonVerseBlockParagraph1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerseBlockParagraph1(stack["lines"])
}
func (c *current) onVerseBlockParagraphLine8(elements interface{}) (interface{}, error) {
return types.NewInlineElements(elements.([]interface{}))
}
func (p *parser) callonVerseBlockParagraphLine8() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerseBlockParagraphLine8(stack["elements"])
}
func (c *current) onVerseBlockParagraphLine1(line interface{}) (interface{}, error) {
return line, nil
}
func (p *parser) callonVerseBlockParagraphLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerseBlockParagraphLine1(stack["line"])
}
func (c *current) onVerseBlockParagraphLineElement1(element interface{}) (interface{}, error) {
return element, nil
}
func (p *parser) callonVerseBlockParagraphLineElement1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onVerseBlockParagraphLineElement1(stack["element"])
}
func (c *current) onSidebarBlock1(attributes, content interface{}) (interface{}, error) {
return types.NewDelimitedBlock(types.Sidebar, content.([]interface{}), types.None, attributes)
}
func (p *parser) callonSidebarBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSidebarBlock1(stack["attributes"], stack["content"])
}
func (c *current) onNonSidebarBlock1(content interface{}) (interface{}, error) {
return content, nil
}
func (p *parser) callonNonSidebarBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onNonSidebarBlock1(stack["content"])
}
func (c *current) onSidebarBlockParagraph1(lines interface{}) (interface{}, error) {
return types.NewParagraph(lines.([]interface{}), types.ElementAttributes{})
}
func (p *parser) callonSidebarBlockParagraph1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSidebarBlockParagraph1(stack["lines"])
}
func (c *current) onSidebarBlockParagraphLine1(line interface{}) (interface{}, error) {
return line, nil
}
func (p *parser) callonSidebarBlockParagraphLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSidebarBlockParagraphLine1(stack["line"])
}
func (c *current) onTable1(attributes, header, lines interface{}) (interface{}, error) {
// end delimiter or end of file
return types.NewTable(header, lines.([]interface{}), attributes)
}
func (p *parser) callonTable1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTable1(stack["attributes"], stack["header"], stack["lines"])
}
func (c *current) onTableLineHeader1(cells interface{}) (interface{}, error) {
return types.NewTableLine(cells.([]interface{}))
}
func (p *parser) callonTableLineHeader1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTableLineHeader1(stack["cells"])
}
func (c *current) onTableLine1(cells interface{}) (interface{}, error) {
return types.NewTableLine(cells.([]interface{}))
}
func (p *parser) callonTableLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTableLine1(stack["cells"])
}
func (c *current) onTableCell1(elements interface{}) (interface{}, error) {
return types.NewInlineElements(elements)
}
func (p *parser) callonTableCell1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onTableCell1(stack["elements"])
}
func (c *current) onCommentBlock1(content interface{}) (interface{}, error) {
return types.NewDelimitedBlock(types.Comment, content.([]interface{}), types.Verbatim, nil)
}
func (p *parser) callonCommentBlock1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onCommentBlock1(stack["content"])
}
func (c *current) onCommentBlockLine1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonCommentBlockLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onCommentBlockLine1()
}
func (c *current) onSingleLineComment1(content interface{}) (interface{}, error) {
return types.NewSingleLineComment(content.(string))
}
func (p *parser) callonSingleLineComment1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSingleLineComment1(stack["content"])
}
func (c *current) onSingleLineCommentContent1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonSingleLineCommentContent1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSingleLineCommentContent1()
}
func (c *current) onParagraphWithHeadingSpaces1(attributes, lines interface{}) (interface{}, error) {
return types.NewLiteralBlock(types.LiteralBlockWithSpacesOnFirstLine, lines.([]interface{}), attributes)
}
func (p *parser) callonParagraphWithHeadingSpaces1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithHeadingSpaces1(stack["attributes"], stack["lines"])
}
func (c *current) onParagraphWithHeadingSpacesLines11() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonParagraphWithHeadingSpacesLines11() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithHeadingSpacesLines11()
}
func (c *current) onParagraphWithHeadingSpacesLines4() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonParagraphWithHeadingSpacesLines4() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithHeadingSpacesLines4()
}
func (c *current) onParagraphWithHeadingSpacesLines24() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonParagraphWithHeadingSpacesLines24() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithHeadingSpacesLines24()
}
func (c *current) onParagraphWithHeadingSpacesLines19(otherLine interface{}) (interface{}, error) {
return otherLine, nil // do not include the trailing 'EOL'
}
func (p *parser) callonParagraphWithHeadingSpacesLines19() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithHeadingSpacesLines19(stack["otherLine"])
}
func (c *current) onParagraphWithHeadingSpacesLines1(firstLine, otherLines interface{}) (interface{}, error) {
return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil
}
func (p *parser) callonParagraphWithHeadingSpacesLines1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithHeadingSpacesLines1(stack["firstLine"], stack["otherLines"])
}
func (c *current) onParagraphWithLiteralBlockDelimiter1(attributes, lines interface{}) (interface{}, error) {
return types.NewLiteralBlock(types.LiteralBlockWithDelimiter, lines.([]interface{}), attributes)
}
func (p *parser) callonParagraphWithLiteralBlockDelimiter1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithLiteralBlockDelimiter1(stack["attributes"], stack["lines"])
}
func (c *current) onParagraphWithLiteralBlockDelimiterLines1(lines interface{}) (interface{}, error) {
return lines.([]interface{}), nil
}
func (p *parser) callonParagraphWithLiteralBlockDelimiterLines1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithLiteralBlockDelimiterLines1(stack["lines"])
}
func (c *current) onParagraphWithLiteralBlockDelimiterLine4() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonParagraphWithLiteralBlockDelimiterLine4() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithLiteralBlockDelimiterLine4()
}
func (c *current) onParagraphWithLiteralBlockDelimiterLine1(line interface{}) (interface{}, error) {
return line, nil // do not include the trailing 'EOL'
}
func (p *parser) callonParagraphWithLiteralBlockDelimiterLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithLiteralBlockDelimiterLine1(stack["line"])
}
func (c *current) onParagraphWithLiteralAttribute6(attributes interface{}) (bool, error) {
if attrs, ok := attributes.(types.ElementAttributes); ok {
kind, ok := attrs[types.AttrKind]
return ok && kind == types.Literal, nil
}
return false, nil
}
func (p *parser) callonParagraphWithLiteralAttribute6() (bool, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithLiteralAttribute6(stack["attributes"])
}
func (c *current) onParagraphWithLiteralAttribute1(attributes, lines interface{}) (interface{}, error) {
return types.NewLiteralBlock(types.LiteralBlockWithAttribute, lines.([]interface{}), attributes)
}
func (p *parser) callonParagraphWithLiteralAttribute1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithLiteralAttribute1(stack["attributes"], stack["lines"])
}
func (c *current) onLiteralKind1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonLiteralKind1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLiteralKind1()
}
func (c *current) onParagraphWithLiteralAttributeLines1(lines interface{}) (interface{}, error) {
return lines.([]interface{}), nil
}
func (p *parser) callonParagraphWithLiteralAttributeLines1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithLiteralAttributeLines1(stack["lines"])
}
func (c *current) onParagraphWithLiteralAttributeLine4() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonParagraphWithLiteralAttributeLine4() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithLiteralAttributeLine4()
}
func (c *current) onParagraphWithLiteralAttributeLine1(line interface{}) (interface{}, error) {
return line, nil // do not include the trailing 'EOL'
}
func (p *parser) callonParagraphWithLiteralAttributeLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onParagraphWithLiteralAttributeLine1(stack["line"])
}
func (c *current) onIndexTerm1(term interface{}) (interface{}, error) {
return types.NewIndexTerm(term.([]interface{}))
}
func (p *parser) callonIndexTerm1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onIndexTerm1(stack["term"])
}
func (c *current) onIndexTermContent9() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonIndexTermContent9() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onIndexTermContent9()
}
func (c *current) onIndexTermContent1(elements interface{}) (interface{}, error) {
return types.NewInlineElements(elements.([]interface{}))
}
func (p *parser) callonIndexTermContent1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onIndexTermContent1(stack["elements"])
}
func (c *current) onConcealedIndexTerm8(content interface{}) (interface{}, error) {
return content, nil
}
func (p *parser) callonConcealedIndexTerm8() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onConcealedIndexTerm8(stack["content"])
}
func (c *current) onConcealedIndexTerm19(content interface{}) (interface{}, error) {
return content, nil
}
func (p *parser) callonConcealedIndexTerm19() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onConcealedIndexTerm19(stack["content"])
}
func (c *current) onConcealedIndexTerm1(term1, term2, term3 interface{}) (interface{}, error) {
return types.NewConcealedIndexTerm(term1, term2, term3)
}
func (p *parser) callonConcealedIndexTerm1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onConcealedIndexTerm1(stack["term1"], stack["term2"], stack["term3"])
}
func (c *current) onConcealedIndexTermContent1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonConcealedIndexTermContent1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onConcealedIndexTermContent1()
}
func (c *current) onBlankLine1() (interface{}, error) {
return types.NewBlankLine()
}
func (p *parser) callonBlankLine1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onBlankLine1()
}
func (c *current) onAlphanums1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonAlphanums1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAlphanums1()
}
func (c *current) onSimpleWord1() (interface{}, error) {
// very straightforward content: alphanums followed by spaces but not the "+" signs because it needs a heading space to become a LineBreak element
return types.NewStringElement(string(c.text))
}
func (p *parser) callonSimpleWord1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onSimpleWord1()
}
func (c *current) onAnyChars4() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonAnyChars4() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAnyChars4()
}
func (c *current) onAnyChars13() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonAnyChars13() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAnyChars13()
}
func (c *current) onAnyChars31() (interface{}, error) {
// punctuation marks are treated separately, so any following macro (image, footnote, etc.) is not included in this rule
return types.NewStringElement(string(c.text))
}
func (p *parser) callonAnyChars31() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAnyChars31()
}
func (c *current) onAnyChar1() (interface{}, error) {
// this is a fall-back rule in case all preceeding rules failed to match the current content.
return types.NewStringElement(string(c.text))
}
func (p *parser) callonAnyChar1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onAnyChar1()
}
func (c *current) onFileLocation1(elements interface{}) (interface{}, error) {
return types.NewLocation(elements.([]interface{}))
}
func (p *parser) callonFileLocation1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onFileLocation1(stack["elements"])
}
func (c *current) onResolvedFileLocation1(elements interface{}) (interface{}, error) {
return types.NewLocation(elements.([]interface{}))
}
func (p *parser) callonResolvedFileLocation1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onResolvedFileLocation1(stack["elements"])
}
func (c *current) onLocation1(elements interface{}) (interface{}, error) {
return types.NewLocation(elements.([]interface{}))
}
func (p *parser) callonLocation1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onLocation1(stack["elements"])
}
func (c *current) onResolvedLocation1(elements interface{}) (interface{}, error) {
return types.NewLocation(elements.([]interface{}))
}
func (p *parser) callonResolvedLocation1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onResolvedLocation1(stack["elements"])
}
func (c *current) onURL1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonURL1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onURL1()
}
func (c *current) onID1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonID1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onID1()
}
func (c *current) onDIGIT1() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonDIGIT1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onDIGIT1()
}
func (c *current) onNUMBER1() (interface{}, error) {
return strconv.Atoi(string(c.text))
}
func (p *parser) callonNUMBER1() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onNUMBER1()
}
func (c *current) onWS3() (interface{}, error) {
return string(c.text), nil
}
func (p *parser) callonWS3() (interface{}, error) {
stack := p.vstack[len(p.vstack)-1]
_ = stack
return p.cur.onWS3()
}
var (
// errNoRule is returned when the grammar to parse has no rule.
errNoRule = errors.New("grammar has no rule")
// errInvalidEntrypoint is returned when the specified entrypoint rule
// does not exit.
errInvalidEntrypoint = errors.New("invalid entrypoint")
// errInvalidEncoding is returned when the source is not properly
// utf8-encoded.
errInvalidEncoding = errors.New("invalid encoding")
// errMaxExprCnt is used to signal that the maximum number of
// expressions have been parsed.
errMaxExprCnt = errors.New("max number of expresssions parsed")
)
// Option is a function that can set an option on the parser. It returns
// the previous setting as an Option.
type Option func(*parser) Option
// MaxExpressions creates an Option to stop parsing after the provided
// number of expressions have been parsed, if the value is 0 then the parser will
// parse for as many steps as needed (possibly an infinite number).
//
// The default for maxExprCnt is 0.
func MaxExpressions(maxExprCnt uint64) Option {
return func(p *parser) Option {
oldMaxExprCnt := p.maxExprCnt
p.maxExprCnt = maxExprCnt
return MaxExpressions(oldMaxExprCnt)
}
}
// Entrypoint creates an Option to set the rule name to use as entrypoint.
// The rule name must have been specified in the -alternate-entrypoints
// if generating the parser with the -optimize-grammar flag, otherwise
// it may have been optimized out. Passing an empty string sets the
// entrypoint to the first rule in the grammar.
//
// The default is to start parsing at the first rule in the grammar.
func Entrypoint(ruleName string) Option {
return func(p *parser) Option {
oldEntrypoint := p.entrypoint
p.entrypoint = ruleName
if ruleName == "" {
p.entrypoint = g.rules[0].name
}
return Entrypoint(oldEntrypoint)
}
}
// AllowInvalidUTF8 creates an Option to allow invalid UTF-8 bytes.
// Every invalid UTF-8 byte is treated as a utf8.RuneError (U+FFFD)
// by character class matchers and is matched by the any matcher.
// The returned matched value, c.text and c.offset are NOT affected.
//
// The default is false.
func AllowInvalidUTF8(b bool) Option {
return func(p *parser) Option {
old := p.allowInvalidUTF8
p.allowInvalidUTF8 = b
return AllowInvalidUTF8(old)
}
}
// Recover creates an Option to set the recover flag to b. When set to
// true, this causes the parser to recover from panics and convert it
// to an error. Setting it to false can be useful while debugging to
// access the full stack trace.
//
// The default is true.
func Recover(b bool) Option {
return func(p *parser) Option {
old := p.recover
p.recover = b
return Recover(old)
}
}
// GlobalStore creates an Option to set a key to a certain value in
// the globalStore.
func GlobalStore(key string, value interface{}) Option {
return func(p *parser) Option {
old := p.cur.globalStore[key]
p.cur.globalStore[key] = value
return GlobalStore(key, old)
}
}
// ParseFile parses the file identified by filename.
func ParseFile(filename string, opts ...Option) (i interface{}, err error) {
f, err := os.Open(filename)
if err != nil {
return nil, err
}
defer func() {
if closeErr := f.Close(); closeErr != nil {
err = closeErr
}
}()
return ParseReader(filename, f, opts...)
}
// ParseReader parses the data from r using filename as information in the
// error messages.
func ParseReader(filename string, r io.Reader, opts ...Option) (interface{}, error) {
b, err := ioutil.ReadAll(r)
if err != nil {
return nil, err
}
return Parse(filename, b, opts...)
}
// Parse parses the data from b using filename as information in the
// error messages.
func Parse(filename string, b []byte, opts ...Option) (interface{}, error) {
return newParser(filename, b, opts...).parse(g)
}
// position records a position in the text.
type position struct {
line, col, offset int
}
func (p position) String() string {
return strconv.Itoa(p.line) + ":" + strconv.Itoa(p.col) + " [" + strconv.Itoa(p.offset) + "]"
}
// savepoint stores all state required to go back to this point in the
// parser.
type savepoint struct {
position
rn rune
w int
}
type current struct {
pos position // start position of the match
text []byte // raw text of the match
// globalStore is a general store for the user to store arbitrary key-value
// pairs that they need to manage and that they do not want tied to the
// backtracking of the parser. This is only modified by the user and never
// rolled back by the parser. It is always up to the user to keep this in a
// consistent state.
globalStore storeDict
}
type storeDict map[string]interface{}
// the AST types...
type grammar struct {
pos position
rules []*rule
}
type rule struct {
pos position
name string
displayName string
expr interface{}
}
type choiceExpr struct {
pos position
alternatives []interface{}
}
type actionExpr struct {
pos position
expr interface{}
run func(*parser) (interface{}, error)
}
type recoveryExpr struct {
pos position
expr interface{}
recoverExpr interface{}
failureLabel []string
}
type seqExpr struct {
pos position
exprs []interface{}
}
type throwExpr struct {
pos position
label string
}
type labeledExpr struct {
pos position
label string
expr interface{}
}
type expr struct {
pos position
expr interface{}
}
type andExpr expr
type notExpr expr
type zeroOrOneExpr expr
type zeroOrMoreExpr expr
type oneOrMoreExpr expr
type ruleRefExpr struct {
pos position
name string
}
type andCodeExpr struct {
pos position
run func(*parser) (bool, error)
}
type notCodeExpr struct {
pos position
run func(*parser) (bool, error)
}
type litMatcher struct {
pos position
val string
ignoreCase bool
}
type charClassMatcher struct {
pos position
val string
basicLatinChars [128]bool
chars []rune
ranges []rune
classes []*unicode.RangeTable
ignoreCase bool
inverted bool
}
type anyMatcher position
// errList cumulates the errors found by the parser.
type errList []error
func (e *errList) add(err error) {
*e = append(*e, err)
}
func (e errList) err() error {
if len(e) == 0 {
return nil
}
e.dedupe()
return e
}
func (e *errList) dedupe() {
var cleaned []error
set := make(map[string]bool)
for _, err := range *e {
if msg := err.Error(); !set[msg] {
set[msg] = true
cleaned = append(cleaned, err)
}
}
*e = cleaned
}
func (e errList) Error() string {
switch len(e) {
case 0:
return ""
case 1:
return e[0].Error()
default:
var buf bytes.Buffer
for i, err := range e {
if i > 0 {
buf.WriteRune('\n')
}
buf.WriteString(err.Error())
}
return buf.String()
}
}
// parserError wraps an error with a prefix indicating the rule in which
// the error occurred. The original error is stored in the Inner field.
type parserError struct {
Inner error
pos position
prefix string
expected []string
}
// Error returns the error message.
func (p *parserError) Error() string {
return p.prefix + ": " + p.Inner.Error()
}
// newParser creates a parser with the specified input source and options.
func newParser(filename string, b []byte, opts ...Option) *parser {
stats := Stats{
ChoiceAltCnt: make(map[string]map[string]int),
}
p := &parser{
filename: filename,
errs: new(errList),
data: b,
pt: savepoint{position: position{line: 1}},
recover: true,
cur: current{
globalStore: make(storeDict),
},
maxFailPos: position{col: 1, line: 1},
maxFailExpected: make([]string, 0, 20),
Stats: &stats,
// start rule is rule [0] unless an alternate entrypoint is specified
entrypoint: g.rules[0].name,
}
p.setOptions(opts)
if p.maxExprCnt == 0 {
p.maxExprCnt = math.MaxUint64
}
return p
}
// setOptions applies the options to the parser.
func (p *parser) setOptions(opts []Option) {
for _, opt := range opts {
opt(p)
}
}
type resultTuple struct {
v interface{}
b bool
end savepoint
}
const choiceNoMatch = -1
// Stats stores some statistics, gathered during parsing
type Stats struct {
// ExprCnt counts the number of expressions processed during parsing
// This value is compared to the maximum number of expressions allowed
// (set by the MaxExpressions option).
ExprCnt uint64
// ChoiceAltCnt is used to count for each ordered choice expression,
// which alternative is used how may times.
// These numbers allow to optimize the order of the ordered choice expression
// to increase the performance of the parser
//
// The outer key of ChoiceAltCnt is composed of the name of the rule as well
// as the line and the column of the ordered choice.
// The inner key of ChoiceAltCnt is the number (one-based) of the matching alternative.
// For each alternative the number of matches are counted. If an ordered choice does not
// match, a special counter is incremented. The name of this counter is set with
// the parser option Statistics.
// For an alternative to be included in ChoiceAltCnt, it has to match at least once.
ChoiceAltCnt map[string]map[string]int
}
type parser struct {
filename string
pt savepoint
cur current
data []byte
errs *errList
depth int
recover bool
// rules table, maps the rule identifier to the rule node
rules map[string]*rule
// variables stack, map of label to value
vstack []map[string]interface{}
// rule stack, allows identification of the current rule in errors
rstack []*rule
// parse fail
maxFailPos position
maxFailExpected []string
maxFailInvertExpected bool
// max number of expressions to be parsed
maxExprCnt uint64
// entrypoint for the parser
entrypoint string
allowInvalidUTF8 bool
*Stats
choiceNoMatch string
// recovery expression stack, keeps track of the currently available recovery expression, these are traversed in reverse
recoveryStack []map[string]interface{}
}
// push a variable set on the vstack.
func (p *parser) pushV() {
if cap(p.vstack) == len(p.vstack) {
// create new empty slot in the stack
p.vstack = append(p.vstack, nil)
} else {
// slice to 1 more
p.vstack = p.vstack[:len(p.vstack)+1]
}
// get the last args set
m := p.vstack[len(p.vstack)-1]
if m != nil && len(m) == 0 {
// empty map, all good
return
}
m = make(map[string]interface{})
p.vstack[len(p.vstack)-1] = m
}
// pop a variable set from the vstack.
func (p *parser) popV() {
// if the map is not empty, clear it
m := p.vstack[len(p.vstack)-1]
if len(m) > 0 {
// GC that map
p.vstack[len(p.vstack)-1] = nil
}
p.vstack = p.vstack[:len(p.vstack)-1]
}
// push a recovery expression with its labels to the recoveryStack
func (p *parser) pushRecovery(labels []string, expr interface{}) {
if cap(p.recoveryStack) == len(p.recoveryStack) {
// create new empty slot in the stack
p.recoveryStack = append(p.recoveryStack, nil)
} else {
// slice to 1 more
p.recoveryStack = p.recoveryStack[:len(p.recoveryStack)+1]
}
m := make(map[string]interface{}, len(labels))
for _, fl := range labels {
m[fl] = expr
}
p.recoveryStack[len(p.recoveryStack)-1] = m
}
// pop a recovery expression from the recoveryStack
func (p *parser) popRecovery() {
// GC that map
p.recoveryStack[len(p.recoveryStack)-1] = nil
p.recoveryStack = p.recoveryStack[:len(p.recoveryStack)-1]
}
func (p *parser) addErr(err error) {
p.addErrAt(err, p.pt.position, []string{})
}
func (p *parser) addErrAt(err error, pos position, expected []string) {
var buf bytes.Buffer
if p.filename != "" {
buf.WriteString(p.filename)
}
if buf.Len() > 0 {
buf.WriteString(":")
}
buf.WriteString(fmt.Sprintf("%d:%d (%d)", pos.line, pos.col, pos.offset))
if len(p.rstack) > 0 {
if buf.Len() > 0 {
buf.WriteString(": ")
}
rule := p.rstack[len(p.rstack)-1]
if rule.displayName != "" {
buf.WriteString("rule " + rule.displayName)
} else {
buf.WriteString("rule " + rule.name)
}
}
pe := &parserError{Inner: err, pos: pos, prefix: buf.String(), expected: expected}
p.errs.add(pe)
}
func (p *parser) failAt(fail bool, pos position, want string) {
// process fail if parsing fails and not inverted or parsing succeeds and invert is set
if fail == p.maxFailInvertExpected {
if pos.offset < p.maxFailPos.offset {
return
}
if pos.offset > p.maxFailPos.offset {
p.maxFailPos = pos
p.maxFailExpected = p.maxFailExpected[:0]
}
if p.maxFailInvertExpected {
want = "!" + want
}
p.maxFailExpected = append(p.maxFailExpected, want)
}
}
// read advances the parser to the next rune.
func (p *parser) read() {
p.pt.offset += p.pt.w
rn, n := utf8.DecodeRune(p.data[p.pt.offset:])
p.pt.rn = rn
p.pt.w = n
p.pt.col++
if rn == '\n' {
p.pt.line++
p.pt.col = 0
}
if rn == utf8.RuneError && n == 1 { // see utf8.DecodeRune
if !p.allowInvalidUTF8 {
p.addErr(errInvalidEncoding)
}
}
}
// restore parser position to the savepoint pt.
func (p *parser) restore(pt savepoint) {
if pt.offset == p.pt.offset {
return
}
p.pt = pt
}
// get the slice of bytes from the savepoint start to the current position.
func (p *parser) sliceFrom(start savepoint) []byte {
return p.data[start.position.offset:p.pt.position.offset]
}
func (p *parser) buildRulesTable(g *grammar) {
p.rules = make(map[string]*rule, len(g.rules))
for _, r := range g.rules {
p.rules[r.name] = r
}
}
func (p *parser) parse(g *grammar) (val interface{}, err error) {
if len(g.rules) == 0 {
p.addErr(errNoRule)
return nil, p.errs.err()
}
// TODO : not super critical but this could be generated
p.buildRulesTable(g)
if p.recover {
// panic can be used in action code to stop parsing immediately
// and return the panic as an error.
defer func() {
if e := recover(); e != nil {
val = nil
switch e := e.(type) {
case error:
p.addErr(e)
default:
p.addErr(fmt.Errorf("%v", e))
}
err = p.errs.err()
}
}()
}
startRule, ok := p.rules[p.entrypoint]
if !ok {
p.addErr(errInvalidEntrypoint)
return nil, p.errs.err()
}
p.read() // advance to first rune
val, ok = p.parseRule(startRule)
if !ok {
if len(*p.errs) == 0 {
// If parsing fails, but no errors have been recorded, the expected values
// for the farthest parser position are returned as error.
maxFailExpectedMap := make(map[string]struct{}, len(p.maxFailExpected))
for _, v := range p.maxFailExpected {
maxFailExpectedMap[v] = struct{}{}
}
expected := make([]string, 0, len(maxFailExpectedMap))
eof := false
if _, ok := maxFailExpectedMap["!."]; ok {
delete(maxFailExpectedMap, "!.")
eof = true
}
for k := range maxFailExpectedMap {
expected = append(expected, k)
}
sort.Strings(expected)
if eof {
expected = append(expected, "EOF")
}
p.addErrAt(errors.New("no match found, expected: "+listJoin(expected, ", ", "or")), p.maxFailPos, expected)
}
return nil, p.errs.err()
}
return val, p.errs.err()
}
func listJoin(list []string, sep string, lastSep string) string {
switch len(list) {
case 0:
return ""
case 1:
return list[0]
default:
return strings.Join(list[:len(list)-1], sep) + " " + lastSep + " " + list[len(list)-1]
}
}
func (p *parser) parseRule(rule *rule) (interface{}, bool) {
p.rstack = append(p.rstack, rule)
p.pushV()
val, ok := p.parseExpr(rule.expr)
p.popV()
p.rstack = p.rstack[:len(p.rstack)-1]
return val, ok
}
func (p *parser) parseExpr(expr interface{}) (interface{}, bool) {
p.ExprCnt++
if p.ExprCnt > p.maxExprCnt {
panic(errMaxExprCnt)
}
var val interface{}
var ok bool
switch expr := expr.(type) {
case *actionExpr:
val, ok = p.parseActionExpr(expr)
case *andCodeExpr:
val, ok = p.parseAndCodeExpr(expr)
case *andExpr:
val, ok = p.parseAndExpr(expr)
case *anyMatcher:
val, ok = p.parseAnyMatcher(expr)
case *charClassMatcher:
val, ok = p.parseCharClassMatcher(expr)
case *choiceExpr:
val, ok = p.parseChoiceExpr(expr)
case *labeledExpr:
val, ok = p.parseLabeledExpr(expr)
case *litMatcher:
val, ok = p.parseLitMatcher(expr)
case *notCodeExpr:
val, ok = p.parseNotCodeExpr(expr)
case *notExpr:
val, ok = p.parseNotExpr(expr)
case *oneOrMoreExpr:
val, ok = p.parseOneOrMoreExpr(expr)
case *recoveryExpr:
val, ok = p.parseRecoveryExpr(expr)
case *ruleRefExpr:
val, ok = p.parseRuleRefExpr(expr)
case *seqExpr:
val, ok = p.parseSeqExpr(expr)
case *throwExpr:
val, ok = p.parseThrowExpr(expr)
case *zeroOrMoreExpr:
val, ok = p.parseZeroOrMoreExpr(expr)
case *zeroOrOneExpr:
val, ok = p.parseZeroOrOneExpr(expr)
default:
panic(fmt.Sprintf("unknown expression type %T", expr))
}
return val, ok
}
func (p *parser) parseActionExpr(act *actionExpr) (interface{}, bool) {
start := p.pt
val, ok := p.parseExpr(act.expr)
if ok {
p.cur.pos = start.position
p.cur.text = p.sliceFrom(start)
actVal, err := act.run(p)
if err != nil {
p.addErrAt(err, start.position, []string{})
}
val = actVal
}
return val, ok
}
func (p *parser) parseAndCodeExpr(and *andCodeExpr) (interface{}, bool) {
ok, err := and.run(p)
if err != nil {
p.addErr(err)
}
return nil, ok
}
func (p *parser) parseAndExpr(and *andExpr) (interface{}, bool) {
pt := p.pt
p.pushV()
_, ok := p.parseExpr(and.expr)
p.popV()
p.restore(pt)
return nil, ok
}
func (p *parser) parseAnyMatcher(any *anyMatcher) (interface{}, bool) {
if p.pt.rn == utf8.RuneError && p.pt.w == 0 {
// EOF - see utf8.DecodeRune
p.failAt(false, p.pt.position, ".")
return nil, false
}
start := p.pt
p.read()
p.failAt(true, start.position, ".")
return p.sliceFrom(start), true
}
func (p *parser) parseCharClassMatcher(chr *charClassMatcher) (interface{}, bool) {
cur := p.pt.rn
start := p.pt
// can't match EOF
if cur == utf8.RuneError && p.pt.w == 0 { // see utf8.DecodeRune
p.failAt(false, start.position, chr.val)
return nil, false
}
if chr.ignoreCase {
cur = unicode.ToLower(cur)
}
// try to match in the list of available chars
for _, rn := range chr.chars {
if rn == cur {
if chr.inverted {
p.failAt(false, start.position, chr.val)
return nil, false
}
p.read()
p.failAt(true, start.position, chr.val)
return p.sliceFrom(start), true
}
}
// try to match in the list of ranges
for i := 0; i < len(chr.ranges); i += 2 {
if cur >= chr.ranges[i] && cur <= chr.ranges[i+1] {
if chr.inverted {
p.failAt(false, start.position, chr.val)
return nil, false
}
p.read()
p.failAt(true, start.position, chr.val)
return p.sliceFrom(start), true
}
}
// try to match in the list of Unicode classes
for _, cl := range chr.classes {
if unicode.Is(cl, cur) {
if chr.inverted {
p.failAt(false, start.position, chr.val)
return nil, false
}
p.read()
p.failAt(true, start.position, chr.val)
return p.sliceFrom(start), true
}
}
if chr.inverted {
p.read()
p.failAt(true, start.position, chr.val)
return p.sliceFrom(start), true
}
p.failAt(false, start.position, chr.val)
return nil, false
}
func (p *parser) parseChoiceExpr(ch *choiceExpr) (interface{}, bool) {
for altI, alt := range ch.alternatives {
// dummy assignment to prevent compile error if optimized
_ = altI
p.pushV()
val, ok := p.parseExpr(alt)
p.popV()
if ok {
return val, ok
}
}
return nil, false
}
func (p *parser) parseLabeledExpr(lab *labeledExpr) (interface{}, bool) {
p.pushV()
val, ok := p.parseExpr(lab.expr)
p.popV()
if ok && lab.label != "" {
m := p.vstack[len(p.vstack)-1]
m[lab.label] = val
}
return val, ok
}
func (p *parser) parseLitMatcher(lit *litMatcher) (interface{}, bool) {
ignoreCase := ""
if lit.ignoreCase {
ignoreCase = "i"
}
val := string(strconv.AppendQuote([]byte{}, lit.val)) + ignoreCase // wrap 'lit.val' with double quotes
start := p.pt
for _, want := range lit.val {
cur := p.pt.rn
if lit.ignoreCase {
cur = unicode.ToLower(cur)
}
if cur != want {
p.failAt(false, start.position, val)
p.restore(start)
return nil, false
}
p.read()
}
p.failAt(true, start.position, val)
return p.sliceFrom(start), true
}
func (p *parser) parseNotCodeExpr(not *notCodeExpr) (interface{}, bool) {
ok, err := not.run(p)
if err != nil {
p.addErr(err)
}
return nil, !ok
}
func (p *parser) parseNotExpr(not *notExpr) (interface{}, bool) {
pt := p.pt
p.pushV()
p.maxFailInvertExpected = !p.maxFailInvertExpected
_, ok := p.parseExpr(not.expr)
p.maxFailInvertExpected = !p.maxFailInvertExpected
p.popV()
p.restore(pt)
return nil, !ok
}
func (p *parser) parseOneOrMoreExpr(expr *oneOrMoreExpr) (interface{}, bool) {
var vals []interface{}
for {
p.pushV()
val, ok := p.parseExpr(expr.expr)
p.popV()
if !ok {
if len(vals) == 0 {
// did not match once, no match
return nil, false
}
return vals, true
}
vals = append(vals, val)
}
}
func (p *parser) parseRecoveryExpr(recover *recoveryExpr) (interface{}, bool) {
p.pushRecovery(recover.failureLabel, recover.recoverExpr)
val, ok := p.parseExpr(recover.expr)
p.popRecovery()
return val, ok
}
func (p *parser) parseRuleRefExpr(ref *ruleRefExpr) (interface{}, bool) {
if ref.name == "" {
panic(fmt.Sprintf("%s: invalid rule: missing name", ref.pos))
}
rule := p.rules[ref.name]
if rule == nil {
p.addErr(fmt.Errorf("undefined rule: %s", ref.name))
return nil, false
}
return p.parseRule(rule)
}
func (p *parser) parseSeqExpr(seq *seqExpr) (interface{}, bool) {
vals := make([]interface{}, 0, len(seq.exprs))
pt := p.pt
for _, expr := range seq.exprs {
val, ok := p.parseExpr(expr)
if !ok {
p.restore(pt)
return nil, false
}
vals = append(vals, val)
}
return vals, true
}
func (p *parser) parseThrowExpr(expr *throwExpr) (interface{}, bool) {
for i := len(p.recoveryStack) - 1; i >= 0; i-- {
if recoverExpr, ok := p.recoveryStack[i][expr.label]; ok {
if val, ok := p.parseExpr(recoverExpr); ok {
return val, ok
}
}
}
return nil, false
}
func (p *parser) parseZeroOrMoreExpr(expr *zeroOrMoreExpr) (interface{}, bool) {
var vals []interface{}
for {
p.pushV()
val, ok := p.parseExpr(expr.expr)
p.popV()
if !ok {
return vals, true
}
vals = append(vals, val)
}
}
func (p *parser) parseZeroOrOneExpr(expr *zeroOrOneExpr) (interface{}, bool) {
p.pushV()
val, _ := p.parseExpr(expr.expr)
p.popV()
// whether it matched or not, consider it a match
return val, true
}
func rangeTable(class string) *unicode.RangeTable {
if rt, ok := unicode.Categories[class]; ok {
return rt
}
if rt, ok := unicode.Properties[class]; ok {
return rt
}
if rt, ok := unicode.Scripts[class]; ok {
return rt
}
// cannot happen
panic(fmt.Sprintf("invalid Unicode class: %s", class))
}
|
def format_call_str(*args: Any, **kwargs: Mapping[Any, Any]):
use_func_name = None
with suppress(KeyError):
use_func = kwargs.pop('_call_func')
if use_func is not None:
use_func_name = use_func.__qualname__
else:
kwargs.setdefault('_level', 3)
otherargs = None
otherkwargs = None
with suppress(KeyError):
otherargs = kwargs.pop('_other_args')
with suppress(KeyError):
otherkwargs = kwargs.pop('_other_kwargs')
op = 'and'
with suppress(KeyError):
userop = kwargs.pop('_op')
op = userop or op
funcsig = format_func_sig(use_func_name, *args, **kwargs)
if otherargs or otherkwargs:
otherargs = otherargs or []
otherkwargs = otherkwargs or {}
otherkwargs['_level'] = kwargs.get('_level', None)
funcsig = ' {} '.format(op).join((
funcsig,
format_func_sig(use_func_name, *otherargs, **otherkwargs)
))
return funcsig |
/**
* A view component used to display the {@link ExecutorView#history}
* information. History is displayed as {@link nextapp.echo2.app.Button}
* components which will reset the {@link ExecutorView#query} component.
*
* <p>© Copyright 2007 Sans Pareil Technologies, Inc.</p>
* @author Rakesh Vidyadharan 2007-10-13
* @version $Id: HistoryView.java 3612 2007-10-13 23:59:53Z rakesh $
*/
public class HistoryView extends WindowPane
{
/** The executor view to which this component is bound. */
private final ExecutorView view;
/** Parent Controller. */
private final MainController controller;
/**
* Create instance of the pane using the specified controller.
*
* @param view The {@link #view} to which this view is bound.
* @param controller The controller to use to interact with the rest of
* the application.
*/
public HistoryView( final ExecutorView view,
final MainController controller )
{
this.view = view;
this.controller = controller;
}
/** Life-cycle method invoked when component is added to the UI. */
@Override
public void init()
{
removeAll();
final Column column = new Column();
for ( String statement : view.getHistory().keySet() )
{
final Button button = new Button( statement );
button.setStyleName( "Link.Button" );
button.addActionListener( new HistoryViewListener() );
column.add( button );
}
add( column );
}
/**
* The action listener used to update the {@link ExecutorView#query}
* field with the previous statement.
*/
protected class HistoryViewListener implements ActionListener
{
/**
* The action listener implementation. Invokes {@link
* ExecutorView#setQuery} with the statement value.
*
* @param event The action event that was triggered.
*/
public void actionPerformed( final ActionEvent event )
{
Button button = (Button) event.getSource();
view.setQueryFromHistory( button.getText() );
HistoryView.this.userClose();
}
}
} |
////////////////////////////////////////////////////////////////////////////////
// An example based on solving matrices based on premade files.
#include <mpi.h>
#include <string>
using std::string;
#include <sstream>
using std::stringstream;
// NTPoly Headers
#include "Logging.h"
#include "MatrixMapper.h"
#include "PSMatrix.h"
#include "ProcessGrid.h"
// This is the function we will map on to the matrix.
class TestOperation : public NTPoly::RealOperation {
public:
// Notice you overload the () operator.
bool operator()() {
// This object contains a triplet called data for you to modify.
if (this->data.index_row >= this->data.index_column) {
this->data.point_value *= 2;
return true;
}
return false;
}
};
////////////////////////////////////////////////////////////////////////////////
int main(int argc, char *argv[]) {
// Input Parameters
string input_file;
string output_file;
int process_slices;
// Setup MPI
int provided;
MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED, &provided);
// Process The Input Parameters
string key, value;
for (int i = 1; i < argc; i += 2) {
key = string(argv[i]);
value = string(argv[i + 1]);
stringstream ss;
ss << value;
if (key == "--input_matrix") {
ss >> input_file;
} else if (key == "--output_matrix") {
ss >> output_file;
} else if (key == "--process_slices") {
ss >> process_slices;
}
}
// Setup the process grid.
NTPoly::ConstructGlobalProcessGrid(MPI_COMM_WORLD, process_slices, true);
if (NTPoly::GetGlobalIsRoot()) {
NTPoly::ActivateLogger();
}
// Read in the matrices from file.
NTPoly::Matrix_ps Input(input_file);
NTPoly::Matrix_ps Output(Input.GetActualDimension());
// Map
TestOperation op;
NTPoly::MatrixMapper::Map(Input, Output, &op);
// Print the density matrix to file.
Output.WriteToMatrixMarket(output_file);
// Cleanup
if (NTPoly::GetGlobalIsRoot()) {
NTPoly::DeactivateLogger();
}
NTPoly::DestructGlobalProcessGrid();
MPI_Finalize();
return 0;
}
|
//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// validationGL31.cpp: Validation functions for OpenGL 3.1 entry point parameters
#include "libANGLE/validationGL31_autogen.h"
namespace gl
{
bool ValidateGetActiveUniformName(Context *context,
ShaderProgramID program,
GLuint uniformIndex,
GLsizei bufSize,
GLsizei *length,
GLchar *uniformName)
{
return true;
}
bool ValidatePrimitiveRestartIndex(Context *context, GLuint index)
{
return true;
}
} // namespace gl
|
package pl.dzielins42.stackoverflow.di;
import android.app.Application;
import android.arch.persistence.room.Room;
import android.content.Context;
import android.util.Log;
import javax.inject.Named;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import io.reactivex.Completable;
import io.reactivex.CompletableEmitter;
import io.reactivex.CompletableOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import pl.dzielins42.stackoverflow.api.StackOverflowService;
import pl.dzielins42.stackoverflow.database.QuestionDao;
import pl.dzielins42.stackoverflow.database.SODatabase;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
@Module
public class AppModule {
@Provides
@Singleton
Context provideContext(Application application) {
return application;
}
@Provides
@Singleton
@Named("stackoverflow")
Retrofit provideStackOverflowRetrofit() {
return new Retrofit.Builder()
.baseUrl("https://api.stackexchange.com")
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build();
}
@Provides
@Singleton
StackOverflowService provideStackOverflowService(@Named("stackoverflow") Retrofit retrofit) {
return retrofit.create(StackOverflowService.class);
}
@Provides
@Singleton
SODatabase provideDatabase(Context context) {
return Room.databaseBuilder(context, SODatabase.class, "stack-verflow-search-db")
.build();
}
@Provides
@Singleton
QuestionDao provideQuestionDao(SODatabase db) {
QuestionDao questionDao = db.questionDao();
// Clear here so the old results are not displayed at the start
Completable clearCompletable = Completable.create(emitter -> {
questionDao.clear();
emitter.onComplete();
});
clearCompletable.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe();
return questionDao;
}
}
|
/**
* Build table topology with opt topology.
*
* @param <T> the type parameter
* @param additionalTopology the additional topology
* @param typeReference the type reference
* @param topic the topic
* @return the topology
*/
public static <T> Topology buildTableTopologyWithOpt(
Consumer<KTable<String, Optional<T>>> additionalTopology,
TypeReference<T> typeReference, String topic) {
return buildTableTopologyWithOpt(additionalTopology, null,
typeReference, topic);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.