editors

view syntax.ex @ 57:149815b0874c

* added installer for jEdit mode
author Shawn David Pringle B.Sc. <shawn.pringle@gmail.com>
date Fri Sep 25 00:03:32 2015 -0300 (2015-09-25)
parents 41e1f22adc1d
children
line source
1 --**
2 -- Section Heading:
3 --
4 -- This file was created for the purpose of testing syntax
5 -- highlighting for various editors. It is syntactically correct
6 -- but will **not** execute or do anything useful.
7 --
8 -- Parameters:
9 -- * ##name## - name of person to say hello to
10 -- * ##greeting## - greeting to say to `name`, defaults to "Hello"
11 --
12 -- See Also:
13 -- [[:check_method]] and [[:say_hello]]
14 --
16 namespace abc
18 include std/sequence.e as seq -- Common mistake to highlight sequence
19 include std/regex.e
21 -- Line comment, mispeled
23 deprecate function abc()
24 return 10
25 end function
27 /*
28 * Multiline Comment
29 *
30 * Mispeled.
31 * TODO: contained in multiline comment
32 */
34 /* Single Line - Multi-Line comment :-) */
36 trace(1)
37 with type_check
38 without inline
40 ifdef CHECK_NAME then
41 public constant NAME = "John Doe"
42 export sequence escapes = "Hello\n\r\tHello\\ and \" or \' \0 is null"
43 sequence bin_escapes = "Hello \b010110 World!"
44 sequence hex_escapes = "Hello\x0f\x8F, \u8FAE, \U8123FEDC is the last"
45 elsifdef CHECK_INAME then
46 export enum I_NAME=10, I_AGE
47 elsedef
48 global atom pi = +3.14159265
49 end ifdef
51 sequence various_nums = {
52 10, -10, +10, 18_288, -- integers
53 203.33, .44, -- atoms
54 0b01011, 0b01_11_01, -- binaries
55 0t123, 0t_71_221, -- octal
56 0x01AF, 0xaf1c, 0xaf_1c, -- hex style 1
57 #01AF, #AF1C, #AF_1C -- hex style 2
58 }
60 sequence str1 = "John Doe"
61 sequence str2 = `John Doe`
62 integer ch = 'A', ch2 = '\n', ch3 = '\\'
63 sequence str3 = """John Doe"""
64 sequence str4 = """
65 Hello, Mr. John Doe. Mispeled
67 How "are" you today?
68 """
69 sequence str5 = `
70 Hello, Mr. John Doe.
72 How "are" you today?
73 `
75 override function open(sequence fname, sequence mode = "w")
76 if 1 then
77 return 0
78 elsif 2 then
79 return 1
80 else
81 while integer(mode) with entry do
82 printf(1, "fname = %s\n", { fname })
83 entry
84 fname &= mode
85 abc:open("somefile.txt", "w")
86 end while
87 return 10
88 end if
89 end function
91 switch "John" with fallthru do
92 case 1 then
93 fallthru
94 case 2, 3, 4 then
95 break
96 case else
97 puts(1, "else")
98 end switch
100 loop do
101 i += 1
103 until i > 20
104 end loop
106 for i = 1 to 10 by 2 label "for_loop" do
107 continue
108 break
109 retry
110 exit
111 end for
113 -- TODO: contained in a comment
114 -- NOTE: contained in a comment
115 -- BUG: contained in a comment
116 -- FIXME: contained in a comment
118 public type def(object o)
120 end type
122 procedure xyz()
123 end procedure

SCM Home | OpenEuphoria.org Home