all repos — NoPaste @ 584b12475d17386562df16d9e2aebd2d66070652

Resurrected - The PussTheCat.org fork of NoPaste

scripts/CodeMirror/mode/mumps/index.html (view raw)

 1<!doctype html>
 2
 3<title>CodeMirror: MUMPS mode</title>
 4<meta charset="utf-8"/>
 5<link rel=stylesheet href="../../doc/docs.css">
 6
 7<link rel="stylesheet" href="../../lib/codemirror.css">
 8<script src="../../lib/codemirror.js"></script>
 9<script src="mumps.js"></script>
10<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11<div id=nav>
12  <a href="https://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a>
13
14  <ul>
15    <li><a href="../../index.html">Home</a>
16    <li><a href="../../doc/manual.html">Manual</a>
17    <li><a href="https://github.com/codemirror/codemirror">Code</a>
18  </ul>
19  <ul>
20    <li><a href="../index.html">Language modes</a>
21    <li><a class=active href="#">MUMPS</a>
22  </ul>
23</div>
24
25<article>
26<h2>MUMPS mode</h2>
27
28
29<div><textarea id="code" name="code">
30 ; Lloyd Milligan
31 ; 03-30-2015
32 ;
33 ; MUMPS support for Code Mirror - Excerpts below from routine ^XUS
34 ;
35CHECKAV(X1) ;Check A/V code return DUZ or Zero. (Called from XUSRB)
36 N %,%1,X,Y,IEN,DA,DIK
37 S IEN=0
38 ;Start CCOW
39 I $E(X1,1,7)="~~TOK~~" D  Q:IEN>0 IEN
40 . I $E(X1,8,9)="~1" S IEN=$$CHKASH^XUSRB4($E(X1,8,255))
41 . I $E(X1,8,9)="~2" S IEN=$$CHKCCOW^XUSRB4($E(X1,8,255))
42 . Q
43 ;End CCOW
44 S X1=$$UP(X1) S:X1[":" XUTT=1,X1=$TR(X1,":")
45 S X=$P(X1,";") Q:X="^" -1 S:XUF %1="Access: "_X
46 Q:X'?1.20ANP 0
47 S X=$$EN^XUSHSH(X) I '$D(^VA(200,"A",X)) D LBAV Q 0
48 S %1="",IEN=$O(^VA(200,"A",X,0)),XUF(.3)=IEN D USER(IEN)
49 S X=$P(X1,";",2) S:XUF %1="Verify: "_X S X=$$EN^XUSHSH(X)
50 I $P(XUSER(1),"^",2)'=X D LBAV Q 0
51 I $G(XUFAC(1)) S DIK="^XUSEC(4,",DA=XUFAC(1) D ^DIK
52 Q IEN
53 ;
54 ; Spell out commands
55 ;
56SET2() ;EF. Return error code (also called from XUSRB)
57 NEW %,X
58 SET XUNOW=$$HTFM^XLFDT($H),DT=$P(XUNOW,".")
59 KILL DUZ,XUSER
60 SET (DUZ,DUZ(2))=0,(DUZ(0),DUZ("AG"),XUSER(0),XUSER(1),XUTT,%UCI)=""
61 SET %=$$INHIBIT^XUSRB() IF %>0 QUIT %
62 SET X=$G(^%ZIS(1,XUDEV,"XUS")),XU1=$G(^(1))
63 IF $L(X) FOR I=1:1:15 IF $L($P(X,U,I)) SET $P(XOPT,U,I)=$P(X,U,I)
64 SET DTIME=600
65 IF '$P(XOPT,U,11),$D(^%ZIS(1,XUDEV,90)),^(90)>2800000,^(90)'>DT QUIT 8
66 QUIT 0
67 ;
68 ; Spell out commands and functions
69 ;
70 IF $PIECE(XUSER(0),U,11),$PIECE(XUSER(0),U,11)'>DT QUIT 11 ;Terminated
71 IF $DATA(DUZ("ASH")) QUIT 0 ;If auto handle, Allow to sign-on p434
72 IF $PIECE(XUSER(0),U,7) QUIT 5 ;Disuser flag set
73 IF '$LENGTH($PIECE(XUSER(1),U,2)) QUIT 21 ;p419, p434
74 Q 0
75 ;
76  </textarea></div>
77    <script>
78      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
79         mode: "mumps",
80         lineNumbers: true,
81         lineWrapping: true
82      });
83    </script>
84
85  </article>