public static CapturedToken from(IdlTokenizer tokenizer, Function<CharSequence, String> stringTable) {
        IdlToken tok = tokenizer.getCurrentToken();
        return builder()
                .token(tok)
                .filename(tokenizer.getSourceFilename())
                .position(tokenizer.getCurrentTokenStart())
                .startLine(tokenizer.getCurrentTokenLine())
                .startColumn(tokenizer.getCurrentTokenColumn())
                .endLine(tokenizer.getLine())
                .endColumn(tokenizer.getColumn())
                .lexeme(tokenizer.getCurrentTokenLexeme())
                .stringContents(tok == IdlToken.STRING || tok == IdlToken.TEXT_BLOCK || tok == IdlToken.IDENTIFIER
                        ? stringTable.apply(tokenizer.getCurrentTokenStringSlice())
                        : null)
                .numberValue(tok == IdlToken.NUMBER ? tokenizer.getCurrentTokenNumberValue() : null)
                .errorMessage(tok == IdlToken.ERROR ? tokenizer.getCurrentTokenError() : null)
                .build();
    }
Persist the current token of an {@link IdlTokenizer}.

@param tokenizer   Tokenizer to capture.
@param stringTable String table that caches previously created strings.
@return Returns the persisted token.
smithy-syntax/src/main/java/software/amazon/smithy/syntax/CapturedToken.java