Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

ParametersParser refacor #119

Merged
merged 8 commits into from
Jun 19, 2014
Merged

Conversation

pksunkara
Copy link
Contributor

WIP

@psunkara
Copy link

Can you please unsubscribe me from these emails.

From: Pavan Kumar Sunkara <notifications@github.commailto:notifications@github.com>
Reply-To: apiaryio/snowcrash <reply@reply.github.commailto:reply@reply.github.com>
Date: Thursday, June 12, 2014 at 8:19 AM
To: apiaryio/snowcrash <snowcrash@noreply.github.commailto:snowcrash@noreply.github.com>
Subject: [snowcrash] ParametersParser refacor (#119)

WIP


You can merge this Pull Request by running

git pull https://github.com/apiaryio/snowcrash pksunkara/refactor

Or view, comment on, or merge it at:

#119

Commit Summary

  • Started on ParameterParser
  • WIP: ParameterParser refactor almost done
  • Finished ValuesParser

File Changes

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com//pull/119.

Confidentiality Notice: This email message, including attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

@pksunkara
Copy link
Contributor Author

@psunkara Please click on "Unwatch" on the top right of the repo.

Thanks

@@ -110,7 +113,7 @@ namespace snowcrash {
Value exampleValue;

/** Enumeration of possible values */
Collection<Value>::type values;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pksunkara we have @alikh31 working over this interface – it would be really good if we avoid changes in this file unless absolutely necessary (e.g. the case with symbol table). Again we will revisit this file later but no need to do this at the moment. Please use typedef Collection<Value>::type Values; only "internally" on in the Values parser for now.

// REQUIRE(blueprint.resourceGroups[0].resources[0].parameters[0].defaultValue == "42");
//}

// TODO: How to warn for this?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zdne Forgot to ask you today. I am wondering where to do this warning. In ParameterParser, while running nestedSectionType ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that Values: is not recognized should be reported and ignored by the base implementation of SectionProcessorprocessUnexpectedNode()

Looking at SectionProcessorBase:: processUnexpectedNode – sorry if I have forgot something, but didn't we agree on having it default implementation as warn & skip? (report ignoring and move to next node)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be considered as description node? Why are we processing it as unexpected node?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, I am asking whether we need to check for Values\n when running the nestedSectionType in ParameterParser?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be considered as description node? Why are we processing it as unexpected node?

This is good point! The only reason for this would be to warn user about the mistake. It is quite annoying when you think you wrote a keyword and it ends up (without warning) in the description.

However this should be handled more conceptually. So while leaving this to on the parser will for not worsen the situation for writer, I agree.

We should address this in #65

SectionParserHelper<Parameter, ParameterParser>::parse(source, ParameterSectionType, report, parameter);

REQUIRE(report.error.code == Error::OK);
REQUIRE(report.warnings.empty());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zdne Due to the parser model, the Values: node is being identified as descriptionNode therefore not calling processUnexpectedNode. What do you want me to do here?

Other than that, this PR is ready to be merged once you review the latest commit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zdne
Copy link
Contributor

zdne commented Jun 19, 2014

@pksunkara Last 2 commits look OK. Is this still WIP or it is good to merge?

zdne added a commit that referenced this pull request Jun 19, 2014
@zdne zdne merged commit 03cbb6d into shared/refactor-integration Jun 19, 2014
@zdne zdne deleted the pksunkara/refactor branch June 19, 2014 09:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants