Linux lorencats.com 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l
Apache/2.4.59 (Raspbian)
: 10.0.0.29 | : 216.73.216.10
Cant Read [ /etc/named.conf ]
7.3.31-1~deb10u7
root
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
share /
guile /
2.2 /
ice-9 /
peg /
[ HOME SHELL ]
Name
Size
Permission
Action
cache.scm
1.99
KB
-rw-r--r--
codegen.scm
13.51
KB
-rw-r--r--
simplify-tree.scm
3.37
KB
-rw-r--r--
string-peg.scm
9.99
KB
-rw-r--r--
using-parsers.scm
4.66
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : simplify-tree.scm
;;;; simplify-tree.scm --- utility functions for the PEG parser ;;;; ;;;; Copyright (C) 2010, 2011 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public ;;;; License as published by the Free Software Foundation; either ;;;; version 3 of the License, or (at your option) any later version. ;;;; ;;;; This library is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;;; Lesser General Public License for more details. ;;;; ;;;; You should have received a copy of the GNU Lesser General Public ;;;; License along with this library; if not, write to the Free Software ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;;;; (define-module (ice-9 peg simplify-tree) #:export (keyword-flatten context-flatten string-collapse) #:use-module (system base pmatch)) (define-syntax single? (syntax-rules () "Return #t if X is a list of one element." ((_ x) (pmatch x ((_) #t) (else #f))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;; POST-PROCESSING FUNCTIONS (TO CANONICALIZE MATCH TREES) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Is everything in LST true? (define (andlst lst) (or (null? lst) (and (car lst) (andlst (cdr lst))))) ;; Is LST a list of strings? (define (string-list? lst) (and (list? lst) (not (null? lst)) (andlst (map string? lst)))) ;; Groups all strings that are next to each other in LST. Used in ;; STRING-COLLAPSE. (define (string-group lst) (if (not (list? lst)) lst (if (null? lst) '() (let ((next (string-group (cdr lst)))) (if (not (string? (car lst))) (cons (car lst) next) (if (and (not (null? next)) (list? (car next)) (string? (caar next))) (cons (cons (car lst) (car next)) (cdr next)) (cons (list (car lst)) next))))))) ;; Collapses all the string in LST. ;; ("a" "b" (c d) "e" "f") -> ("ab" (c d) "ef") (define (string-collapse lst) (if (list? lst) (let ((res (map (lambda (x) (if (string-list? x) (apply string-append x) x)) (string-group (map string-collapse lst))))) (if (single? res) (car res) res)) lst)) ;; If LST is an atom, return (list LST), else return LST. (define (mklst lst) (if (not (list? lst)) (list lst) lst)) ;; Takes a list and "flattens" it, using the predicate TST to know when to stop ;; instead of terminating on atoms (see tutorial). (define (context-flatten tst lst) (if (or (not (list? lst)) (null? lst)) lst (if (tst lst) (list lst) (apply append (map (lambda (x) (mklst (context-flatten tst x))) lst))))) ;; Takes a list and "flattens" it, using the list of keywords KEYWORD-LST to ;; know when to stop at (see tutorial). (define (keyword-flatten keyword-lst lst) (context-flatten (lambda (x) (if (or (not (list? x)) (null? x)) #t (member (car x) keyword-lst))) lst))
Close