Codebase list cafeobj / e9a5276
Bug fix: operator with name with ':' in it, suchas Op:S, causes crash some cases. tswd 8 years ago
2 changed file(s) with 10 addition(s) and 36 deletion(s). Raw diff Collapse all Expand all
313313 (print-sort-name bi *current-module*)
314314 (princ ".")
315315 (terpri))))
316 ;;
317 #||
318 (let ((gv (dictionary-get-token-info
319 (dictionary-table dictionary)
320 var-name)))
321 (when gv
322 (dolist (op-v gv)
323 (when (eq (object-syntactic-type op-v)
324 'variable)
325 (with-output-chaos-error ('already-used-name)
326 (format t "~&on the fly variable name ~A is already used for static variable declaration..." var-name))))))
327 ||#
328316 (setq var-name (intern var-name))
329
330317 ;; success parsing it as a variable declaration.
331318 ;; checks if there alredy a variable with the same
332319 ;; name.
333320 (when *on-parse-debug*
334 (format t "~%on-the-fly var decl: ~A" var-name)
321 (format t "~%on-the-fly var decl: ~A" (string var-name))
335322 (format t "... ~A" *parse-variables*))
336323 (let ((old-var (assoc var-name *parse-variables*)))
337324 (if old-var
343330 (string (sort-id
344331 (variable-sort (cdr
345332 old-var))))
346 (string (sort-id sort))))
347 ;;(setf (cdr old-var)
348 ;; (make-variable-term sort var-name))
349 )
333 (string (sort-id sort)))))
350334 (progn
335 ;; fresh new variable:
351336 ;; check name, if it start with `, we make
352337 ;; pseudo variable
353338 (if (eql #\` (char (the simple-string (string var-name)) 0))
356341 (push (cons var-name var) *parse-variables*)))
357342 (if old-var
358343 (progn
359 (push (cdr old-var) res)
360 #||
361 (when (err-sort-p (variable-sort
362 (cdr old-var)))
363 (pushew (cdr old-var)
364 (module-error-variables
365 *current-module*)))
366 ||#
367 )
368 (let ((svar (assoc var res :test #'equal)))
344 (push (cdr old-var) res))
345 (let ((svar (member var res :test #'equal)))
369346 (when *on-parse-debug*
370347 (format t "~%!res = ~s" res))
371348 (when svar
372349 (with-output-chaos-error ()
373350 (format t "Static variable ~s already used before in the same context" var-name)))
374 (push var res)
375 #||
376 (when (err-sort-p (variable-sort var))
377 (pushnew var (module-error-variables
378 *current-module*)))
379 ||#
380 )))))
351 (push var res))))))
381352
382353 ;; must not be a variable declaration.
383354 ;; try yet other possibilities.
407378 (multiple-value-setq (res mod-token)
408379 (get-qualified-op-pattern token))))))
409380 ;; end collect
381 (when *on-parse-debug*
382 (format t "~%..end collecting info on token ~s" token)
383 (format t "~%..first result: ~s" res))
410384 (when sort-constraint
411385 (let ((real-res nil))
412386 (dolist (r res)
415415 (if (term-is-variable? term)
416416 (print-to-left
417417 (format nil "variable ~a:~a"
418 (variable-name term)
418 (string (variable-name term))
419419 (sort-print-name (term-sort term)))
420420 "-")
421421 (if (term-is-builtin-constant? term)