Better error checking and nesting documentation

This commit is contained in:
2024-02-11 17:44:41 -06:00
parent 4fa6f409a5
commit f680fe177d
2 changed files with 32 additions and 0 deletions

View File

@@ -158,3 +158,32 @@ this text isn't minified
```
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

View File

@@ -157,6 +157,9 @@ autoescapeend:
break;
}
#endif
default:
fprintf(stderr, "Error in expansion phase: Unknown escape %c%c\n", ESCAPE_CHAR, data->data[i]);
return 1;
}
}
else