Changeset 39037 in project


Ignore:
Timestamp:
09/15/20 20:02:42 (6 weeks ago)
Author:
Kon Lovett
Message:

add shift ops, % -> mod, add rem

Location:
release/5/slib-prec/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/5/slib-prec/trunk/slib-standard-grammar.scm

    r38982 r39037  
    9595(prec:define-grammar (prec:nary '&& 'and 60))
    9696(prec:define-grammar (prec:nary "||" 'or 50))
    97 ;(prec:define-grammar (prec:nary "^^" 'xor 40))
     97(prec:define-grammar (prec:nary '^^ 'xor 50))
    9898
    99 (prec:define-grammar (prec:nary '& 'bitwise-and 110))
    100 (prec:define-grammar (prec:nary "|" 'bitwise-ior 100))
     99(prec:define-grammar (prec:nary '& 'bitwise-and 90))
     100(prec:define-grammar (prec:nary "|" 'bitwise-ior 90))
    101101(prec:define-grammar (prec:nary '^ 'bitwise-xor 90))
    102102
    103103;;;infix operators
    104104(prec:define-grammar (prec:infix '** 'expt 140 139))
    105 (prec:define-grammar (prec:infix '% 'modulo 140 139))
     105
     106(prec:define-grammar (prec:infix 'mod 'modulo 140 139))
     107(prec:define-grammar (prec:infix 'rem 'remainder 140 139))
     108
     109(prec:define-grammar (prec:infix '<< 'arithmetic-shift-left 140 139))
     110(prec:define-grammar (prec:infix '>> 'arithmetic-shift-left 139 140))
     111(prec:define-grammar (prec:infix '<<< 'logical-shift-left 140 139))
     112(prec:define-grammar (prec:infix '>>> 'logical-shift-left 139 140))
    106113
    107114(prec:define-grammar (prec:infix '= '= 80 80))
  • release/5/slib-prec/trunk/tests/slib-prec-test.scm

    r38982 r39037  
    6666    (test
    6767      '(or (< a b) (and (f x) (> i (+ (modulo j 3) x))))
    68       (read-sexp/string "a < b || f(x) && i > j % 3 + x"))
     68      (read-sexp/string "a < b || f(x) && i > j mod 3 + x"))
    6969    (test
    7070      '(or (and BAZ PI) (and FOO BAR))
Note: See TracChangeset for help on using the changeset viewer.