@@ -1918,6 +1918,17 @@ UBYTE *strDup1(UBYTE *instring, char *ifwrong)
19181918 #[ EndOfToken :
19191919*/
19201920
1921+ /**
1922+ * Skips over alphanumeric characters to find the end of the token.
1923+ *
1924+ * @note This function does not handle formal names (e.g., `[x+a]`).
1925+ * To handle them, use `SkipAName` instead.
1926+ *
1927+ * @param[in] s Pointer to a null-terminated input buffer.
1928+ * @return Pointer to the first non-alphanumeric character (i.e., the
1929+ * character immediately after the token), or the null
1930+ * terminator if the token reaches the end of the string.
1931+ */
19211932UBYTE * EndOfToken (UBYTE * s )
19221933{
19231934 UBYTE c ;
@@ -1930,6 +1941,17 @@ UBYTE *EndOfToken(UBYTE *s)
19301941 #[ ToToken :
19311942*/
19321943
1944+ /**
1945+ * Skips over non-alphanumeric characters to find the start of a token.
1946+ *
1947+ * @note This function does not handle formal names (e.g., `[x+a]`).
1948+ * To handle them, consider simply skipping whitespace, e.g., by using
1949+ * `SkipSpaces`.
1950+ *
1951+ * @param[in] s Pointer to a null-terminated input buffer.
1952+ * @return Pointer to the first alphanumeric character (i.e., the start
1953+ * of the token), or the null terminator if none is found.
1954+ */
19331955UBYTE * ToToken (UBYTE * s )
19341956{
19351957 UBYTE c ;
@@ -1940,11 +1962,17 @@ UBYTE *ToToken(UBYTE *s)
19401962/*
19411963 #] ToToken :
19421964 #[ SkipField :
1943-
1944- Skips from s to the end of a declaration field.
1945- par is the number of parentheses that still has to be closed.
19461965*/
1947-
1966+
1967+ /**
1968+ * Skips from `s` to the end of a declaration field
1969+ * (e.g., `x`, `1+2*[x+a]`, or `f({x,[x+a]},1)`).
1970+ *
1971+ * @param[in] s Pointer to a null-terminated input buffer.
1972+ * @param[in] level Number of parentheses that still have to be closed.
1973+ * @return Pointer to the character after the field, which is either
1974+ * a comma at level 0 or the null terminator.
1975+ */
19481976UBYTE * SkipField (UBYTE * s , int level )
19491977{
19501978 while ( * s ) {
0 commit comments