berp icon indicating copy to clipboard operation
berp copied to clipboard

Various Java razor improvements

Open mpkorstanje opened this issue 5 years ago • 0 comments

I made a couple of improvements to the razor file for Java. This make the file usable out of the box.

  • Constructor name should be equal to the class name
  • Moved the comments to avoid whitespace at start of file
  • Made fields, classes and methods package private to avoid exposing parser in public API
  • Replaced dedicated ITokenScanner interface with Iterator<Token> and Iterable<Token>
  • Renamed TokenMatcher to SimpleTokenMatcher
  • Renamed ITokenMatcher to TokenMatcher to fit with Java standards
  • Added Func class.
  • Redid parse method arguments. The Reader interface isn't the right tool here. It only allows individual bytes to be read rather then codepoints.

mpkorstanje avatar May 22 '20 11:05 mpkorstanje