     (modify-syntax-entry ?$  "'" st)
     (modify-syntax-entry ?,  "."  st)
     (modify-syntax-entry ?.  ". p"  st)
-    st))
+    st)
+  "Syntax table for PIR major mode.")
 
 (defvar pir-PMC-keyword-symbols
   '("Array" "Boolean" "Compiler" "Continuation" "Coroutine" "CSub"

  (use-local-map pir-mode-map)
  (setq major-mode 'pir-mode)
  (setq mode-name "PIR")
  
  (set-syntax-table pir-mode-syntax-table)
  
  (setlocalq font-lock-defaults '(pir-font-lock-keywords))
  (setlocalq indent-line-function 'pir-indent-line)
  (setlocalq pir-mode-basic-indent 'pir-mode-basic-indent)
  (setlocalq require-final-newline t)
  
  (setlocalq comment-start "# ")
  (setlocalq comment-end "")
  (setlocalq comment-column pir-comment-column)

;; This package provides Emacs support for PIR.
;; It defines PIR mode, a major mode for editing PIR code.

;; To begin using this mode for all `.imc' files that you edit,
;; put this file in your `load-path' and add the following lines
;; to your `.emacs' file:

;;   (autoload 'pir-mode \"pir-mode\" nil t)
;;   (add-to-list 'auto-mode-alist '("\\.imc\\'" . pir-mode))

;; If you have any problems with this, you're on your own,
;; You could always try asking on perl6-internals@perl.org.

;;; Code:
(require 'regexp-opt)
(require 'cl)

(unless (fboundp 'line-beginning-position)
  (defalias 'line-beginning-position 'point-at-bol))
(unless (fboundp 'line-end-position)
  (defalias 'line-end-position 'point-at-eol))

(defgroup pir nil
  "Mode for editing PIR code."
  :group 'languages)

(defcustom pir-mode-hook nil
  "*Hook run when entering PIR mode."
  :type 'hook
  :group 'pir)

(defcustom pir-comment-char ?#
  "*The `comment-start' character assumed by PIR mode."
