Skip to content

Commit

Permalink
implement [expr !]
Browse files Browse the repository at this point in the history
pmichaud++ # the assist.
  • Loading branch information
coke committed Dec 15, 2009
1 parent c1106c9 commit 71f4a01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions TODO
Expand Up @@ -27,8 +27,6 @@ Tasks/Bugs:

9. regsub -all <exp> <string> <replace>

10. [expr !<token>] {t/cmd_expr.t}

11. add a glob compiler. (http://www.tcl.tk/man/tcl8.5/TclCmd/string.htm#M40)
*, ?, [], \x (prior art: Tcl::Glob in core.) Needed for [string match]
et al.
Expand Down
3 changes: 3 additions & 0 deletions src/Partcl/Grammar.pm
Expand Up @@ -95,6 +95,7 @@ token int:sym<oct> { 0<[Oo]>? $<digits>=(<[0..7]>+) }
# expression parsing

INIT {
Partcl::Grammar.O(':prec<15>, :assoc<unary>', '%unary');
Partcl::Grammar.O(':prec<13>', '%multiplicative');
Partcl::Grammar.O(':prec<12>', '%additive');
Partcl::Grammar.O(':prec<10>', '%compare_numeric');
Expand Down Expand Up @@ -125,6 +126,8 @@ token term:sym<false> {
token term:sym<[ ]> { '[' ~ ']' <script> }
token term:sym<" "> { '"' <quoted_atom>* '"' }

token prefix:sym<!> { <sym> <O('%unary, :pirop<not>')> }

token infix:sym<*> { <sym> <O('%multiplicative, :pirop<mul>')> }
token infix:sym</> { <sym> <O('%multiplicative, :pirop<div>')> }

Expand Down

0 comments on commit 71f4a01

Please sign in to comment.