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

Version 1.0.0 #29

Merged
merged 187 commits into from
Sep 17, 2023
Merged

Version 1.0.0 #29

merged 187 commits into from
Sep 17, 2023

Conversation

QuickWrite
Copy link
Owner

No description provided.

Why: Just redoing it.
Add the structure on how the parser should work as a base layer.
When a failure or a skip parse result was initialized it was always newly created and didn't use a cache.
Change ifs to a switch.

Remove an import.
The parser now returns a FluentResource instead of null.
Change the base FluentParser interface to a generic interface so that it can be used for for occurrences and more checks can be applied at compile time.
Skippers are parsers that just tell the system to skip the current characters so that things like whitespace (or similar) are not getting processed.
FluentEntries are the base blocks for fluent itself and with that they need to be parsed first.
Add the other entry parser: "FluentTermParser".
Move the entry parsers to their own package: "entry"
The pattern parsing system is running through all of the available parsers and checks if they would work. If they would work they are checking if they would return a ParseError and if they don't a new element is added or the possible part is being skipped.

After that the TextElements are being added by always tracking the amount of characters that have been checked and if a newline happens or a parser returns a valid response it is getting cut out and added to the list.
To declare the end of the body of an entry a special function can be used that is checking if the body itself should terminate.
The sanitizer itself is combining the textElements, removes the trailing whitespace and removes unnecessary elements from the strings.
When the file would have been
```ftl
test = Hello,
  this is a
     test.
```

It would have returned:
```text
Hello,
this is a
test
```

but the correct result is:
```text
Hello,
this is a
   test.
```
Add the fluent variable parser that parses the variable reference in a placeable to an instance of the FluentVariableReference class.
Even though lists are quite useful in Java, they shouldn't really be used for data that is static and won't change again.
As the project is now being compiled in Java 16 there is the record feature which allows for getter, equals, hashCode, toString, etc. generation which makes the code more clean and stable as there is less room for mistakes.
As the Locale class is the default class in the JDK it is a lot more sensible to use that class because it can be used in more scenarios.
As the toString method in Exceptions shouldn't really be overridden and the getLocalizedMessage is the correct method for provinding the reason of the Exception it is being changed.
@QuickWrite QuickWrite added this to the 1.0 milestone Sep 17, 2023
@QuickWrite QuickWrite self-assigned this Sep 17, 2023
Change the README to work for the new version of fluent.
As the method wasn't being used and can easily be replicated with the existing API it can easily be removed.
@QuickWrite QuickWrite merged commit 5829fb2 into master Sep 17, 2023
5 checks passed
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.

1 participant