Better error checking and nesting documentation
This commit is contained in:
29
README.md
29
README.md
@@ -158,3 +158,32 @@ this text isn't minified
|
|||||||
```
|
```
|
||||||
|
|
||||||
Used for legacy web pages on my site that I don't want to update
|
Used for legacy web pages on my site that I don't want to update
|
||||||
|
|
||||||
|
### Nesting
|
||||||
|
|
||||||
|
```
|
||||||
|
@=var Hello world!@
|
||||||
|
@n @@$ echo '@!var@' | rev @@ @m
|
||||||
|
```
|
||||||
|
|
||||||
|
Turns into
|
||||||
|
|
||||||
|
```
|
||||||
|
@$ echo 'Hello world!' | rev @
|
||||||
|
```
|
||||||
|
|
||||||
|
Turns into
|
||||||
|
|
||||||
|
```
|
||||||
|
!dlrow olleH
|
||||||
|
```
|
||||||
|
|
||||||
|
Things between an `@n` and `@m` tag get processed twice. A double escape char `@@`
|
||||||
|
gets escaped into a single escape char `@`. Defining variables in a nest is
|
||||||
|
illegal, so
|
||||||
|
|
||||||
|
```
|
||||||
|
@n @@= dynamic_variable @$./generate_variable_value.sh@ @@ @m
|
||||||
|
```
|
||||||
|
|
||||||
|
is illegal
|
||||||
|
|||||||
@@ -157,6 +157,9 @@ autoescapeend:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
default:
|
||||||
|
fprintf(stderr, "Error in expansion phase: Unknown escape %c%c\n", ESCAPE_CHAR, data->data[i]);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user