Compil...:Token(3pm)
β¨ NAME β¨
Compiler::Lexer::Token β it's the Token object for Compiler::Lexer, bestie π
Like, one page in the Compil...:Token(3pm) manual, third section, User Contributed Perl Documentation vibes. Periodt.
πΈ SYNOPSIS πΈ
So Compiler::Lexer::Token includes the following members. That's it, that's the whole cast of characters π
stypeβ the constant ofCompiler::Lexer::SyntaxType.typeβ the constant ofCompiler::Lexer::TokenType.kindβ the constant ofCompiler::Lexer::Kind.nameβ the name ofCompiler::Lexer::TokenType.dataβ the raw data, literally just the raw stuff, no filter.has_warningsβ a flag of whether it's an unknown keyword or not. Yep, it's the snitch flag π
π METHODS π
It supports simple get/set accessors like Class::Accessor::Fast. Very demure, very mindful, very get-and-set π«Ά
example:
my $type = $token->type; # get accessor
$token->type(Compiler::Lexer::TokenType::T_RegExp); # set accessor
See? Call it with no args and it gets, call it with an arg and it sets. Main character energy, no cap β¨
π AUTHOR π
Masaaki Goshima (goccy) <goccy(at)cpan.org>
π LICENSE AND COPYRIGHT π
Copyright (c) 2013, Masaaki Goshima (goccy). All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay that's the whole page bestie, go write some lexers π
perl v5.42.3 Β· 2026-08-19 Β· Compil...:Token(3pm) β mwah, thanks for reading, slay ππβ¨
π¦ where this page comes from
- ubuntu stonking: libcompiler-lexer-perl 0.23-3build6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms