p4lang / tutorials

P4 language tutorials
Apache License 2.0
1.37k stars 892 forks source link

One action declaration missed in "mri.p4" #28

Closed chenxiang2019 closed 7 years ago

chenxiang2019 commented 7 years ago

Hello,

I'm tring the demo named mri in the branch P4D2, and noticed that the table swid missed the declaration of NoAction. See mri.p4/#L184. It will raise the error like this:

Entering build directory.
Extracting package.
Reading package manifest.
> p4c-bm2-ss --p4v 16 "mri.p4" -o "mri.p4.json"
mri.p4(188): error: NoAction not present in action list
        default_action = NoAction();
                         ^^^^^^^^
Compile failed.

It should be like this:

    table swid {
        actions        = { add_swid; NoAction; }
        default_action =  NoAction();      
    }

By the way, I noticed that you are still working on the p4v1.2 specification and p4c compiler. Thank you for this great work!

Best regards, Chen.

jnfoster commented 7 years ago

Thanks!

(Minor point: the name of the language is P416, and the version number released next week will be 1.0.0).

chenxiang2019 commented 7 years ago

@jnfoster

Thank you for reminding me of this matter. 👍