@@ -41,34 +41,12 @@ string access(int p) {
4141 p % 8 in [ 4 , 5 ] and result = "readable"
4242}
4343
44- bindingset [ s]
45- int parseInt ( string s ) {
46- exists ( string values , string str |
47- s .matches ( "0b%" ) and values = "01" and str = s .suffix ( 2 )
48- or
49- s .matches ( "0x%" ) and values = "0123456789abcdef" and str = s .suffix ( 2 )
50- or
51- s .charAt ( 0 ) = "0" and not s .charAt ( 1 ) = [ "b" , "x" ] and values = "01234567" and str = s .suffix ( 1 )
52- or
53- s .charAt ( 0 ) != "0" and values = "0123456789" and str = s
54- |
55- result =
56- sum ( int index , string c , int v , int exp |
57- c = str .replaceAll ( "_" , "" ) .charAt ( index ) and
58- v = values .indexOf ( c .toLowerCase ( ) ) and
59- exp = str .replaceAll ( "_" , "" ) .length ( ) - index - 1
60- |
61- v * values .length ( ) .pow ( exp )
62- )
63- )
64- }
65-
6644/** An expression specifing a file permission that allows group/others read or write access */
6745class PermissivePermissionsExpr extends Expr {
6846 // TODO: non-literal expressions?
6947 PermissivePermissionsExpr ( ) {
7048 exists ( int perm , string acc |
71- perm = parseInt ( this .( IntegerLiteral ) .getValueText ( ) ) and
49+ perm = this .( IntegerLiteral ) .getValue ( ) and
7250 ( acc = access ( world_permission ( perm ) ) or acc = access ( group_permission ( perm ) ) )
7351 )
7452 or
0 commit comments