-
Notifications
You must be signed in to change notification settings - Fork 4
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
Ability to include untagged remarks into parse tree and formatter output #64
Comments
Probably depends on #65, because it can clarify what are expected attach points. |
We need to parse untagged remarks and also include it in the output of e.g.
The first part:
This is an "untagged remark" because a "tagged remark" is attached to an object and looks like this:
Right now Expressir is not rendering the untagged remarks. For example: exp_file = "schemas/resources/action_schema/action_schema.exp"
repository = Expressir::Express::Parser.from_files([exp_file])
formatter = Class.new(Expressir::Express::Formatter) do
def format_remark(node, remark)
[
[
'(*',
'"',
node.path || node.id,
'"',
].join(''),
remark,
'*)'
].join("\n")
end
end
puts formatter.format(repository) This gives you the pretty formatted version but without the untagged remark (the tagged remarks exist)
|
The challenge is that Express formatting is different between original and formatted code. I'll probably need to introduce some sort of attach points where untagged remarks can attach to (e.g. after each item in a list). With this approach, slight variances would still be possible.
The text was updated successfully, but these errors were encountered: