Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codec generation does not handle comments in types package #155

Closed
joshrsmith opened this issue Mar 26, 2016 · 1 comment
Closed

Codec generation does not handle comments in types package #155

joshrsmith opened this issue Mar 26, 2016 · 1 comment

Comments

@joshrsmith
Copy link
Contributor

This may be a known issue, but I didn't see the limitation noted in the documentation.

For example:

package my_msg_types_pkg is

--  type my_type is (something);

  type reset_msg_type_t is (reset);
  type reset_msg_t is record
    msg_type : reset_msg_type_t;
    duration : integer;
  end record reset_msg_t;

end package my_msg_types_pkg;

Will end up using my_type in codec generation, which is a problem since my_type was never actually defined (since it is commented out). This causes the generated codecs package to not compile.

Here is a snippet of what gets generated...

...
  function encode (
    constant data : my_type)
    return string;
  alias encode_my_type is encode[my_type return string];
  function decode (
    constant code : string)
    return my_type;
  alias decode_my_type is decode[string return my_type];
  procedure decode (
    constant code   : string;
    variable index : inout positive;
    variable result : out my_type);
  alias decode_my_type is decode[string, positive, my_type];
...
@LarsAsplund
Copy link
Collaborator

I'll add our standard comment removal which ignores anything between -- and the end of the line. Block comments will not be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants