Implement a Scanner type in Go that can tokenize source code. The Scanner should be able to handle various token types such as identifiers, keywords, numbers (integers and floats), characters, string literals, comments, and whitespace. The functionality must include:
Initialization: A method to initialize the Scanner with a source input (e.g., provided by a reader).
Tokenization:
The Scan method must return the next token in the source.
Handle illegal characters and malformed literals, returning appropriate token values (e.g., utf8.RuneError for illegal UTF-8 sequences).
Position Tracking: Implement a Position struct to keep track of the current position of the scanner in terms of offset, line number, and column. This should be updated as tokens are consumed.
Custom Identifier Rules: Allow for custom rules for what constitutes an identifier through a callback function (IsIdentRune).
Error Handling: Implement an error handler that captures and logs parsing errors, including detailed information about the error position and message.
Whitespace Handling: Provide a mechanism to skip or include whitespace characters based on the scanner's configuration.
Ensure all functionality is well tested by using the provided test code, which includes numerous test cases for various token types and error handling scenarios. The implementation should be placed in the /app/ directory.
Important: declare your solution in package scanner (the test file uses package scanner, so the implementation must use the matching package name).