Documentation

PT125 Intentional Failure

Back to documentation index
{
  "@context": "https://nxdlang.org/schema",
  "doc_id": "PT125",
  "title": "PT125 - Intentional Failures",
  "description": "Intentional Test Failures",
  "layer": "Passed Tests",
  "category": "Passed Tests - Nim",
  "keywords": [Nim, Pass, Test],
  "doc_version": "1.0",
  "status": "active"
}

# PT125 Intentional Failure

### NXD Sample:

```nxd
MODULE TEST

fn MAIN()
    CONST A SET 10
    CONST B SET 3
    CONST C SET 0

    IF A MOD B NEQ C OR C EQ 0:
        PRINTLN("MOD_OR_PASS")
```

### Result:

FAIL

### Expected Output:

FAIL - Malformed lambda expression

### Expected Rejection Stage:

[ ] Lexer
[X] Parser
[ ] AST
[ ] IR
[X] Semantics
[ ] Backend

### Actual Output:

N/A

### Notes:

intentional Parser failure. no IR JSON generated. Parser entered lambda parsing mode (because "fn" is used to start a lambda expression)and expected an opening parenthesis.
Encountered identifier "MAIN" instead. 
NXD has 3 function calls: "FUNC" = keyword, "FN" = ordinary identifier/name, and "fn" = lambda/mathematics construct.