[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"A label may not appear in a macro"



I'm working my way through the hyperbook and trying to solve the 1-bit clock alternation problem.

The code I have is:

```pluscal
------------------------- MODULE TickTockAlternate -------------------------
EXTENDS TLC

(***************************************************************************
--algorithm TickTockAlternate 
    variable b = 0;
        
    process Tick = 0
    begin   
        while TRUE do
            await b = 0;
            b := 1;
        end while; 
    end process
    
    process Tock = 1
    begin 
        while TRUE do
            await b = 1;
            b := 0;
        end while;
    end process
    
end algorithm
 ***************************************************************************)
=============================================================================
```

When I try to run the PlusCal translator on this code I receive the error: `A label may not appear in a macro`, however, when I modify the code to add a label as below:


```pluscal
------------------------- MODULE TickTockAlternate -------------------------
EXTENDS TLC

(***************************************************************************
--algorithm TickTockAlternate 
    variable b = 0;
        
    process Tick = 0
    begin   
        t0: while TRUE do
            await b = 0;
            b := 1;
        end while; 
    end process
    
    process Tock = 1
    begin 
        t1: while TRUE do
            await b = 1;
            b := 0;
        end while;
    end process
    
end algorithm
 ***************************************************************************)
=============================================================================

```

I receive the error: `A label may not appear in a macro`

I assume I'm just making some kind of silly mistake, but I can't figure it out for the life of me