- Timestamp:
- 08/19/08 22:07:25 (3 months ago)
- Files:
-
- 1 modified
-
src/perl6/STD.pm (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/perl6/STD.pm
r21951 r21952 445 445 } 446 446 447 token ident ifier{447 token ident { 448 448 <.alpha> \w* 449 449 } … … 453 453 } 454 454 455 token ident {456 <.ident ifier> [ <.apostrophe> <.identifier> ]*455 token identifier { 456 <.ident> [ <.apostrophe> <.ident> ]* 457 457 } 458 458 … … 462 462 ^^ '=' <.unsp>? 463 463 [ 464 | 'begin' \h+ <ident > :: .*?465 "\n=" <.unsp>? 'end' \h+ $<ident > » \N* {*} #= tagged464 | 'begin' \h+ <identifier> :: .*? 465 "\n=" <.unsp>? 'end' \h+ $<identifier> » \N* {*} #= tagged 466 466 | 'begin' » :: \h* \n .*? 467 467 "\n=" <.unsp>? 'end' » \N* {*} #= anon … … 564 564 565 565 token label { 566 <ident > ':' <?before \s> <.ws>567 568 [ <?{ $¢.is_type($<ident >.text) }>566 <identifier> ':' <?before \s> <.ws> 567 568 [ <?{ $¢.is_type($<identifier>.text) }> 569 569 <.panic("You tried to use an existing typename as a label")> 570 # <suppose("You tried to use an existing name $/{'ident '} as a label")>570 # <suppose("You tried to use an existing name $/{'identifier'} as a label")> 571 571 ]? 572 572 573 573 # add label as a pseudo type 574 # {{ eval 'COMPILING::{"::$<ident >"} = Label.new($<ident>)' }} # XXX need statement ref too?574 # {{ eval 'COMPILING::{"::$<identifier>"} = Label.new($<identifier>)' }} # XXX need statement ref too? 575 575 576 576 } … … 839 839 840 840 token fatarrow { 841 <key=ident > \h* '=>' :: <.ws> <val=EXPR(item %item_assignment)>841 <key=identifier> \h* '=>' :: <.ws> <val=EXPR(item %item_assignment)> 842 842 } 843 843 … … 848 848 ':' 849 849 [ 850 | '!' <ident >851 { $key = $<ident >.text; $value = 0; }850 | '!' <identifier> 851 { $key = $<identifier>.text; $value = 0; } 852 852 {*} #= false 853 | <ident >854 { $key = $<ident >.text; }853 | <identifier> 854 { $key = $<identifier>.text; } 855 855 [ 856 856 || <.unsp>? '.'? <postcircumfix> { $value = $<postcircumfix>; } … … 875 875 ':' 876 876 [ 877 | '!' <ident >878 { $key = $<ident >.text; $value = 0; }877 | '!' <identifier> 878 { $key = $<identifier>.text; $value = 0; } 879 879 {*} #= false 880 | <ident >881 { $key = $<ident >.text; }880 | <identifier> 881 { $key = $<identifier>.text; } 882 882 [ 883 883 || <.unsp>? '.'? <?before '('> <postcircumfix> { $value = $<postcircumfix>; } … … 1550 1550 token name { 1551 1551 [ 1552 | <ident > <morename>*1552 | <identifier> <morename>* 1553 1553 | <morename>+ 1554 1554 ]? … … 1560 1560 <?before '(' | <alpha> > 1561 1561 [ 1562 | <ident >1562 | <identifier> 1563 1563 | '(' :: <in: ')', 'EXPR', 'indirect name'> 1564 1564 ] … … 1602 1602 1603 1603 token typename { 1604 <longname> 1605 <?{ 1604 [ 1605 | '::?'<identifier> # parse ::?CLASS as special case 1606 | <longname> 1607 <?{ 1606 1608 my $longname = $<longname>.text; 1607 1609 substr($longname, 0, 2) eq '::' or $¢.is_type($longname) 1608 }> 1610 }> 1611 ] 1609 1612 # parametric type? 1610 1613 <.unsp>? [ <?before '['> <postcircumfix> ]? … … 2426 2429 } 2427 2430 token trait_auxiliary:will { 2428 <sym> <.ws> <ident > <.ws> <block>2431 <sym> <.ws> <identifier> <.ws> <block> 2429 2432 } 2430 2433 … … 2498 2501 ':' 2499 2502 [ 2500 | <name=ident > '(' <.ws>2503 | <name=identifier> '(' <.ws> 2501 2504 [ <named_param> | <param_var> <.ws> ] 2502 2505 [ ')' || <.panic: "Unable to parse named parameter; couldn't find right parenthesis"> ] … … 2509 2512 [ 2510 2513 # Is it a longname declaration? 2511 || <?{ $<sigil>.text eq '&' }> <?ident > ::2512 <ident =sublongname>2514 || <?{ $<sigil>.text eq '&' }> <?identifier> :: 2515 <identifier=sublongname> 2513 2516 2514 2517 || # Is it a shaped array or hash declaration? 2515 2518 <?{ $<sigil>.text eq '@' || $<sigil>.text eq '%' }> 2516 <ident >?2519 <identifier>? 2517 2520 <?before <[ \< \( \[ \{ ]> > 2518 2521 <postcircumfix> 2519 2522 2520 2523 # ordinary parameter name 2521 || <ident >2524 || <identifier> 2522 2525 2523 2526 # bare sigil? … … 2609 2612 2610 2613 token term:sym<::?IDENT> ( --> Term) { 2611 $<sym> = [ '::?' <ident > ] »2614 $<sym> = [ '::?' <identifier> ] » 2612 2615 } 2613 2616 … … 3068 3071 # { <typename> <?spacey> <arglist> { $<sym> = $<typename>.item; } } 3069 3072 3070 # force ident (), ident.(), etc. to be a function call always3071 token term:ident ( --> Term )3073 # force identifier(), identifier.(), etc. to be a function call always 3074 token term:identifier ( --> Term ) 3072 3075 { 3073 3076 :my $i; 3074 $i = <ident > <args( $¢.is_type($i.text) )>3077 $i = <identifier> <args( $¢.is_type($i.text) )> 3075 3078 } 3076 3079 … … 3097 3100 3098 3101 # names containing :: may or may not be function calls 3099 # bare ident without parens also handled here if no other rule parses it3102 # bare identifier without parens also handled here if no other rule parses it 3100 3103 token term:name ( --> Term) 3101 3104 { … … 3672 3675 } 3673 3676 3674 token assertion:ident { <ident> [ # is qq right here?3677 token assertion:identifier { <identifier> [ # is qq right here? 3675 3678 | <?before '>' > 3676 3679 | <.ws> <nibbler> … … 3738 3741 3739 3742 token mod_internal:adv { 3740 <?before ':' <ident > > [ :lang($¢.cursor_fresh($+LANG)) <quotepair> ] { $/<sym> := «: $<quotepair><key>» }3743 <?before ':' <identifier> > [ :lang($¢.cursor_fresh($+LANG)) <quotepair> ] { $/<sym> := «: $<quotepair><key>» } 3741 3744 } 3742 3745
