Open abtris opened 9 years ago
@pksunkara commented
As I said, this is intentional. The AST produced by snowcrash should depict what the user exactly wrote. Even though, they mean the same, they can be represented differently in the AST.
Although, there is a different bug in this too. https://github.com/apiaryio/snowcrash/issues/286
@klokane commented
Oh sry for duplicity, issue apiaryio/snowcrash#286 I miss. I'm in trouble in refract AST implementation because there is no way to say if value is sample. Except workarround, while I check last && first value for presence of asterisk, and cut them from literal. But I mean it is really weird solution!
What do you mean about it @zdne ?
@zdne commented
@klokane @pksunkara
The AST produced by snowcrash should depict what the user exactly wrote
Originally this was the case, yes. However as we are moving forward this should not be the case in a future. I would strongly recommend to move away from different AST for different notations of the same thing (as is the case here). Instead – in a future – both should be parsed into the same structure (refract tree). It is the task for a (future) source map to help user – if needed – to figure out whether the sample value comes from one line or multiple lines.
So I do not think this is a bug at the moment, however when we move to parsing into refract I would move away fro this practice (it will also make manipulation with the parse (refract) tree a lot easier).
@klokane opened apiaryio/snowcrash#327
according to MSON spec: https://github.com/apiaryio/mson/blob/master/MSON%20Specification.md#44-sample
Is equivalent to:
but if you sent it to snowcrash, following blueprint:
Result is following:
list1
hassample
atribute,list2
has no. AndvalueDefinition
are in both cases different too