merge
This commit is contained in:
@@ -781,6 +781,8 @@ The syntax for this is defined as follows.
|
|||||||
<tr><td><code>'a' | 'b'</code></td><td>Either <code>'a'</code> is required, or <code>'b'</code> is required.</td></tr>
|
<tr><td><code>'a' | 'b'</code></td><td>Either <code>'a'</code> is required, or <code>'b'</code> is required.</td></tr>
|
||||||
<tr><td><code>'a'*</code></td><td>Zero or more <code>'a'</code> are required.</td></tr>
|
<tr><td><code>'a'*</code></td><td>Zero or more <code>'a'</code> are required.</td></tr>
|
||||||
<tr><td><code>'a'+</code></td><td>One or more <code>'a'</code> are required.</td></tr>
|
<tr><td><code>'a'+</code></td><td>One or more <code>'a'</code> are required.</td></tr>
|
||||||
|
<tr><td><code>'a'?</code></td><td>Zero or one <code>'a'</code> is required.</td></tr>
|
||||||
|
<tr><td><code>'a'{x}</code></td><td>Exactly <code>x</code> (integer) copies of <code>'a'</code> are required.</td></tr>
|
||||||
<tr><td><code><abba></code></td><td>The rule called <code>abba</code> is required.</td></tr>
|
<tr><td><code><abba></code></td><td>The rule called <code>abba</code> is required.</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@@ -991,5 +993,3 @@ When parsing from a grammar, the abstract syntax tree is tagged with different t
|
|||||||
If you have a rule in your grammar called `string`, `char` or `regex`, you may encounter some confusion. This is because nodes will be tagged with (for example) `string` _either_ if they are a string primitive, _or_ if they were parsed via your `string` rule. If you are detecting node type using something like `strstr`, in this situation it might break. One solution to this is to always check that `string` is the innermost tag to test for string primitives, or to rename your rule called `string` to something that doesn't conflict.
|
If you have a rule in your grammar called `string`, `char` or `regex`, you may encounter some confusion. This is because nodes will be tagged with (for example) `string` _either_ if they are a string primitive, _or_ if they were parsed via your `string` rule. If you are detecting node type using something like `strstr`, in this situation it might break. One solution to this is to always check that `string` is the innermost tag to test for string primitives, or to rename your rule called `string` to something that doesn't conflict.
|
||||||
|
|
||||||
Yes it is annoying but its probably not going to change!
|
Yes it is annoying but its probably not going to change!
|
||||||
|
|
||||||
|
|
||||||
|
4
mpc.c
4
mpc.c
@@ -2446,7 +2446,7 @@ mpc_val_t *mpcf_float(mpc_val_t *x) {
|
|||||||
|
|
||||||
mpc_val_t *mpcf_strtriml(mpc_val_t *x) {
|
mpc_val_t *mpcf_strtriml(mpc_val_t *x) {
|
||||||
char *s = x;
|
char *s = x;
|
||||||
while (isspace(*s)) {
|
while (isspace((unsigned char)*s)) {
|
||||||
memmove(s, s+1, strlen(s));
|
memmove(s, s+1, strlen(s));
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
@@ -2455,7 +2455,7 @@ mpc_val_t *mpcf_strtriml(mpc_val_t *x) {
|
|||||||
mpc_val_t *mpcf_strtrimr(mpc_val_t *x) {
|
mpc_val_t *mpcf_strtrimr(mpc_val_t *x) {
|
||||||
char *s = x;
|
char *s = x;
|
||||||
size_t l = strlen(s);
|
size_t l = strlen(s);
|
||||||
while (isspace(s[l-1])) {
|
while (isspace((unsigned char)s[l-1])) {
|
||||||
s[l-1] = '\0'; l--;
|
s[l-1] = '\0'; l--;
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
|
Reference in New Issue
Block a user