Skip to content

Commit 6d8d721

Browse files
committed
More review changes
1 parent 295efaa commit 6d8d721

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

.github/copilot-instructions.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ for (int i = 0; i < container.size(); i++) {
101101

102102
**What NOT to Use:**
103103
- ❌ C++23 features (code must compile with C++20)
104-
-Raw `new`/`delete` (use smart pointers)
104+
-Avoid raw `new`/`delete` (use smart pointers when possible)
105105
-`malloc`/`free` for large allocations (use `ats_malloc`)
106106
- ❌ Blocking operations in event threads
107107
- ❌ Creating threads manually (use async event system)
@@ -245,10 +245,15 @@ class HttpSM : public Continuation {
245245
// At file scope
246246
static DbgCtl dbg_ctl{"http_sm"};
247247

248-
// In code
248+
// In code (preferred)
249+
Dbg(dbg_ctl, "Processing request for URL: %s", url);
250+
251+
// Alternative (less common)
249252
DbgPrint(dbg_ctl, "Processing request for URL: %s", url);
250253
```
251254
255+
**Note:** Use `Dbg()` for new code. `DbgPrint()` exists but is rarely used (~60 vs ~3400 uses).
256+
252257
## Project Structure (Key Paths)
253258
254259
```

.github/instructions/HRW.instructions.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Round-trip test: `hrw4u example.hrw4u | u4wrh` should produce equivalent output.
6262

6363
**New resource/variable:**
6464
1. Define in `resources.h`, implement in `resources.cc`
65-
2. Update hrw4u: `types.py` for type system, `tables.py` (OPERATOR_MAP/CONDITION_MAP/etc.) for symbol tables, and `symbols.py` for resolver wiring
65+
2. Update hrw4u: `types.py` for type system, `tables.py` (OPERATOR_MAP/CONDITION_MAP/etc.) for symbol tables, `symbols.py` for resolver wiring, and `generators.py` for reverse mappings
6666

6767
## HRW4U Transpiler
6868

@@ -116,7 +116,7 @@ tools/hrw4u/
116116
**Visitors:**
117117
- `visitor.py` (HRW4UVisitor) - Forward compilation: hrw4u DSL → header_rewrite config
118118
- `hrw_visitor.py` (HRWInverseVisitor) - Reverse compilation: header_rewrite config → hrw4u DSL
119-
- `kg_visitor.py` - Knowledge graph generation
119+
- `kg_visitor.py` (KnowledgeGraphVisitor) - Extracts structured graph data for analysis/visualization (used by `hrw4u-kg` script, rarely modified)
120120

121121
### Adding Features
122122

@@ -163,7 +163,9 @@ tools/hrw4u/
163163

164164
## Feature Addition Example
165165

166-
**Adding `has-prefix` operator:**
166+
**Hypothetical example to illustrate the workflow:**
167+
168+
Adding a `has-prefix` operator (this operator does not exist):
167169

168170
1. **header_rewrite plugin:**
169171
```cpp

0 commit comments

Comments
 (0)