(zilch lang ninja): parse (then throw away) pool information
This commit is contained in:
parent
8080da3ba0
commit
559350369c
1 changed files with 18 additions and 1 deletions
|
|
@ -376,6 +376,21 @@
|
|||
(parse-variable)
|
||||
rule)
|
||||
|
||||
(define (read-pool)
|
||||
(define name (read-token))
|
||||
(unless (string? name) (error "reading pool: expected valid ident, found" name))
|
||||
(unless (expect-token 'newline) (error "reading pool: expected name to be followed by newline"))
|
||||
(define (parse-variable)
|
||||
(define name #f)
|
||||
(define contents #f)
|
||||
(when (expect-token 'indent)
|
||||
(set! name (read-token))
|
||||
(unless (string? name) (error "reading pool: expected name, found" name))
|
||||
(unless (expect-token 'equals) (error "reading poolo: expected equals, found" (read-token)))
|
||||
(set! contents (read-eval-string-text #f))
|
||||
(parse-variable)))
|
||||
(parse-variable))
|
||||
|
||||
(define (read-build-edge file)
|
||||
(define (read-list tail)
|
||||
(define eval-string (try-read-eval-string-text #t))
|
||||
|
|
@ -409,6 +424,8 @@
|
|||
(define contents #f)
|
||||
(when (expect-token 'indent)
|
||||
(set! name (read-token))
|
||||
(when (eq? name 'pool) (set! name "pool")) ; uh. how is this supposed to work
|
||||
|
||||
(unless (string? name) (error "reading build edge var: expected name, found" name))
|
||||
(unless (expect-token 'equals) (error "reading build edge var: expected equals, found" (read-token)))
|
||||
(set! contents (resolve-evalstring (read-eval-string-text #f) file #f #f #f))
|
||||
|
|
@ -430,7 +447,7 @@
|
|||
((default)
|
||||
(do () ((expect-token 'newline)) (set-build-file-default-targets! file (cons (resolve-evalstring (read-eval-string-text #t) file #f #f #f) (build-file-default-targets file)))))
|
||||
((subninja include) (error "todo: includes"))
|
||||
((pool) (error "todo: pool declaration"))
|
||||
((pool) (read-pool) (read-toplevel file))
|
||||
((newline) (read-toplevel file))
|
||||
(else
|
||||
(unless (string? token) (error "unexpected" (list token i)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue