• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/progmodes/

Lines Matching +defs:string +defs:char

130 (defconst c-awk-harmless-char-re "[^_#/\"\\\\\n\r]")
132 ;; localisation string in gawk 3.1
135 (defconst c-awk-harmless-string*-re
136 (concat "\\(" c-awk-harmless-char-re "\\|" c-awk-esc-pair-re "\\|" c-awk-harmless-_ "\\)*"))
139 (defconst c-awk-harmless-string*-here-re
140 (concat "\\=" c-awk-harmless-string*-re))
144 (concat c-awk-harmless-string*-re
156 (defconst c-awk-string-ch-re "[^\"\\\n\r]")
157 ;; Matches any character which can appear unescaped in a string.
158 (defconst c-awk-string-innards-re
159 (concat "\\(" c-awk-string-ch-re "\\|" c-awk-esc-pair-re "\\)*"))
160 ;; Matches the inside of an AWK string (i.e. without the enclosing quotes).
161 (defconst c-awk-string-without-end-here-re
162 (concat "\\=_?\"" c-awk-string-innards-re))
163 ;; Matches an AWK string at point up to, but not including, any terminator.
164 ;; A gawk 3.1+ string may look like _"localisable string".
165 (defconst c-awk-one-line-possibly-open-string-re
166 (concat "\"\\(" c-awk-string-ch-re "\\|" c-awk-non-eol-esc-pair-re "\\)*"
179 (defconst c-awk-regexp-char-class-re
182 (defconst c-awk-regexp-char-list-re
184 "\\(" c-awk-esc-pair-re "\\|" c-awk-regexp-char-class-re
186 ;; Matches a regexp char list, up to (but not including) EOL if the ] is
188 (defconst c-awk-regexp-one-line-possibly-open-char-list-re
191 ;; Matches the head (or all) of a regexp char class, up to (but not
194 (concat "\\(" c-awk-esc-pair-re "\\|" c-awk-regexp-char-list-re
202 "\\|" c-awk-regexp-one-line-possibly-open-char-list-re
215 ;; A "neutral" char(pair). Doesn't change the "state" of a subsequent /.
221 ;; A (possibly empty) string of neutral characters (or character pairs).
223 ;; Matches a char which is a constituent of a variable or number, or a ket
247 (defconst c-awk-_-harmless-nonws-char-re "[^#/\"\\\\\n\r \t]")
251 "\\(" c-awk-_-harmless-nonws-char-re "\\|"
253 c-awk-one-line-possibly-open-string-re "\\|"
323 (eq (char-before) ?\))
327 (goto-char par-pos) ; back over "(...)"
338 (and (eq (char-before) ?\))
342 (goto-char par-pos) ; back over "(...)"
357 (backward-char)) ; c-backward-token-1 doesn't do this :-(
365 (or (eq (char-before) ?\})
367 (eq (char-before) ?\;)
371 (goto-char par-pos) ; go back to containing (
385 ;; that the previous line contains an unterminated string (without \). In
398 (not (setq nl-prop (c-get-char-property (1- (point)) 'c-awk-NL-prop)))
402 ;; there is an open string (without \) on the previous line.
408 (c-put-char-property (1- (point)) 'c-awk-NL-prop nl-prop)
420 (backward-char)
462 ((memq (char-before) '(?\; ?\})) ?\}) ; Real ; or }
465 (c-put-char-property (point) 'c-awk-NL-prop nl-prop)
478 (c-put-char-property (1- (point)) 'c-awk-NL-prop nl-prop))
489 (or (c-get-char-property (c-point 'eopl) 'c-awk-NL-prop)
505 (insert-char ?\n 1) ; ...artificial eol is needed for comment detection.
508 (if extra-nl (delete-backward-char 1))))))
537 (pos-or-point (progn (if pos (goto-char pos)) (point))))
553 (not (c-get-char-property (c-point 'eol) 'c-awk-NL-prop)))
564 (c-clear-char-properties beg (point-max) 'c-awk-NL-prop)))
570 ;; Thing. This function's action is required by c-put-char-property.
582 ;; (if (setq pl-prop (c-get-char-property (c-point 'eopl) 'c-awk-NL-prop))
583 ;; (char-to-string pl-prop)
585 ;; (if (setq cl-prop (c-get-char-property (c-point 'eol) 'c-awk-NL-prop))
586 ;; (char-to-string cl-prop)
604 ;; the next string delimiter as a string) was inappropriate. Instead,
605 ;; unbalanced string/regexp delimiters are given the warning font, being
606 ;; refonted with the string font as soon as the matching delimiter is entered.
609 ;; function to have access to the start of the string/regexp, which may be
619 ;; comment, string or regexp. IT MAY WELL BE that this function should not be
623 (if pos (goto-char pos))
626 (eq (char-before (1- (point))) ?\\))
636 ;; comment, string or regexp. IT MAY WELL BE that this function should not be
640 (if pos (goto-char pos))
643 (eq (char-before) ?\\))
649 ;; 2002/4/28. The default syntax for / has been changed from "string" to
650 ;; "punctuation", to reduce hassle when this character appears within a string
653 (defun c-awk-set-string-regexp-syntax-table-properties (beg end)
654 ;; BEG and END bracket a (possibly unterminated) string or regexp. The
657 ;; contents of this string/regex.
659 ;; "String" here can also mean a gawk 3.1 "localizable" string which starts
667 (if (eq (char-after beg) ?_) (setq beg (1+ beg)))
670 (cond ((eq end (point-max)) ; string/regexp terminated by EOB
671 (c-put-char-property beg 'syntax-table '(15))) ; (15) = "string fence"
672 ((/= (char-after beg) (char-after end)) ; missing end delimiter
673 (c-put-char-property beg 'syntax-table '(15))
674 (c-put-char-property end 'syntax-table '(15)))
675 ((eq (char-after beg) ?/) ; Properly bracketed regexp
676 (c-put-char-property beg 'syntax-table '(7)) ; (7) = "string"
677 (c-put-char-property end 'syntax-table '(7)))
678 (t)) ; Properly bracketed string: Nothing to do.
679 ;; Now change the properties of any escaped "s in the string to punctuation.
681 (goto-char (1+ beg))
684 (c-put-char-property (1- (point)) 'syntax-table '(1))))))
686 (defun c-awk-syntax-tablify-string ()
687 ;; Point is at the opening " or _" of a string. Set the syntax-table
688 ;; properties on this string, leaving point just after the string.
690 ;; The result is nil if a / immediately after the string would be a regexp
694 (search-forward-regexp c-awk-string-without-end-here-re nil t) ; a (possibly unterminated) string
695 (c-awk-set-string-regexp-syntax-table-properties
698 (forward-char)
700 ((looking-at "[\n\r]") ; Unterminated string with EOL.
701 (forward-char)
703 (t nil))) ; Unterminated string at EOB
720 (goto-char anchor)
726 (progn (goto-char (1+ /point)) nil)
729 (goto-char /point)
731 (c-awk-set-string-regexp-syntax-table-properties
734 (forward-char)
737 (forward-char)
754 ;; (i) / - It is set to "string" on a / which is the opening or closing
757 ;; (ii) the opener of an unterminated string/regexp, we set the property
758 ;; "generic string delimiter" on both the opening " or / and the end of the
762 ;; to use the regexp "\\S\"*" to skip over the string innards.
769 (c-clear-char-properties (point) lim 'syntax-table)
770 ;; Once round the next loop for each string, regexp, or div sign
777 (search-forward-regexp c-awk-harmless-string*-here-re nil t)
779 ;; Do our thing on the string, regexp or divsion sign.
782 (c-awk-syntax-tablify-string)
838 ;; include ALL of any string or regexp within the region. The simplest way to
844 ;; When font-locking an AWK Mode buffer, make sure that any string/regexp is
942 ;; Unbalanced string (") or regexp (/) delimiters. 2002/02/16.
946 '("\\(_\\)\\s\"" 1 font-lock-string-face) ; FIXME! not for XEmacs. 2002/10/6
956 (defconst c-awk-terminated-regexp-or-string-here-re "\\=\\s\"\\S\"*\\s\"")
957 ;; Matches a terminated string/regexp.
959 (defconst c-awk-unterminated-regexp-or-string-here-re "\\=\\s|\\S|*$")
960 ;; Matches an unterminated string/regexp, NOT including the eol at the end.
967 ;; Point is not inside a comment or string. Is it AT the end of a
973 (backward-char)
1010 (if (not (eq (point) (point-max))) (forward-char 1))
1016 (if found (goto-char (match-beginning 0))))
1038 ((search-forward-regexp c-awk-terminated-regexp-or-string-here-re nil t))
1039 ((search-forward-regexp c-awk-unterminated-regexp-or-string-here-re nil t))
1040 ((looking-at "/") (forward-char) t))))) ; division sign.
1048 ((looking-at "{") (goto-char (scan-sexps (point) 1)))
1049 ((looking-at ";") (forward-char))
1087 (goto-char start-point)
1105 (goto-char (min start-point end-point)))))))