while-syntax
Publisher: davidpomerenkeThemes in package: 2
Syntax highlighting for the WHILE programming language.
Syntax highlighting for the WHILE programming language.
Full workbench mockup using this variant's colors and tokenColors.
Loading...
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| keyword.operator.assignment | #d3b300 | — |
| constant.language.boolean | #8f5800 | — |
| keyword.operator.logical | #90b800 | — |
| keyword.operator.assignment | #d3b300 | — |
| constant.language.boolean | #8f5800 | — |
| keyword.operator.logical | #90b800 | — |
| keyword.operator.expression | #e22800 | — |
| keyword.control.conditional, keyword.control.loop | #0085c8 | — |
| keyword.control | #18a553 | — |
| keyword.operator.assignment | #ffd700 | — |
| comment | #999 | — |
| constant.numeric | #af00a0 | — |
| constant.language.boolean | #c8c800 | — |
| keyword.operator.logical | #ffd700 | — |
| entity.name.function | #fb7e00 | — |
| punctuation.definition.tag | #ff69b4 | — |
| constant.language.null | #ff69b4 | — |
| keyword.control.switch | #57ae00 | — |
| constant.language | #00a6c8 | — |
| entity.name.section | — | bold |
export interface User {
id: string;
name: string;
role: "admin" | "member";
tags: string[];
}
/**
* Fetch user data by ID
* @param id
* @returns User object or null if ID is invalid
*/
export async function fetchUser(id: string): Promise<User | null> {
if (!id) {
return null;
}
const response = await fetch(`/api/users/${id}`, {
method: "GET",
headers: { Accept: "application/json" },
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
return (await response.json()) as User;
}
function greet(user: User): string {
// Simple greeting function that uses the user's name
return `Hello, ${user.name}!`;
}