~ubuntu-branches/ubuntu/wily/acl2/wily

« back to all changes in this revision

Viewing changes to books/centaur/vl/loader/parser/tests/blockitems.lisp

  • Committer: Package Import Robot
  • Author(s): Camm Maguire
  • Date: 2015-01-16 10:35:45 UTC
  • mfrom: (3.3.26 sid)
  • Revision ID: package-import@ubuntu.com-20150116103545-prehe9thgo79o8w8
Tags: 7.0-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
       ((vl-vardecl v1) v1))
91
91
    (debuggable-and (not (cw "Inspecting ~x0.~%" (car vars)))
92
92
                    (equal (car names)    v1.name)
93
 
                    (equal (car dims)     (vl-pretty-packeddimensionlist v1.dims))
94
93
                    (equal (car initvals) (and v1.initval (vl-pretty-expr v1.initval)))
95
94
                    (equal constp         v1.constp)
96
95
                    (equal varp           v1.varp)
97
96
                    (equal lifetime       v1.lifetime)
98
 
                    (equal type           (vl-pretty-datatype v1.vartype))
 
97
                    (let ((type (append-without-guard
 
98
                                 type (and (car dims) (cons ':udims (car dims))))))
 
99
                      (or (equal type
 
100
                                 (vl-pretty-datatype v1.type))
 
101
                          (cw "type -- spec: ~x0 actual: ~x1~%"
 
102
                              type (vl-pretty-datatype v1.type))))
99
103
                    (equal atts           v1.atts)
100
104
                    (run-vardecltest-aux (cdr vars)
101
105
                                         constp varp lifetime type atts
117
121
                         test.dims
118
122
                         test.initvals)))
119
123
 
 
124
(defparser-top vl-parse-block-item-declaration)
 
125
 
120
126
(define test-parse-block-item-declaration-1 ((test vl-vardecltest-p)
121
127
                                             (config vl-loadconfig-p))
122
128
  :returns (okp booleanp)
123
129
  (b* (((vl-vardecltest test) test)
124
130
       (tokens   (make-test-tokens test.input))
125
 
       (warnings 'blah-warnings)
 
131
       (pstate   (make-vl-parsestate :warnings 'blah-warnings))
126
132
       (- (cw "-------~%"))
127
133
       (- (cw "Testing block item parsing, using edition ~s0.~%" (vl-loadconfig->edition config)))
128
134
       (- (cw "Input: ~s0~%" test.input))
129
135
       (- (cw "Expect ~s0.~%" (if test.successp "success" "failure")))
130
 
       ((mv err vars ?tokens warnings) (vl-parse-block-item-declaration))
 
136
       ((mv err vars ?tokens (vl-parsestate pstate)) (vl-parse-block-item-declaration-top))
131
137
       ((when err)
132
138
        (cw "Parsing reports an error: ~x0.~%" err)
133
139
        (and (not test.successp)
134
 
             (equal warnings 'blah-warnings)
 
140
             (equal pstate.warnings 'blah-warnings)
135
141
             (not (cw "Test successful.~%")))))
136
142
 
137
143
    (cw "Parsing reports success: ~x0.~%" vars)
138
144
    (debuggable-and test.successp
139
 
                    (equal warnings 'blah-warnings)
 
145
                    (equal pstate.warnings 'blah-warnings)
140
146
                    (run-vardecltest vars test)
141
147
                    (not (cw "Test successful.~%")))))
142
148