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

Implement validation #3

Merged
merged 31 commits into from
Apr 25, 2024
Merged

Implement validation #3

merged 31 commits into from
Apr 25, 2024

Conversation

frosch123
Copy link
Member

  • Usage is explained in the readme: https://github.com/frosch123/nile-validator/blob/wip/README.md
  • I use the term "dialect" for what nile-config calls "format". "format" sounded like "txt" vs. "json" to me. The values for "dialect" use the same spelling/capitalisation as Bananas.
  • There are some bells and whistles left, but otherwise this is complete.
  • The commit history is mostly chaos, so squash it is.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
}

/// Replace all ASCII control codes with blank.
/// Remove trailing blanks at end of each line.
Copy link
Member

Choose a reason for hiding this comment

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

Is this meant as doxygen-style comment? Or a reminder to yourself?

Otherwise, can I suggest /** .. */ instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is meant as rustdoc, which seems to use ///.

struct StringSignature {
parameters: HashMap<usize, &'static CommandInfo<'static>>,
nonpositional_count: BTreeMap<String, (Occurence, usize)>,
// TODO track color/lineno/colorstack for positional parameters
Copy link
Member

Choose a reason for hiding this comment

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

still todo?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this is part of the "bells and whistles". Currently stashed.

config: &LanguageConfig,
test: &ParsedString,
base: Option<&ParsedString>,
) -> Vec<ValidationError> {
Copy link
Member

Choose a reason for hiding this comment

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

This function is over 300 lines long; any chance we can split it up a bit?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I am aware. There is also some code duplication with other methods. I need some kind of generator/iterator to loop over commands and figureing out positional parameter references.
Also part of "bells and whistles"

@frosch123 frosch123 merged commit 3db12a9 into OpenTTD:main Apr 25, 2024
1 check passed
@frosch123 frosch123 deleted the wip branch April 26, 2024 19:17
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

Successfully merging this pull request may close these issues.

2 participants