p5-Compiler-Lexer icon indicating copy to clipboard operation
p5-Compiler-Lexer copied to clipboard

qoutewords parsed as regex

Open briandfoy opened this issue 10 years ago • 0 comments

use Compiler::Lexer 0.13; use Data::Dumper; my $lexer = Compiler::Lexer->new( $0 ); my $tokens = $lexer->tokenize( 'qw( foo bar baz )' ); say Dumper ($tokens );

$VAR1 = [ bless( { 'has_warnings' => 0, 'line' => 1, 'stype' => 0, 'kind' => 30, 'type' => 147, 'data' => 'qw', 'name' => 'RegList' }, 'Compiler::Lexer::Token' ), bless( { 'name' => 'RegDelim', 'data' => '(', 'type' => 151, 'kind' => 24, 'line' => 1, 'stype' => 0, 'has_warnings' => 0 }, 'Compiler::Lexer::Token' ), bless( { 'type' => 186, 'name' => 'RegExp', 'data' => ' foo bar baz ', 'has_warnings' => 0, 'line' => 1, 'stype' => 0, 'kind' => 24 }, 'Compiler::Lexer::Token' ), bless( { 'type' => 151, 'name' => 'RegDelim', 'data' => ')', 'has_warnings' => 0, 'line' => 1, 'stype' => 0, 'kind' => 24 }, 'Compiler::Lexer::Token' ) ];

briandfoy avatar Jan 16 '15 05:01 briandfoy