227227
228228; ;;; The tokenizer.
229229
230- (cl-defstruct gnuplot-token
230+ (cl-defstruct (gnuplot-context--token
231+ (:constructor gnuplot-context--token-make)
232+ (:copier nil ))
231233 start ; Buffer start position
232234 end ; Buffer end position
233235 id ; Text
250252 `((looking-at , regexp )
251253 (let ((str (match-string-no-properties 0 )))
252254 (forward-char (length str))
253- (make- gnuplot-token :id str
255+ (gnuplot-context-- token-make :id str
254256 :type ', token-type
255257 :start (match-beginning 0 )
256258 :end (match-end 0 ))))))
257259 rules))))
258260
259261(defun gnuplot-context--tokenize (&optional completing-p )
260262 " Tokenize the Gnuplot command at point.
261- Return a list of `gnuplot-token' objects.
263+ Return a list of `gnuplot-context-- token' objects.
262264
263265If COMPLETING-P is non-nil, omits the token at point if it is a
264266name; otherwise continues tokenizing up to the token at point. FIXME."
@@ -294,7 +296,7 @@ name; otherwise continues tokenizing up to the token at point. FIXME."
294296 (let* ((bounds (bounds-of-thing-at-point 'sexp ))
295297 (to (or (cdr bounds) stop-point)))
296298 (goto-char to)
297- (make- gnuplot-token
299+ (gnuplot-context-- token-make
298300 :id (buffer-substring-no-properties from to)
299301 :type 'string
300302 :start from :end to)))
@@ -312,8 +314,8 @@ name; otherwise continues tokenizing up to the token at point. FIXME."
312314 ; ; in that position for completion.
313315 (if (and completing-p
314316 tokens
315- (eq (gnuplot-token-type (car tokens)) 'name )
316- (<= (point ) (gnuplot-token-end (car tokens))))
317+ (eq (gnuplot-context-- token-type (car tokens)) 'name )
318+ (<= (point ) (gnuplot-context-- token-end (car tokens))))
317319 (pop tokens))
318320
319321 (nreverse tokens)))
@@ -333,15 +335,15 @@ name; otherwise continues tokenizing up to the token at point. FIXME."
333335; ; Match any token (fails only at end of command).
334336; ;
335337; ; (literal LITERAL NO-COMPLETE)
336- ; ; Match token with `gnuplot-token-id' LITERAL or fail. If we
338+ ; ; Match token with `gnuplot-context-- token-id' LITERAL or fail. If we
337339; ; have reached the token before point, include LITERAL in the
338340; ; completion list unless NO-COMPLETE is non-`nil' .
339341; ;
340342; ; (token-type TYPE)
341- ; ; Match a token with `gnuplot-token-type' TYPE, or fail.
343+ ; ; Match a token with `gnuplot-context-- token-type' TYPE, or fail.
342344; ;
343345; ; (keyword REGEXP NAME)
344- ; ; Match any token whose `gnuplot-token-id' matches REGEXP. Use
346+ ; ; Match any token whose `gnuplot-context-- token-id' matches REGEXP. Use
345347; ; NAME for the completion list.
346348; ;
347349; ; (jump OFFSET FIXED)
@@ -1804,7 +1806,7 @@ there."
18041806 (opcode (car inst))
18051807 (token (car tokens))
18061808 (end-of-tokens (null tokens)))
1807- (gnuplot-context--trace " %s\t %s\t %s\n " pc inst (and token (gnuplot-token-id token)))
1809+ (gnuplot-context--trace " %s\t %s\t %s\n " pc inst (and token (gnuplot-context-- token-id token)))
18081810
18091811 (cl-case opcode
18101812 ; ; (literal LITERAL NO-COMPLETE)
@@ -1817,7 +1819,7 @@ there."
18171819 (push expect gnuplot-context--completions))
18181820 (fail))
18191821
1820- ((not (equal (gnuplot-token-id token) expect))
1822+ ((not (equal (gnuplot-context-- token-id token) expect))
18211823 (fail))
18221824
18231825 ; ; otherwise succeed
@@ -1827,7 +1829,7 @@ there."
18271829 ((token-type)
18281830 (let ((expect (cadr inst)))
18291831 (if (or end-of-tokens
1830- (not (eq (gnuplot-token-type token) expect)))
1832+ (not (eq (gnuplot-context-- token-type token) expect)))
18311833 (fail)
18321834 (advance))))
18331835
@@ -1841,12 +1843,12 @@ there."
18411843 (push name gnuplot-context--completions)
18421844 (fail))
18431845
1844- ((not (string-match-p regexp (gnuplot-token-id token)))
1846+ ((not (string-match-p regexp (gnuplot-context-- token-id token)))
18451847 (fail))
18461848
18471849 ; ; otherwise succeed
18481850 (t
1849- (setf (gnuplot-token-id token) name)
1851+ (setf (gnuplot-context-- token-id token) name)
18501852 (advance)))))
18511853
18521854 ; ; (any): match any token
@@ -1999,7 +2001,7 @@ there."
19992001 (setq gnuplot-context--info-at-point
20002002 (cond
20012003 ((eq info 'first-token )
2002- (gnuplot-token-id (car position)))
2004+ (gnuplot-context-- token-id (car position)))
20032005 ((functionp info) (funcall info))
20042006 (t info)))
20052007 (when gnuplot-context--info-at-point
@@ -2141,7 +2143,7 @@ clause."
21412143 (3d-p (gnuplot-context--capture-group :splot-command ))
21422144 (column-description nil ))
21432145 (if with-style
2144- (let ((with-style-string (gnuplot-token-id (car with-style))))
2146+ (let ((with-style-string (gnuplot-context-- token-id (car with-style))))
21452147 (setq column-description
21462148 (or (and 3d-p
21472149 (cdr (assoc with-style-string gnuplot-context--using-3d-eldoc)))
0 commit comments