editors

changeset 28:70eec38602e5

Started a syntax.ex file that should include all items that should receive proper syntax highlighting. This can be used to test your syntax highlighting mode for Euphoria
author Jeremy Cowgar <jeremy@cowgar.com>
date Thu Nov 11 11:55:50 2010 -0500 (2010-11-11)
parents 1c1e3ed6872f
children 3b58700d3c79
files syntax.ex
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/syntax.ex	Thu Nov 11 11:55:50 2010 -0500
     1.3 @@ -0,0 +1,116 @@
     1.4 +--
     1.5 +-- This file was created for the purpose of testing syntax
     1.6 +-- highlighting for various editors. It is syntactically correct
     1.7 +-- but will not execute or do anything useful.
     1.8 +--
     1.9 +
    1.10 +namespace abc
    1.11 +
    1.12 +include std/sequence.e as seq -- Common mistake to highlight sequence
    1.13 +include std/regex.e
    1.14 +
    1.15 +-- Line comment, mispeled
    1.16 +
    1.17 +function abc()
    1.18 +    return 10
    1.19 +end function
    1.20 +
    1.21 +/*
    1.22 + * Multiline Comment
    1.23 + *
    1.24 + * Mispeled.
    1.25 + * TODO: contained in multiline comment
    1.26 + */
    1.27 +
    1.28 +/* Single Line - Multi-Line comment :-) */
    1.29 +
    1.30 +trace(1)
    1.31 +with type_check
    1.32 +without inline
    1.33 +
    1.34 +ifdef CHECK_NAME then
    1.35 +    public constant NAME = "John Doe"
    1.36 +    sequence escapes = "Hello\n\r\tHello\\ and \" or \' \0 is null"
    1.37 +    sequence bin_escapes = "Hello \b010110 World!"
    1.38 +    sequence hex_escapes = "Hello\x0f\x8F, \u8FAE, \U8123FEDC is the last"
    1.39 +elsifdef CHECK_INAME then
    1.40 +    export enum I_NAME=10, I_AGE
    1.41 +elsedef
    1.42 +    global atom pi = +3.14159265
    1.43 +end ifdef
    1.44 +
    1.45 +sequence various_nums = { 
    1.46 +    10, -10, +10, 18_288,     -- integers 
    1.47 +    203.33, .44,              -- atoms
    1.48 +    0b01011, 0b01_11_01,      -- binaries
    1.49 +    0t123, 0t_71_221,         -- octal
    1.50 +    0x01AF, 0xaf1c, 0xaf_1c,  -- hex style 1
    1.51 +    #01AF, #AF1C, #AF_1C      -- hex style 2
    1.52 +}
    1.53 +
    1.54 +sequence str1 = "John Doe"
    1.55 +sequence str2 = `John Doe`
    1.56 +integer ch = 'A', ch2 = '\n', ch3 = '\\'
    1.57 +sequence str3 = """John Doe"""
    1.58 +sequence str4 = """
    1.59 +    Hello, Mr. John Doe. Mispeled
    1.60 +
    1.61 +    How "are" you today?
    1.62 +    """
    1.63 +sequence str5 = `
    1.64 +    Hello, Mr. John Doe.
    1.65 +
    1.66 +    How "are" you today?
    1.67 +    `
    1.68 +
    1.69 +override function open(sequence fname, sequence mode = "w")
    1.70 +    if 1 then
    1.71 +        return 0
    1.72 +    elsif 2 then
    1.73 +        return 1
    1.74 +    else
    1.75 +        while integer(mode) with entry do
    1.76 +            printf(1, "fname = %s\n", { fname })
    1.77 +        entry
    1.78 +            fname &= mode
    1.79 +            abc:open("somefile.txt", "w")
    1.80 +        end while
    1.81 +        return 10
    1.82 +    end if
    1.83 +end function
    1.84 +
    1.85 +switch "John" with fallthru do
    1.86 +    case 1 then
    1.87 +        fallthru
    1.88 +    case 2, 3, 4 then
    1.89 +        break
    1.90 +    case else
    1.91 +        puts(1, "else")
    1.92 +end switch
    1.93 +
    1.94 +loop do
    1.95 +    i += 1
    1.96 +    
    1.97 +    until i > 20 
    1.98 +end loop
    1.99 +
   1.100 +for i = 1 to 10 by 2 label "for_loop" do
   1.101 +    continue
   1.102 +    break
   1.103 +    retry
   1.104 +    exit
   1.105 +end for
   1.106 +
   1.107 +-- TODO: contained in a comment
   1.108 +-- NOTE: contained in a comment
   1.109 +-- BUG: contained in a comment
   1.110 +-- FIXME: contained in a comment
   1.111 +
   1.112 +public type def(object o)
   1.113 +
   1.114 +end type
   1.115 +
   1.116 +procedure xyz()
   1.117 +end procedure
   1.118 +
   1.119 +

SCM Home | OpenEuphoria.org Home