-
Notifications
You must be signed in to change notification settings - Fork 200
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
Parametrized types do not allow spaces after "(" #792
Comments
Makes sense, thanks for reporting it! It's not a super high priority, but hopefully we'll get to fix it sometime in the future. |
@Mingun Thanks for this research! I've also encountered this problem in my BMP spec on these lines ( type: 'color_table(
not header.is_core_header,
header.extends_bitmap_info ? header.bitmap_info_ext.num_colors_used : 0
)' This fails in the devel Web IDE with the following exception:
However, KSC under JVM (using SnakeYAML library) works fine:
It's possible that the yaml.js is not strictly compliant to the YAML spec, so the document is not parsed properly, but that's not the thing I wanted to show. It looks like quoting the string using quotes is the only way to make it compile under JVM, because in fact all other variants of YAML multiline syntax are rejected:
So I think it totally makes sense to tolerate the whitespace. |
BTW, a similar issue has been addressed by kaitai-io/kaitai_struct_compiler#133. |
…nce parser Fix a bug of not parsed absolute paths of the user types
- process name can be a path with components delimited by dot - kaitai-io/kaitai_struct#792 is fixed, so remove comment about disallowed space - allow space after the process name or the `)` finishing the arguments
Following KSY raises error until space between
(
andtrue
will be deleted:I think that is unnecessary restriction and it can be eliminated. The root of the problem is that parametric type parsing is partially done in manually, and partially using expression language. It is much easier to always parse the entire string as an expression, at the same time you can:
::
(
Now corresponding PEG rule for type references is:
But it would be:
The text was updated successfully, but these errors were encountered: