Subversion Repositories wimsdev

Rev

Rev 11930 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
11931 schaersvoo 1
#!/usr/bin/perl
4877 bpr 2
 
3
open(IN, "commands") ;
4
 
11072 bpr 5
my $L='' ; my $t=0 ;
6
while (<IN>) {my $l=$_ ;
7
  if (/^:/) { $t=1 ; $l =~ s/^:(\w+)(\s.*)?\n/$1/g ; $L .=$l ; }
4877 bpr 8
    else {
9
    if ($t==1) { $L .=$l ;} ; $t=0 ;
10
  }
11
} ;
12
$L =~ s/\s+/\n/g;
13
$L = "'" . join ( "', '",split ('\n', $L)) . "'";
14
 
15
my $Text = << "EOT"
16
  editAreaLoader.load_syntax["flydraw"] = {
17
    'QUOTEMARKS' : {1: ' " '}
18
        ,'KEYWORD_CASE_SENSITIVE' : true
19
        ,'KEYWORDS' : {
20
        'flydraw' : [
21
EOT
4879 bpr 22
. $L
4877 bpr 23
. << "EOT"
24
 ]
25
}
26
        ,'OPERATORS' :[
27
                '*', '+', '-', '/', '^', '<', '=', '>','//'
28
        ]
29
        ,'DELIMITERS' :[
30
                '(', ')', '[', ']','{','}'
31
        ]
32
        ,'REGEXPS' :
33
        {
34
                'oefvariables' : { 'search': '()(\\\\\\\\\\\\w+)()',
35
                        'class' : 'oefvariables',
36
                        'modifiers' : 'g', 'execute' : 'before' }
4879 bpr 37
                ,'wimsvariables' : {
38
                        'search' : '()(\\\\\$\\\\w+)()'
39
                        ,'class' : 'wimsvariables'
40
                        ,'modifiers' : 'g', 'execute' : 'before'
41
                }
4877 bpr 42
        }
43
        ,'STYLES' : {
44
                'COMMENTS': 'color: #0000CD;'
45
                ,'QUOTESMARKS': 'color: #6381F8;'
46
                ,'KEYWORDS' : {
47
                        'flydraw' : 'color: #48BDDF;'
48
                        }
49
                ,'OPERATORS' : 'color: #FF00FF;'
50
                ,'DELIMITERS' : 'color: #60CA00;'
51
                ,'REGEXPS': {
52
                        'oefvariables' : 'color: #FF3A6E;'
4879 bpr 53
                        ,'wimsvariables' : 'color: #FF3A6E;'
4877 bpr 54
                }
55
        }
56
};
57
EOT
58
;
59
 
60
out( 'flydraw.js', $Text) ;
61
 
62
sub out { my ($bloc, $text) = @_;
63
  open  (OUT, ">$bloc") ;
64
  print OUT $text ; close OUT;
65
}