Description
Audit coverage of literal simple environment-reference syntax against caller-known names, distinguishing unknown from present-empty; no process environment access.
Environment assignments pair names with literal string values. Repeated names need an explicit first/last policy, and missing values differ from present empty strings. A dotenv file and a shell program can use different quoting and expansion rules; these tools implement their stated literal subsets using supplied data.
Audit coverage of literal simple environment-reference syntax against caller-known names, distinguishing unknown from present-empty; no process environment access.
When to use this tool
Use this tool to audit coverage of literal simple environment-reference syntax against caller-known names, distinguishing unknown from present-empty; no process environment access.
How to use the tool and how it works
- Enter text, available using the input definitions below.
- Run the operation. Resolve malformed-input errors before interpreting the result.
- Read result.references, result.missing. Interpret signs, units, ordering and null values using the rules below.
Inventory literal reference names with their source spans. Return distinct names absent from the supplied available list, in first-reference order.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| text | Literal text to scan for the stated simple dollar-reference syntax. | Text, at most 8,192 UTF-16 code units; the stated grammar and narrower limits also apply. |
| available | Exact names treated as present, including names with an empty value. | Dense list of at most 128 strings, each at most 8,192 UTF-16 code units. |
| Output field | Interpretation |
|---|---|
| result | Object containing the fields below. |
| result.references | Original simple reference names with half-open UTF-16 source spans. |
| result.missing | Distinct referenced names absent from the supplied present-name bank. |
{
"input": {
"text": "$A ${B}",
"available": [
"A"
]
},
"output": {
"result": {
"references": [
{
"name": "A",
"start": 0,
"end": 2
},
{
"name": "B",
"start": 3,
"end": 7
}
],
"missing": [
"B"
]
}
}
} Limitations and assumptions
- Presence is decided by the supplied name list, so a present variable with an empty value is not treated as missing.
- Portable assignment records require names matching [A-Za-z_][A-Za-z0-9_]* and NUL-free values. Name matching is case-sensitive. Reference scanners and quoted-value helpers follow only their own stated grammar and do not read the process environment.
- Every declared top-level input is required and unknown fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
- Numeric outputs must be finite and within the absolute safe-integer magnitude; exact larger integers use decimal text. Source positions are zero-based UTF-16 offsets and span ends are exclusive unless a different convention is explicitly stated.
Alternative or Complementary methods
Select the consuming application’s dotenv dialect explicitly. Keep literal substitution separate from recursive expansion and shell execution, and retain occurrence provenance when resolving duplicate assignments.
References
Similar or alternative tools
- Environment Literal Reference Substitution
Substitute simple literal environment references once using explicit last-wins values, preserve unknown references and do not recursively expand inserted dollar text.
- Environment Variable Reference Name Inventory
Inventory literal $NAME or ${NAME} reference syntax with UTF-16 spans; no shell quoting, escapes, operators or double-dollar PID semantics are interpreted.