aboutsummaryrefslogtreecommitdiff
path: root/module/c/cpp-util.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-07-13 12:51:54 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-07-13 12:51:54 +0200
commit3dce81345d11a41ff9a494053e2586cc4bb89936 (patch)
treea975162ebd16f4cb1f4b775ec6126c8b417b69fb /module/c/cpp-util.scm
parentMisc tests. (diff)
downloadcalp-3dce81345d11a41ff9a494053e2586cc4bb89936.tar.gz
calp-3dce81345d11a41ff9a494053e2586cc4bb89936.tar.xz
Comment out typechecks on token stream.
Each such typecheck ran in linear time on the remaining tokens, which is a bit to much. Remove it, and hope that the code behaves. Some stats, from running make coverage GUILE=guile3 With typechecks --------------- Slow test: "Parameter expansion times", took 1.077431 Slow test: "Example 3, except part below", took 16.952855 Slow test: "True test", took 18.335534 Slow test: "Example 5", took 3.351126 Slow test: "Example 7", took 2.804212 -------------------------------------------------- Without typechecks ------------------ Slow test: "Example 3, except part below", took 12.863874 Slow test: "True test", took 14.016901 Slow test: "Example 5", took 2.166008 Slow test: "Example 7", took 2.252685
Diffstat (limited to 'module/c/cpp-util.scm')
-rw-r--r--module/c/cpp-util.scm12
1 files changed, 6 insertions, 6 deletions
diff --git a/module/c/cpp-util.scm b/module/c/cpp-util.scm
index 7969ccd5..3ea06505 100644
--- a/module/c/cpp-util.scm
+++ b/module/c/cpp-util.scm
@@ -35,7 +35,7 @@
;; - tokens until a newline token is met
;; - (potentially the newline token) and the remaining tokens
(define (tokens-until-eol tokens)
- (typecheck tokens (list-of lexeme?))
+ ;; (typecheck tokens (list-of lexeme?))
(break newline-token? tokens))
;; call predicate with the remaining token stream, until we run out of token, or
@@ -74,22 +74,22 @@
;; Drop leading whitespace tokens
(define (drop-whitespace tokens)
- (typecheck tokens (list-of lexeme?))
+ ;; (typecheck tokens (list-of lexeme?))
(drop-while whitespace-token? tokens))
(define (drop-whitespace/line tokens)
- (typecheck tokens (list-of lexeme?))
+ ;; (typecheck tokens (list-of lexeme?))
(drop-while (lambda (t)
(and (whitespace-token? t)
(not (newline-token? t))))
tokens))
(define (drop-whitespace-right tokens)
- (typecheck tokens (list-of lexeme?))
+ ;; (typecheck tokens (list-of lexeme?))
(-> tokens reverse drop-whitespace reverse))
(define (drop-whitespace-both tokens)
- (typecheck tokens (list-of lexeme?))
+ ;; (typecheck tokens (list-of lexeme?))
(-> tokens
drop-whitespace
drop-whitespace-right))
@@ -103,7 +103,7 @@
;; "( 2, 4 )"
;; 6.10.3.2 p 2
(define (cleanup-whitespace tokens)
- (typecheck tokens (list-of lexeme?))
+ ;; (typecheck tokens (list-of lexeme?))
(-> tokens drop-whitespace-both squeeze-whitespace))
(define (concatenate-tokens a b)