
(require (quote tplvars))

(provide (quote tplscan))

(defun tpl-make-pattern (pn pv) "\
Constructor for lexical patterns." (byte-code "ÂDÃ	DD‡" [pn pv name value] 3))

(defun tpl-pattern-name (p) "\
Selector for name field of lexical patterns." (byte-code "ÁÂ\"A@‡" [p assq name] 3))

(defun tpl-pattern-value (p) "\
Selector for value field of lexical patterns." (byte-code "ÁÂ\"A@‡" [p assq value] 3))

(defun tpl-make-token (tt tn tv) "\
Constructor for tokens." (byte-code "ÃDÄ	DÅ
DE‡" [tt tn tv type name value] 4))

(defun tpl-token-type (token) "\
Selector for type field of tokens." (byte-code "ÁÂ\"A@‡" [token assq type] 3))

(defun tpl-token-name (token) "\
Selector for name field of tokens." (byte-code "ÁÂ\"A@‡" [token assq name] 3))

(defun tpl-token-value (token) "\
Selector for value field of tokens." (byte-code "ÁÂ\"A@‡" [token assq value] 3))

(defun tpl-make-line (indent-level token-list) "\
Constructor for lines." (byte-code "ÂDÃ	DD‡" [indent-level token-list indent tokens] 3))

(defun tpl-line-indent (line) "\
Selector for indentation field of lines." (byte-code "ÁÂ\"A@‡" [line assq indent] 3))

(defun tpl-line-tokens (line) "\
Selector for token-list field of lines." (byte-code "ÁÂ\"A@‡" [line assq tokens] 3))

(defun tpl-scan-region (start stop pattern-list) "\
Scan the text between START and STOP using PATTERN-LIST for tokens.
   Return an indented line-list of tokens." (byte-code "ÉÉÉÉÉÉÉÉbˆi‰ˆÉ‰ˆŒÎ
\"ˆÏË!…6 …6 Ð!ˆmƒB É‰‚F Ì‰ˆ…s Ñ ˆÒ\"‰ˆÓC\"‰ˆm?ƒk Ô ‚o É‰ˆ‚G )ˆ.‡" [start-col last-col this-col indent-level last-indent line line-list more start nil stop template-scan-hook t pattern-list narrow-to-region boundp funcall back-to-indentation tpl-scan-line append forward-char] 10))

(defun tpl-scan-line (start-col pattern-list) "\
Scan a line of text, returning an indentation-line of tokens.
   START-COL is the origin column for a region.
   PATTERN-LIST is the list of tokens to scan for." (byte-code "ÄÄÄƒ ÊÄ!ˆËÌÍ!\"‰‚J Î ˆi‰ˆYƒ. ‰‚A Xƒ; Ì‰‚A Z‰ˆË	Í!\"‰ˆ
+‡" [this-col indent-level line tpl-literal-whitespace nil pattern-list comment-column tpl-comment-level start-col t beginning-of-line tpl-make-line 0 tpl-scan-token-list back-to-indentation] 8))

(defun tpl-scan-token (pattern-list) "\
Scan the text at point and return a token.
   PATTERN-LIST is the list of tokens to scan for." (byte-code "ÆÆÆÆÆÆÆ‰ˆ… ?…@ @‰ˆA‰ˆÊ!‰ˆË!‰ˆÌ
!…< È‰ˆ‚ ˆ?…I ÍÎ!ˆ`‰ˆÏ
!ˆÐ		Ñ`\"#‰ˆ.‡" [pattern pn pv token found start nil pattern-list t tpl-terminal-type tpl-pattern-name tpl-pattern-value looking-at error "Unable to scan text." re-search-forward tpl-make-token buffer-substring] 11))

(defun tpl-scan-token-list (pattern-list) "\
Scan the current line and return a list of tokens.
   PATTERN-LIST is the list of tokens to scan for." (byte-code "ÃÃÃÃ‰ˆ‰ˆl?…( ‰ˆÅ!‰ˆÆ
	C\"‰ˆ‚ ˆ
+‡" [save-list token token-list nil pattern-list tpl-scan-token append] 5))

(defun tpl-scan-template nil "\
Scan the template at point and return its tree value." (byte-code "ÑÑÑÑÑÑÒ!ˆÒ!ˆ`‰ˆÒ!ˆÓ`\"‰ˆÒ!ˆ`‰ˆÒ	!ˆÓ`\"‰ˆÒ
!ˆÔÕ!ˆ`‰ˆÒ!ˆÖ×!ˆØ
\"†^ Ø
\"ƒj Ó`\"‰‚… Ø
\"ƒ} Ù`#‰‚… Ù`#‰ˆÚ
	#‰ˆ.‡" [start template-name template-type token-list tree save-patterns tpl-begin-template-definition tpl-pattern-whitespace tpl-pattern-symbol tpl-pattern-word tpl-begin-template-body tpl-end-template-body tpl-lexical-type tpl-function-type tpl-string-type string-patterns lex-patterns nil re-search-forward buffer-substring beginning-of-line 2 end-of-line 0 equal tpl-scan-region tpl-make-token] 21))

(defun tpl-scan-placeholder nil "\
Scan the placeholder at point and return its tree value." (byte-code "ÌÌÌÌÌ`‰ˆÎ!ˆÏ!ƒ% ‰ˆÎ!‚) ‰ˆ`‰ˆÏ	!ƒ= Ð	G!‚A Î
!ˆÑ	`\"‰ˆÏ!ƒg Î!ˆ`‰ˆÎ
!ˆÑ	`\"‰‚j Ì‰ˆÒ
#‰ˆbˆ-‡" [save start placeholder-type placeholder-name token-type tpl-begin-placeholder tpl-pattern-optional tpl-optional-type tpl-placeholder-type tpl-destination-symbol tpl-pattern-symbol tpl-sep-placeholder nil placeholder re-search-forward looking-at forward-char buffer-substring tpl-make-token] 15))

(defun tpl-unscan (token &optional column) "\
Insert at point the values of tokens in the tree rooted by TOKEN.
     Optional second argument COLUMN specifies where to indent rigidly.
     Default is the current column." (byte-code "ÈÈÈÈÈÈ‰ˆ?… È‰ˆ`‰ˆ	ƒ, 	‰‚/ i‰ˆÎ
!‰ˆ…… @‰ˆA‰ˆÏ!UƒT j‚Z 	Ï!\\jˆÐ!‰ˆ
…z 
@‰
ˆ
A‰ˆÑÎ
!!ˆ‚a ˆ… Ò ˆ‚7 ˆÓÍ!…Ž …˜ Ô`	$ˆ‰.‡" [begin-template start-column token-list line-list line save-hook auto-fill-hook tpl-fill-while-unscanning nil column token tpl-comment-level comment-column template-unscan-hook tpl-token-value tpl-line-indent tpl-line-tokens insert-before-markers newline boundp funcall] 13))

(defun tpl-fix-syntax (string) "\
Change any syntax entries in STRING from (word or symbol or quote)
   to punctuation." (byte-code "Â	GÃV…9 Ä	!‰ˆ	ÅÂO‰ˆÆÇ!È\"†. ÆÇ!É\"†. ÆÇ!Ê\"…5 ËÌ\"ˆ‚ )‡" [char string nil 0 string-to-char 1 equal char-syntax 32 95 39 modify-syntax-entry ".   "] 11))

(defun tpl-initialize-scan nil "\
Initialize environment for scan." (byte-code "Ú!ˆÚ	!ˆÚ
!ˆÚ!ˆP‰ˆ	Q‰ˆÛÜÝÜ
Ý	&
‰ˆÞß
\"ß\"ß\"ß\"ß\"%‰	ˆß\"C‰ˆàÙ#‰(‡" [tpl-begin-placeholder tpl-end-placeholder tpl-sep-placeholder tpl-pattern-optional tpl-begin-optional tpl-destination-placeholder tpl-destination-symbol tpl-pattern-placeholder tpl-pattern-symbol lex-patterns tpl-placeholder-type tpl-whitespace-type tpl-pattern-whitespace tpl-word-type tpl-pattern-word tpl-punctuation-type tpl-pattern-punctuation tpl-other-type tpl-pattern-other string-patterns tpl-string-type tpl-pattern-string tpl-newline-token tpl-terminal-type tpl-newline-type nil tpl-fix-syntax concat "\\(" "\\)?" list tpl-make-pattern tpl-make-token] 17))
