Add and use initial OSN editor mode
This commit is contained in:
3
OSN.asd
3
OSN.asd
@ -43,7 +43,8 @@
|
||||
(:file "osn-to-os10" :depends-on ("pkgdef" "conditions" "osn"))
|
||||
(:file "ui-utils" :depends-on ("pkgdef" "globals" "conditions"))
|
||||
(:file "debugger-ui" :depends-on ("pkgdef" "globals" "conditions" "ui-utils"))
|
||||
(:file "osn-viewer" :depends-on ("pkgdef" "globals" "conditions" "osn" "osn-parser" "osn-writer" "osn-to-os10" "ui-utils"))
|
||||
(:file "osn-mode" :depends-on ("pkgdef" "globals" "conditions" "osn" "osn-parser" "osn-writer" "osn-to-os10"))
|
||||
(:file "osn-viewer" :depends-on ("pkgdef" "globals" "conditions" "osn" "osn-parser" "osn-writer" "osn-to-os10" "ui-utils" "osn-mode"))
|
||||
(:file "xosc-viewer" :depends-on ("pkgdef" "globals" "conditions" "ui-utils"))
|
||||
(:file "win-ui" :depends-on ("pkgdef" "globals" "conditions" "ui-utils" "debugger-ui" "osn-viewer" "xosc-viewer")))
|
||||
:depends-on ("lib")))
|
||||
|
||||
75
src/osn-mode.lisp
Normal file
75
src/osn-mode.lisp
Normal file
@ -0,0 +1,75 @@
|
||||
;;;; OpenScenarioNext --- OpenScenario Language Design
|
||||
;;;; This is copyrighted software. See documentation for terms.
|
||||
;;;;
|
||||
;;;; osn-mode.lisp --- OSN Editor Mode
|
||||
|
||||
(cl:in-package "EDITOR")
|
||||
|
||||
;;;; %File Description:
|
||||
;;;;
|
||||
;;;; OSN Editor Mode
|
||||
;;;;
|
||||
|
||||
(defun ensure-osn-mode ()
|
||||
nil)
|
||||
|
||||
(defparameter *osn-syntax-table*
|
||||
(create-syntax-table :string-escape #\\
|
||||
:escape #\\
|
||||
:nested nil
|
||||
:double-comment #\/
|
||||
:second-comment #\*
|
||||
:first-close-comment #\*
|
||||
:second-close-comment #\/
|
||||
:string #\"
|
||||
:close '(#\))
|
||||
:open '(#\()
|
||||
:whitespace '(#\tab #\space
|
||||
#\formfeed
|
||||
#\newline
|
||||
#\return)))
|
||||
|
||||
(defmode "OSN"
|
||||
:major-p t
|
||||
:vars '((Paren-Pause-Period . nil)
|
||||
(Highlight-Matching-Parens . t)
|
||||
(Comment-Start . "/*")
|
||||
(Comment-Begin . "/*")
|
||||
(Comment-End . "*/"))
|
||||
:syntax-table *osn-syntax-table*)
|
||||
|
||||
(defcommand "OSN Mode" (p)
|
||||
"Put current buffer in OSN mode."
|
||||
"Put current buffer in OSN mode."
|
||||
(declare (ignore p))
|
||||
(setf (buffer-major-mode (current-buffer)) "OSN"))
|
||||
|
||||
(define-editor-mode-variable Compile-Region-Function "OSN" 'region-osn-compile)
|
||||
|
||||
(define-editor-mode-variable Compile-Buffer-File-Function "OSN"
|
||||
'compile-osn-file-internal)
|
||||
|
||||
(define-editor-mode-variable Evaluate-Region-Function "OSN" 'region-osn-eval)
|
||||
|
||||
(defun region-osn-compile (&rest args)
|
||||
(declare (ignore args))
|
||||
(error "Not available"))
|
||||
|
||||
(defun compile-osn-file-internal (&rest args)
|
||||
(declare (ignore args))
|
||||
(error "Not available"))
|
||||
|
||||
(defun region-osn-eval (&rest args)
|
||||
(declare (ignore args))
|
||||
(error "Not available"))
|
||||
|
||||
(define-editor-mode-variable Find-Dspec-In-Buffer-Function "OSN" nil)
|
||||
|
||||
(define-editor-mode-variable Mark-Defun-Possible "OSN" nil
|
||||
"Predicate to determine if valid to mark a defun")
|
||||
|
||||
(define-file-type-hook
|
||||
("osn")
|
||||
(buffer type)
|
||||
(declare (ignore type))
|
||||
(setf (editor:buffer-major-mode buffer) "OSN"))
|
||||
@ -15,7 +15,8 @@
|
||||
(make-instance 'osn-viewer
|
||||
:source nil
|
||||
:osn-buffer
|
||||
(editor:make-buffer "Unknown" :temporary t))
|
||||
(editor:make-buffer "Unknown" :temporary t
|
||||
:modes '("OSN")))
|
||||
:screen
|
||||
(derive-main-interface-screen interface)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user