commit 38032ce04f39bfdbd8e380553421feb8a48d5046
parent 446ff035e3af476ee8fc5c384a0ff41eb1e3c525
Author: Ryan Jeffrey <pwishie@gmail.com>
Date: Fri, 8 May 2020 15:17:48 -0700
bisqwit c.jsf file
Diffstat:
M | .joe/syntax/c.jsf | | | 1333 | +++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------- |
A | .joe/syntax/c.jsf.back | | | 517 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
M | .joe/syntax/c.jsf~ | | | 1333 | +++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------- |
3 files changed, 2241 insertions(+), 942 deletions(-)
diff --git a/.joe/syntax/c.jsf b/.joe/syntax/c.jsf
@@ -1,515 +1,906 @@
-# JOE syntax highlight file for C and C++
+# JOE syntax highlight file for C
# A (deterministic) state machine which performs lexical analysis of C.
# (This is the "assembly language" of syntax highlighting. A separate
# program could be used to convert a regular expression NFA syntax into this
# format).
-# Each state begins with ':<name> <color-name> <context>'
-#
+# Each state begins with ':<name> <color-name>'
# <color-name> is the color used for characters eaten by the state
# (really a symbol for a user definable color).
-#
-# <context> tells JOE if the current character is part of a comment or a string.
-# This allows JOE to skip over comments and strings when matching characters
-# such as parentheses. To use this feature, the -highlighter_context option
-# must be applied to the files highlighted by the corresponding syntax. To
-# apply the option, add it to ftyperc for those file entries.
-#
-# The valid contexts are:
-# comment This character is part of a comment. Example: /* comment */
-#
-# string This character is part of a string. Examples: "string" 'c' 'string'
-#
-# The comment and string delimiters themselves should be marked with the
-# appropriate context. The context is considered to be part of the color, so
-# the recolor=-N and recolormark options apply the context to previous
-# characters.
# The first state defined is the initial state.
# Within a state, define transitions (jumps) to other states. Each
# jump has the form: <character-list> <target-state> [<option>s]
-# There are three ways to specify <character-list>s, either * for any
-# character not otherwise specified, % or & to match the character in the
-# delimiter match buffer or a literal list of characters within quotes
-# (ranges and escape sequences allowed). When the next character matches
-# any in the list, a jump to the target-state is taken and the character is
-# eaten (we advance to the next character of the file to be colored).
+# There are two ways to specify <character-list>s, either * for any
+# character not otherwise specified, or a literal list of characters within
+# quotes (ranges and escape sequences allows). When the next character
+# matches any in the list, a jump to the target-state is taken and the
+# character is eaten (we advance to the next character of the file to be
+# colored).
#
# The * transition should be the first transition specified in the state.
#
# There are several options:
-# noeat do not eat the character, instead feed it to the next state
-# (this tends to make the states smaller, but be careful: you
-# can make infinite loops). 'noeat' implies 'recolor=-1'.
-#
-# recolor=-N Recolor the past N characters with the color of the
-# target-state. For example once /* is recognized as the
-# start of C comment, you want to color the /* with the C
-# comment color with recolor=-2.
-#
-# mark Mark beginning of a region with current position.
+# noeat do not eat the character, instead feed it to the next state
+# (this tends to make the states smaller, but be careful: you
+# can make infinite loops).
#
-# markend Mark end of region.
+# recolor=-N Recolor the past N characters with the color of the
+# target-state. For example once /* is recognized as the
+# start of C comment, you want to color the /* with the C
+# comment color.
#
-# recolormark Recolor all of the characters in the marked region with
-# the color of the target-state. If markend is not given,
-# all of the characters up to the current position are recolored.
-# Note that the marked region can not cross line boundaries and
-# must be on the same line as recolormark.
+# buffer start copying characters to a buffer, beginning with this
+# one (it's ok, to not terminate buffering with a matching
+# 'strings' option- the buffer is limited to leading 19
+# characters).
#
-# buffer start copying characters to a string buffer, beginning with this
-# one (it's ok to not terminate buffering with a matching
-# 'strings' option- the buffer is limited to leading 23
-# characters).
+# strings A list of strings follows. If the buffer matches any of the
+# given strings, a jump to the target-state in the string list
+# is taken instead of the normal jump.
#
-# save_c Save character in delimiter match buffer.
-#
-# save_s Copy string buffer to delimiter match buffer.
-#
-# strings A list of strings follows. If the buffer matches any of the
-# given strings, a jump to the target-state in the string list
-# is taken instead of the normal jump.
-#
-# istrings Same as strings, but case is ignored.
-#
-# Note: strings and istrings should be the last option on the
-# line. They cause any options which follow them to be ignored.
-#
-# hold Stop buffering string- a future 'strings' or 'istrings' will
-# look at contents of buffer at this point. Useful for distinguishing
-# commands and function calls in some languages 'write 7' is a command
-# 'write (' is a function call- hold lets us stop at the space and delay
-# the string lookup until the ( or 7.
+# istrings Same as strings, but case is ignored.
#
# The format of the string list is:
#
-# "string" <target-state> [<options>s]
-# "string" <target-state> [<options>s]
-# "&" <target-state> [<options>s] # matches contents of delimiter match buffer
+# "string" <target-state>
+# "string" <target-state>
# done
#
-# (all of the options above are allowed except "strings", "istrings" and "noeat". noeat is
-# always implied after a matched string).
-#
# Weirdness: only states have colors, not transitions. This means that you
# sometimes have to make dummy states with '* next-state noeat' just to get
# a color specification.
-#
-# Delimiter match buffer is for perl and shell: a regex in perl can be s<..>(...)
-# and in shell you can say: <<EOS ....... EOS
-
-# New feature: subroutines
-#
-# Highlighter state machines can now make subroutine calls. The highlighter has
-# a run-time stack that allows unlimited recursion.
-#
-# To call a subroutine, use the 'call' option:
-#
-# "\"" fred call=string(dquote)
-#
-# The subroutine called 'string' is called and the jump to 'fred' is
-# ignored. The 'dquote' option is passed to the subroutine.
-#
-# The subroutine itself returns to the caller like this:
-# "\"" whatever return
-#
-# If we're in a subroutine, the return is made. Otherwise the jump
-# to 'whatever' is made.
-#
-# There are several ways of delimiting subroutines which show up in how it
-# is called. Here are the options:
-#
-# call=string() A file called string.jsf is the subroutine.
-# The entire file is the subroutine. The starting
-# point is the first state in the file.
-#
-# call=library.string() A file called library.jsf has the subroutine.
-# The subroutine within the file is called string.
-#
-# call=.string() There is a subroutine called string in the current file.
-#
-# When a subroutine is within a file, but is not the whole file, it is delimited
-# as follows:
-#
-# .subr string
-#
-# . . . states for string subroutine . . .
-#
-# .end
-#
-# Option flags can be passed to subroutines which control preprocessor-like
-# directives. For example:
-#
-# .ifdef dquote
-# "\"" idle return
-# .endif
-# .ifdef squote
-# "'" idle return
-# .endif
-#
-# .else if also available. .ifdefs can be nested.
-
-# Obsolete feature: the sync lines specification no longer matter. We now always parse
-# from the beginning of the file. Here is the old description:
-#
# Define no. sync lines
# You can say:
# -200 means 200 lines
# - means always start parsing from beginning of file when we lose sync
# if nothing is specified, the default is -50
--
-
-# Define colors and attributes. Give a list of attributes, one
-# background color and one foreground color (default is used if
-# color is left out).
-#
-# Attributes:
-# bold inverse blink dim underline italic
-#
-# Standard colors:
-#
-# Foreground:
-# white cyan magenta blue yellow green red black
-#
-# Background:
-# bg_white bg_cyan bg_magenta bg_blue bg_yellow bg_green bg_red bg_black
-#
-# For 16 color and 256 color xterms: "export TERM=xterm-16color", these
-# brighter than normal colors are available:
-#
-# Note that you need an xterm which was compiled to support 16 or 256 colors
-# and a matching termcap/terminfo entry for it.
-#
-# Foreground:
-# WHITE CYAN MAGENTA BLUE YELLOW GREEN RED BLACK
-#
-# Background:
-# bg_WHITE bg_CYAN bg_MAGENTA bg_BLUE bg_YELLOW bg_GREEN bg_RED bg_BLACK
-#
-# For 256 color xterm: "export TERM=xterm-256color", these become available:
-#
-# Note that you need an xterm which was compiled to support 256 colors and a
-# matching termcap/terminfo entry for it.
-#
-# fg_RGB and bg_RGB, where R, G, and B range from 0 - 5. So: fg_500 is bright red.
-#
-# fg_NN and bg_NN give shades of grey, where the intensity, NN, ranges from 0 - 23.
-
-=Idle
-=Bad bold red
-=Preproc blue
-=Define bold blue
-=Comment red
-=IncLocal cyan
-=IncSystem bold cyan
-=Constant magenta
-=Escape bold cyan
-=Type bold
-=Keyword bold
-=CppKeyword bold
-=Brace green
-=Control cyan
-
-:reset Idle
- * first noeat
- " \t" reset
-
-:first Idle
- * idle noeat
- "#" pre recolor=-1
-
-:pre Preproc
- * preproc noeat
- " \t" pre
- "a-z" preident recolor=-1 buffer
-
-:preident Preproc
- * preproc noeat strings
- "define" predef
- "include" preinc
+# THIS SETTING IS IGNORED BY Ad-hoc programming editor for DOSBox.
+-3000
+
+
+# Define colors
+#
+# Colors
+# white cyan magenta blue yellow green red black
+# bg_white bg_cyan bg_magenta bg_blue bg_yellow bg_green bg_red bg_black
+# THIS SETTING IS DIFFERENT IN Ad-hoc programming editor for DOSBox.
+# OUR COLORS ARE 8-BIT HEXADECIMAL NUMBERS:
+# IRGBirgb
+# \\\\\\\\_bit 0: blue for foreground
+# \\\\\\\_bit 1: green for foreground
+# \\\\\\_bit 2: red for foreground
+# \\\\\_bit 3: intensity bit for foreground
+# \\\\_bit 4: blue for background
+# \\\_bit 5: green for background
+# \\_bit 6: red for background
+# \_bit 7: intensity bit for background
+# For example, 03 = black background, cyan foreground.
+
+
+
+=Background
+=CPreproc cyan
+=CPreprocKW bold cyan
+=CPreproc_cKW bold cyan
+=CPreproc_sym bold blue
+=CPreprocCComment yellow
+=CPreprocUnknown bold cyan / bg_blue
+=OpenMP green
+=OpenMPkw bold green
+=OpenMPkw2 bold green
+=OpenMPcomment yellow
+=OpenMPnonkw red / bg_green
+=OpenMP_space bold cyan
+=CComment bold green
+=Special cyan
+=Special2 green
+=GlueColor cyan
+=AssignColor bold green
+=Numeric bold blue
+=InvalidNumber bold magenta / bg_red
+=NumericSuffix magenta
+=String bold green
+=StringContent green
+=WString bold blue
+=WStringContent cyan
+=Char bold magenta
+=CharContent magenta
+=WChar bold blue
+=WCharContent cyan
+=AbruptStringTermination bold green / bg_red
+=CKeyword bold
+=CType bold
+=STLkw bold
+=Identifier
+=Mystery bold green / bg_red
+=TrailingSpace black / bg_cyan
+
+
+########################
+# The rules begin here.
+:newline Background
+ * idle noeat
+ "#" pre_hash recolor=-1
+ " \t" newline_space
+:newline_space Background
+ * newline noeat
+ "\n" trailing_space recolor=-2
+
+:pre_hash CPreprocKW
+ * pre noeat
+:pre CPreproc
+ * preident recolor=-1 buffer
+ "/" pre1_slash recolor=-1
+ " \t" pre
+ "\n" newline
+:preident CPreprocUnknown
+ * preproc noeat strings
+ "define" preproc_known
+ "elif" preproc_known
+ "else" preproc_known
+ "endif" preproc_known
+ "error" preproc_known
+ "if" preproc_known
+ "ifdef" preproc_known
+ "ifndef" preproc_known
+ "include" preproc_known
+ "include_next" preproc_known
+ "line" preproc_known
+ "pragma" preproc_pragma
+ "undef" preproc_known
+ "warning" preproc_known
done
- "a-z" preident
-
-:preinc Preproc
- * preinc
- " \t" preinc_ws
- "\n" reset
-
-:preinc_ws Preproc
- * prebad recolor=-1
- " \t" preinc_ws
- "\"" preinc_local recolor=-1
- "<" preinc_system recolor=-1
-
-:preinc_local IncLocal string
- * preinc_local
- "\"\n" reset
-
-:preinc_system IncSystem string
- * preinc_system
- ">\n" reset
-
-:prebad Bad
- * prebad
- "\n" reset
-
-
-:predef Preproc
- * predef
- " \t" predef_ws
- "\n" reset
-
-:predef_ws Preproc
- * prebad recolor=-1
- " \t" predef_ws
- "\c" predef_ident recolor=-1
-
-:predef_ident Define
- * idle noeat
- "\c" predef_ident
-
-
-:preproc Preproc
- * preproc
- "\n" reset
- "\\" preproc_cont
- "/" preproc_slash
-
-:preproc_slash Preproc
- * preproc noeat
- "*" comment recolor=-2
- "/" line_comment recolor=-2
-
-:preproc_cont Preproc
- * preproc_cont
- "\n" preproc
+ "a-z$0-9A-Z_" preident
+
+# CPreprocessor directives that begin with an actual keyword
+:preproc_known CPreprocKW
+ * preproc noeat
+:preproc CPreproc
+ * preproc
+ " \t" preproc_space
+ "\n" newline
+ "a-z$A-Z_" preproc_ident recolor=-1 buffer
+ "-()?~[]{},;:!<>=+*%&|^" preproc_sym recolor=-1 noeat
+ "/" pre2_slash recolor=-1
+ "\"" pre2_string recolor=-1
+ "'" pre2_char recolor=-1
+ "\\" preproc_cont recolor=-1
+:preproc_space CPreproc
+ * preproc noeat
+ "\n" trailing_space recolor=-2
+:preproc_sym CPreproc_sym
+ * preproc
+:preproc_cont CPreproc_sym
+ * preproc_cont
+ "\n" preproc_newline
+:preproc_newline Background
+ * preproc noeat
+ " \t" preproc_newline_space
+:preproc_newline_space CPreproc
+ * preproc_newline noeat
+ "\n" trailing_space recolor=-2
+:preproc_ident CPreproc
+ * preproc noeat strings
+ "auto" preproc_ident_known
+ "char" preproc_ident_known
+ "const" preproc_ident_known
+ "decltype" preproc_ident_known
+ "double" preproc_ident_known
+ "enum" preproc_ident_known
+ "extern" preproc_ident_known
+ "float" preproc_ident_known
+ "inline" preproc_ident_known
+ "int" preproc_ident_known
+ "long" preproc_ident_known
+ "register" preproc_ident_known
+ "short" preproc_ident_known
+ "signed" preproc_ident_known
+ "static" preproc_ident_known
+ "struct" preproc_ident_known
+ "typedef" preproc_ident_known
+ "union" preproc_ident_known
+ "unsigned" preproc_ident_known
+ "void" preproc_ident_known
+ "volatile" preproc_ident_known
+ "break" preproc_ident_known
+ "case" preproc_ident_known
+ "continue" preproc_ident_known
+ "default" preproc_ident_known
+ "do" preproc_ident_known
+ "else" preproc_ident_known
+ "for" preproc_ident_known
+ "goto" preproc_ident_known
+ "if" preproc_ident_known
+ "return" preproc_ident_known
+ "sizeof" preproc_ident_known
+ "switch" preproc_ident_known
+ "while" preproc_ident_known
+ "bitand" preproc_ident_known #c++
+ "bitor" preproc_ident_known #c++
+ "catch" preproc_ident_known #c++
+ "compl" preproc_ident_known #c++
+ "delete" preproc_ident_known #c++
+ "explicit" preproc_ident_known #c++
+ "export" preproc_ident_known #c++
+ "false" preproc_ident_known #c++
+ "friend" preproc_ident_known #c++
+ "namespace" preproc_ident_known #c++
+ "new" preproc_ident_known #c++
+ "not" preproc_ident_known #c++
+ "not_eq" preproc_ident_known #c++
+ "operator" preproc_ident_known #c++
+ "or" preproc_ident_known #c++
+ "or_eq" preproc_ident_known #c++
+ "private" preproc_ident_known #c++
+ "protected" preproc_ident_known #c++
+ "public" preproc_ident_known #c++
+ "throw" preproc_ident_known #c++
+ "true" preproc_ident_known #c++
+ "try" preproc_ident_known #c++
+ "using" preproc_ident_known #c++
+ "virtual" preproc_ident_known #c++
+ "xor" preproc_ident_known #c++
+ "xor_eq" preproc_ident_known #c++
+done
+ "a-z$A-Z0-9_" preproc_ident
+:preproc_ident_known CPreproc_cKW
+ * preproc noeat
+
+:pre2_slash CPreproc_sym
+ * preproc recolor=-1
+ "*" pre2_comment recolor=-2
+ "/" pre2_line_comment recolor=-2
+:pre2_comment CPreprocCComment
+ * pre2_comment
+ "*" pre2_comment_maybe_end
+:pre2_comment_maybe_end CPreprocCComment
+ * pre2_comment
+ "/" preproc
+ "*" pre2_comment_maybe_end
+:pre2_line_comment CPreprocCComment
+ * pre2_line_comment
+ "\\" pre2_line_comment_escape
+ "\n" newline
+:pre2_line_comment_escape CPreprocCComment
+ * pre2_line_comment
+:pre2_string CPreproc_sym
+ * pre2_string
+ "\"" preproc
+ "\\" pre2_string_escape
+:pre2_string_escape CPreproc_sym
+ * pre2_string
+:pre2_char CPreproc_sym
+ * pre2_char
+ "'" preproc
+ "\\" pre2_char_escape
+:pre2_char_escape CPreproc_sym
+ * pre2_char
+
+# CPreprocessor directives that just begin with #, no keyword
+:pre1_slash CPreprocUnknown
+ * pre recolor=-1
+ "*" pre1_comment recolor=-2
+ "/" pre1_line_comment recolor=-2
+:pre1_comment CPreprocCComment
+ * pre1_comment
+ " " pre1_comment_space
+ "*" pre1_comment_maybe_end
+:pre1_comment_space CPreprocCComment
+ * pre1_comment noeat
+ "\n" pre1_comment_trailing_space recolor=-2
+:pre1_comment_trailing_space TrailingSpace
+ * pre1_comment noeat
+:pre1_comment_maybe_end CPreprocCComment
+ * pre1_comment
+ "/" pre
+ "*" pre1_comment_maybe_end
+:pre1_line_comment CPreprocCComment
+ * pre1_line_comment
+ "\\" pre1_line_comment_escape
+ "\n" newline
+:pre1_line_comment_escape CPreprocCComment
+ * pre1_line_comment
+
+
+# Special care about OpenMP #pragma constructs
+:preproc_pragma CPreprocKW
+ * preproc_pragma0 noeat
+:preproc_pragma0 CPreproc
+ * preproc noeat
+ " " preproc_pragma0
+ "o" openmp1
+:openmp1 CPreproc
+ * preproc noeat
+ "m" openmp2
+:openmp2 CPreproc
+ * preproc noeat
+ "p" openmp3
+:openmp3 CPreproc
+ * preproc noeat
+ " " openmp_keyword_known recolor=-12
+
+:openmp OpenMP
+ * openmp
+ " \t" openmp_space recolor=-1
+ "(" openmp_parens
+ "\\" openmp_cont
+ "a-z_" openmp_keyword recolor=-1 buffer
+ "/" openmp_slash
+ "\n" newline
+:openmp_space OpenMP_space
+ * openmp noeat
+ "\n" trailing_space recolor=-2
+:openmp_slash OpenMP
+ * openmp
+ "*" openmp_comment recolor=-2
+ "/" openmp_line_comment recolor=-2
+:openmp_comment OpenMPcomment
+ * openmp_comment
+ "*" openmp_comment_maybe_end
+:openmp_comment_maybe_end OpenMPcomment
+ * openmp_comment
+ "*" openmp_comment_maybe_end
+ "/" openmp
+:openmp_line_comment OpenMPcomment
+ * openmp_line_comment
+ "\\" openmp_line_comment_escape
+ "\n" newline
+:openmp_line_comment_escape OpenMPcomment
+ * openmp_line_comment
+
+:openmp_parens OpenMP
+ * openmp_parens
+ "\\" openmp_parens_cont
+ "/" openmp_parens_slash
+ ")" openmp
+ "\n" newline
+:openmp_cont OpenMP
+ * openmp
+:openmp_parens_cont OpenMP
+ * openmp_parens
+:openmp_parens_slash OpenMP
+ * openmp_parens noeat
+ "*" openmp_parens_comment recolor=-2
+:openmp_parens_comment OpenMPcomment
+ * openmp_parens_comment
+ "*" openmp_parens_comment_maybe_end
+:openmp_parens_comment_maybe_end OpenMPcomment
+ * openmp_parens_comment
+ "*" openmp_parens_comment_maybe_end
+ "/" openmp_parens
+
+:openmp_keyword OpenMPnonkw
+ * openmp noeat strings
+ "atomic" openmp_keyword_known2
+ "barrier" openmp_keyword_known2
+ "collapse" openmp_keyword_known
+ "copyin" openmp_keyword_known
+ "copyprivate" openmp_keyword_known
+ "critical" openmp_keyword_known2
+ "default" openmp_keyword_known_do_parens
+ "dynamic" openmp_keyword_known_end_parens
+ "firstprivate" openmp_keyword_known
+ "for" openmp_keyword_known2
+ "flush" openmp_keyword_known2
+ "guided" openmp_keyword_known_end_parens
+ "if" openmp_keyword_known
+ "lastprivate" openmp_keyword_known
+ "master" openmp_keyword_known2
+ "nowait" openmp_keyword_known
+ "none" openmp_keyword_known_end_parens
+ "num_threads" openmp_keyword_known
+ "ordered" openmp_keyword_known2
+ "parallel" openmp_keyword_known2
+ "private" openmp_keyword_known_end_parens
+ "reduction" openmp_keyword_known
+ "schedule" openmp_keyword_known_do_parens
+ "section" openmp_keyword_known2
+ "sections" openmp_keyword_known2
+ "shared" openmp_keyword_known_end_parens
+ "single" openmp_keyword_known2
+ "static" openmp_keyword_known_end_parens
+ "task" openmp_keyword_known2
+ "taskwait" openmp_keyword_known
+ "threadprivate" openmp_keyword_known
+ "untied" openmp_keyword_known
+done
+ "a-z0-9A-Z_" openmp_keyword
+:openmp_keyword_known OpenMPkw
+ * openmp noeat
+:openmp_keyword_known2 OpenMPkw2
+ * openmp noeat
+:openmp_keyword_known_do_parens OpenMPkw
+ * openmp noeat
+ "(" openmp_keyword_known_do_parens1 recolor=-1
+:openmp_keyword_known_end_parens OpenMPkw
+ * openmp_keyword_known_end_parens1 noeat
+:openmp_keyword_known_end_parens1 OpenMP
+ * openmp noeat
+ " " openmp_keyword_known_end_parens1
+ "," openmp_parens
+:openmp_keyword_known_do_parens1 OpenMP
+ * openmp_parens noeat
+ "a-z_" openmp_keyword recolor=-1 buffer
# All following states are for when we're not in a preprocessor line
-:idle Idle
- * idle
- "\n" reset
- "0" first_digit recolor=-1
- "1-9" decimal recolor=-1
- "." maybe_float
- "\"" string recolor=-1
- "'" char recolor=-1
- "\i" ident buffer
- "\\" outside_escape recolor=-1
- "{}:,;" brace recolor=-1
- ",=()><[]*&|!~+\-%^\/" control recolor=-1
- "/" slash
-
-
-:outside_escape Escape
- * idle
-
-:brace Brace
- * idle noeat
-
-:control Control
- * idle noeat
-
-:slash Idle
- * idle noeat recolor=-2 # Not sure about this
- "*" comment recolor=-2
- "/" line_comment recolor=-2
-
-:comment Comment comment
- * comment
- "*" maybe_end_comment
-
-:maybe_end_comment Comment comment
- * comment
- "/" idle
- "*" maybe_end_comment
-
-:line_comment Comment comment
- * line_comment
- "\n" reset
-
-:first_digit Constant
- * idle noeat
- "xX" hex
- "." float
- "eE" epart
- "0-7" octal
- "89" bad_number recolor=-1
-
-:bad_number Bad
- * idle noeat
- "0-9" bad_number
-
-:octal Constant
- * idle noeat
- "0-7" octal
- "89" bad_number recolor=-1
-
-:hex Constant
- * idle noeat
- "0-9A-Fa-f" hex
-
-:decimal Constant
- * idle noeat
- "0-9" decimal
- "eE" epart
- "." float
-
-:maybe_float Constant
- * idle recolor=-2 noeat
- "0-9" float recolor=-2
-
-:float Constant
- * idle noeat
- "eE" epart
- "0-9" float
-
-:epart Constant
- * idle noeat
- "0-9+\-" enum
-
-:enum Constant
- * idle noeat
- "0-9" enum
-
-:string Constant string
- * string
- "\"" idle
- "\\" string_escape recolor=-1
- "%" string_control recolor=-1
-
-:string_escape Escape string
- * string
- "x" string_hex
- "0-7" string_octal2
- "\n" string recolor=-2
-
-# \x will consume all successive hex digits (ANSI C).
-:string_hex Escape string
- * string noeat
- "0-9a-fA-F" string_hex
-
-:string_octal2 Escape string
- * string noeat
- "0-7" string_octal3
-
-:string_octal3 Escape string
- * string noeat
- "0-7" string
-
-:string_control Escape string
- * string
- "\"" string noeat
- "\n" reset
- "\\" string_escape recolor=-1
- "0-9.\-+ #hjILtz$" string_control
-
-:char Constant string
- * char
- "\n" reset
- "'" idle
- "\\" char_escape recolor=-1
-
-:char_escape Escape string
- * char
- "x" char_hex
- "0-7" char_octal2
- "\n" char recolor=-2
-
-# \x will consume all successive hex digits (ANSI C).
-:char_hex Escape string
- * char noeat
- "0-9a-fA-F" char_hex
-
-:char_octal2 Escape string
- * char noeat
- "0-7" char_octal3
-
-:char_octal3 Escape string
- * char noeat
- "0-7" char
-
-:ident Idle
- * idle noeat strings
- "int" type
- "float" type
- "long" type
- "short" type
- "char" type
- "double" type
- "signed" type
- "unsigned" type
- "void" type
- "static" type
- "register" type
- "extern" type
- "inline" type
- "auto" type
- "const" type
- "volatile" type
- "if" kw
- "else" kw
- "while" kw
- "for" kw
- "break" kw
- "continue" kw
- "do" kw
- "case" kw
- "default" kw
- "switch" kw
- "goto" kw
- "struct" kw
- "enum" kw
- "return" kw
- "sizeof" kw
- "typedef" kw
- "union" kw
- "asm" kw
-# C++ keywords
- #"asm" cppkw (listed above as a C keyword)
- "bool" cppkw
- "catch" cppkw
- "class" cppkw
- "const_cast" cppkw
- "delete" cppkw
- "dynamic_cast" cppkw
- "explicit" cppkw
- "false" cppkw
- "friend" cppkw
- #"inline" cppkw (listed above as a C keyword)
- "mutable" cppkw
- "namespace" cppkw
- "new" cppkw
- "operator" cppkw
- "private" cppkw
- "protected" cppkw
- "public" cppkw
- "reinterpret_cast" cppkw
- "static_cast" cppkw
- "template" cppkw
- "this" cppkw
- "throw" cppkw
- "true" cppkw
- "try" cppkw
- "typeid" cppkw
- "typename" cppkw
- "using" cppkw
- "virtual" cppkw
- "wchar_t" type
-# Non-Standard
- "typeof" cppkw
+:idle Background
+ * idle_mystery recolor=-1
+ "()?~" special recolor=-1
+ "[]{},;" special2 recolor=-1
+ ":" maybe_glue recolor=-1
+ "!<>" maybe_comp recolor=-1
+ "=" maybe_comp_eq recolor=-1
+ "-+*%&|^" maybe_op_assign recolor=-1
+ " \t" space recolor=-1
+ "/" slash recolor=-1
+ "0" first_digit_0 recolor=-1
+ "1-9" first_digit recolor=-1
+ "." period recolor=-1
+ "\"" stringbegin recolor=-1 noeat
+ "'" charbegin recolor=-1 noeat
+ "a-z$A-Z_" ident recolor=-1 buffer
+ "L" maybe_wide recolor=-1 buffer
+ "\n" newline recolor=-1
+:idle_mystery Mystery
+ * idle noeat
+:space Background
+ * idle noeat
+ "\n" trailing_space recolor=-2
+:trailing_space TrailingSpace
+ * newline noeat
+
+# Delimiters
+:special Special
+ * idle noeat
+:special2 Special2
+ * idle noeat
+:period Special
+ * idle noeat
+ ":" typoed_glue recolor=-2
+ "0-9" float recolor=-2
+:slash Special
+ * idle noeat
+ "*" comment recolor=-2 # "/*"
+ "/" line_comment recolor=-2 # "//"
+ "=" was_op_assign recolor=-2 # "/="
+
+# "::"
+:maybe_glue Special
+ * idle noeat
+ "." typoed_glue recolor=-2
+ ":" was_glue recolor=-2
+:was_glue GlueColor
+ * idle noeat
+
+:typoed_glue InvalidNumber
+ * idle noeat
+
+# "==" vs "="
+:maybe_comp_eq AssignColor
+ * idle noeat
+ "=" was_comp recolor=-2
+# "<=", ">=", "==", "!="
+:maybe_comp Special
+ * idle noeat
+ "=" was_comp recolor=-2
+:was_comp Special
+ * idle noeat
+
+# "+=", "-=", "*=", "/=", "%=", "&=", "|="
+:maybe_op_assign Special
+ * idle noeat
+ "=" was_op_assign recolor=-2
+:was_op_assign AssignColor
+ * idle noeat
+
+
+# CComments
+:comment CComment
+ * comment
+ " " comment_space
+ "*" maybe_end_comment
+:comment_space CComment
+ * comment noeat
+ "\n" comment_trailing_space recolor=-2
+:comment_trailing_space TrailingSpace
+ * comment noeat
+:maybe_end_comment CComment
+ * comment
+ "/" idle
+ "*" maybe_end_comment
+:line_comment CComment
+ * line_comment
+ "\\" line_comment_escape
+ "\n" newline recolor=-1
+:line_comment_escape CComment
+ * line_comment
+
+# Numeric constants
+:first_digit_0 Numeric
+ * first_digit noeat
+ "xX" hex_first
+:first_digit Numeric
+ * number_before_e noeat
+
+:hex_first Numeric
+ * end_number_suffix noeat recolor=-2
+ "0-9A-Fa-f" hex
+ "." hexfloat
+:hex Numeric
+ * end_int noeat
+ "0-9A-Fa-f" hex
+ "." hexfloat
+ "pP" epart
+:hexfloat Numeric
+ * end_number_suffix noeat recolor=-2
+ "0-9A-Fa-f" hexfloat
+ "pP" epart
+:number_before_e Numeric
+ * end_int noeat
+ "0-9" number_before_e
+ "." float
+ "eE" epart
+
+:float Numeric
+ * end_float noeat
+ "eE" epart
+ "0-9" float
+:epart Numeric
+ * enum_first noeat
+ "-+" enum_first
+:enum_first Numeric
+ * end_number_suffix noeat recolor=-2
+ "0-9" enum
+:enum Numeric
+ * end_float noeat
+ "0-9" enum
+:end_float NumericSuffix
+ * end_number_suffix noeat
+ "fFlL" end_number_suffix #f, #l
+:end_int NumericSuffix
+ * end_number_suffix noeat
+ "uU" int_suffix_u #u
+ "lL" int_suffix_l #l
+:int_suffix_u NumericSuffix
+ * end_number_suffix noeat
+ "lL" int_suffix_ul #ul
+:int_suffix_ul NumericSuffix
+ * end_number_suffix noeat
+ "lL" end_number_suffix #ull
+:int_suffix_l NumericSuffix
+ * end_number_suffix noeat
+ "uU" end_number_suffix #lu
+ "lL" int_suffix_ll #ll
+:int_suffix_ll NumericSuffix
+ * end_number_suffix noeat
+ "uU" end_number_suffix #llu
+:end_number_suffix InvalidNumber
+ * idle noeat
+ "a-z$A-Z_0-9" end_number_suffix
+
+# Strings
+:stringbegin String
+ * string
+:stringend String
+ * idle
+
+:string StringContent
+ * string
+ "\"" stringend noeat
+ "\\" string_escape
+ "\n" invalid_string_char_flush recolor=-2
+:string_escape StringContent
+ * string
+ "\n" string
+ "" string_escape_ignore noeat
+:string_escape_ignore Background
+ * string_escape
+
+:wstringbegin WString
+ * wstring
+:wstringend WString
+ * idle
+
+:wstring WStringContent
+ * wstring
+ "\"" wstringend noeat
+ "\\" wstring_escape
+ "\n" invalid_string_char_flush recolor=-2
+:wstring_escape WStringContent
+ * wstring
+ "\n" wstring
+ "" wstring_escape_ignore noeat
+:wstring_escape_ignore Background
+ * wstring_escape
+
+
+# Chars
+:charbegin Char
+ * char
+:charend Char
+ * idle
+
+:char CharContent
+ * char
+ "'" charend noeat
+ "\\" char_escape
+ "\n" invalid_string_char_flush recolor=-2
+:char_escape CharContent
+ * char
+ "\n" char
+:char_escape_ignore Background
+ * char_escape
+
+:wcharbegin WChar
+ * wchar
+:wcharend WChar
+ * idle
+:wchar WCharContent
+ * wchar
+ "'" wcharend noeat
+ "\\" wchar_escape
+ "\n" invalid_string_char_flush recolor=-2
+:wchar_escape WCharContent
+ * wchar
+ "\n" wchar
+:wchar_escape_ignore Background
+ * wchar_escape
+
+
+:maybe_wide Identifier
+ * ident noeat
+ "'" wcharbegin noeat recolor=-2
+ "\"" wstringbegin noeat recolor=-2
+
+
+# This is if a "\n" is met inside a string or char constant.
+# It serves two purposes:
+# Helps getting back in sync
+# Minimizes terminal traffic when entering strings
+:invalid_string_char_flush AbruptStringTermination
+ * newline noeat
+
+# Special identifiers
+:ident Identifier
+ * idle noeat strings
+ "auto" type
+ "char" type
+ "const" type
+ "decltype" type
+ "double" type
+ "enum" type
+ "extern" type
+ "float" type
+ "inline" type
+ "int" type
+ "long" type
+ "register" type
+ "short" type
+ "signed" type
+ "static" type
+ "struct" type
+ "typedef" type
+ "union" type
+ "unsigned" type
+ "void" type
+ "volatile" type
+ "bool" type #c++
+ "class" type #c++
+ "const_cast" type #c++
+ "dynamic_cast" type #c++
+ "mutable" type #c++
+ "reinterpret_cast" type #c++
+ "static_cast" type #c++
+ "template" type #c++
+ "typeid" type #c++
+ "typename" type #c++
+ "wchar_t" type #c++
+ "break" kw
+ "case" kw
+ "continue" kw
+ "default" kw
+ "do" kw
+ "else" kw
+ "for" kw
+ "goto" kw
+ "if" kw
+ "return" kw
+ "sizeof" kw
+ "switch" kw
+ "while" kw
+ "bitand" kw #c++
+ "bitor" kw #c++
+ "catch" kw #c++
+ "compl" kw #c++
+ "delete" kw #c++
+ "explicit" kw #c++
+ "export" kw #c++
+ "false" kw #c++
+ "friend" kw #c++
+ "namespace" kw #c++
+ "new" kw #c++
+ "not" kw #c++
+ "not_eq" kw #c++
+ "operator" kw #c++
+ "or" kw #c++
+ "or_eq" kw #c++
+ "private" kw #c++
+ "protected" kw #c++
+ "public" kw #c++
+ "this" kw #c++
+ "throw" kw #c++
+ "true" kw #c++
+ "try" kw #c++
+ "using" kw #c++
+ "virtual" kw #c++
+ "xor" kw #c++
+ "xor_eq" kw #c++
+ "accumulate" stlkw
+ "adjacent_difference" stlkw
+ "adjacent_find" stlkw
+ "advance" stlkw
+ "allocator" stlkw
+ "auto_ptr" stlkw
+ "back_insert_iterator" stlkw
+ "back_inserter" stlkw
+ "basic_string" stlkw
+ "binary_function" stlkw
+ "binary_negate" stlkw
+ "binary_search" stlkw
+ "bind1st" stlkw
+ "bind2nd" stlkw
+ "binder1st" stlkw
+ "binder2nd" stlkw
+ "bitset" stlkw
+ "complex" stlkw
+ "copy" stlkw
+ "copy_backward" stlkw
+ "count" stlkw
+ "count_if" stlkw
+ "deque" stlkw
+ "distance" stlkw
+ "distance_type" stlkw
+ "divides" stlkw
+ "equal" stlkw
+ "equal_range" stlkw
+ "equal_to" stlkw
+ "exception" stlkw
+ "fill" stlkw
+ "fill_n" stlkw
+ "find" stlkw
+ "find_end" stlkw
+ "find_first_of" stlkw
+ "find_if" stlkw
+ "for_each" stlkw
+ "front_insert_iterator" stlkw
+ "front_inserter" stlkw
+ "generate" stlkw
+ "generate_n" stlkw
+ "get_temporary_buffer" stlkw
+ "greater" stlkw
+ "greater_equal" stlkw
+ "includes" stlkw
+ "inner_product" stlkw
+ "inplace_merge" stlkw
+ "insert_iterator" stlkw
+ "inserter" stlkw
+ "istream_iterator" stlkw
+ "iter_swap" stlkw
+ "iterator_category" stlkw
+ "less" stlkw
+ "less_equal" stlkw
+ "lexicographical_compare" stlkw
+ "limits" stlkw
+ "list" stlkw
+ "logical_and" stlkw
+ "logical_not" stlkw
+ "logical_or" stlkw
+ "lower_bound" stlkw
+ "make_heap" stlkw
+ "map" stlkw
+ "max" stlkw
+ "max_element" stlkw
+ "merge" stlkw
+ "min" stlkw
+ "min_element" stlkw
+ "minus" stlkw
+ "mismatch" stlkw
+ "modulus" stlkw
+ "move" stlkw
+ "multimap" stlkw
+ "multiset" stlkw
+ "negate" stlkw
+ "next_permutation" stlkw
+ "not1" stlkw
+ "not2" stlkw
+ "not_equal_to" stlkw
+ "nth_element" stlkw
+ "numeric_limits" stlkw
+ "ostream_iterator" stlkw
+ "pair" stlkw
+ "partial_sort" stlkw
+ "partial_sort_copy" stlkw
+ "partial_sum" stlkw
+ "partition" stlkw
+ "permutation" stlkw
+ "plus" stlkw
+ "pointer_to_binary_function" stlkw
+ "pointer_to_unary_function" stlkw
+ "pop_heap" stlkw
+ "prev_permutation" stlkw
+ "priority_queue" stlkw
+ "ptr_fun" stlkw
+ "push_heap" stlkw
+ "queue" stlkw
+ "random_shuffle" stlkw
+ "raw_storage_iterator" stlkw
+ "remove" stlkw
+ "remove_copy" stlkw
+ "remove_copy_if" stlkw
+ "remove_if" stlkw
+ "replace" stlkw
+ "replace_copy" stlkw
+ "replace_copy_if" stlkw
+ "replace_if" stlkw
+ "return_temporary_buffer" stlkw
+ "reverse" stlkw
+ "reverse_bidirectional_iterator" stlkw
+ "reverse_copy" stlkw
+ "reverse_iterator" stlkw
+ "rotate" stlkw
+ "rotate_copy" stlkw
+ "search" stlkw
+ "search_n" stlkw
+ "set" stlkw
+ "set_difference" stlkw
+ "set_intersection" stlkw
+ "set_symmetric_difference" stlkw
+ "set_union" stlkw
+ "sort" stlkw
+ "sort_heap" stlkw
+ "stable_partition" stlkw
+ "stable_sort" stlkw
+ "stack" stlkw
+ "string" stlkw
+ "string_char_traits" stlkw
+ "swap" stlkw
+ "swap_ranges" stlkw
+ "times" stlkw
+ "transform" stlkw
+ "unary_function" stlkw
+ "unary_negate" stlkw
+ "uninitialized_copy" stlkw
+ "uninitialized_fill" stlkw
+ "uninitialized_fill_n" stlkw
+ "unique" stlkw
+ "unique_copy" stlkw
+ "upper_bound" stlkw
+ "value_type" stlkw
+ "vector" stlkw
+ "wstring" stlkw
+ "std" stlkw
+ "iterator" stlkw
+ "const_iterator" stlkw
+ "const_reverse_iterator" stlkw
done
- "\c" ident
+ "a-z$A-Z0-9_" ident
+
-:type Type
- * idle noeat
-:kw Keyword
- * idle noeat
-:cppkw CppKeyword
- * idle noeat
+:type CType
+ * idle noeat
+:kw CKeyword
+ * idle noeat
+:stlkw STLkw
+ * idle noeat
+ ":" stlkw_colon recolor=-1
+:stlkw_colon InvalidNumber
+ * idle noeat
+ ":" was_glue recolor=-2
diff --git a/.joe/syntax/c.jsf.back b/.joe/syntax/c.jsf.back
@@ -0,0 +1,517 @@
+# JOE syntax highlight file for C and C++
+
+# A (deterministic) state machine which performs lexical analysis of C.
+# (This is the "assembly language" of syntax highlighting. A separate
+# program could be used to convert a regular expression NFA syntax into this
+# format).
+
+# Each state begins with ':<name> <color-name> <context>'
+#
+# <color-name> is the color used for characters eaten by the state
+# (really a symbol for a user definable color).
+#
+# <context> tells JOE if the current character is part of a comment or a string.
+# This allows JOE to skip over comments and strings when matching characters
+# such as parentheses. To use this feature, the -highlighter_context option
+# must be applied to the files highlighted by the corresponding syntax. To
+# apply the option, add it to ftyperc for those file entries.
+#
+# The valid contexts are:
+# comment This character is part of a comment. Example: /* comment */
+#
+# string This character is part of a string. Examples: "string" 'c' 'string'
+#
+# The comment and string delimiters themselves should be marked with the
+# appropriate context. The context is considered to be part of the color, so
+# the recolor=-N and recolormark options apply the context to previous
+# characters.
+
+# The first state defined is the initial state.
+
+# Within a state, define transitions (jumps) to other states. Each
+# jump has the form: <character-list> <target-state> [<option>s]
+
+# There are three ways to specify <character-list>s, either * for any
+# character not otherwise specified, % or & to match the character in the
+# delimiter match buffer or a literal list of characters within quotes
+# (ranges and escape sequences allowed). When the next character matches
+# any in the list, a jump to the target-state is taken and the character is
+# eaten (we advance to the next character of the file to be colored).
+#
+# The * transition should be the first transition specified in the state.
+#
+# There are several options:
+# noeat do not eat the character, instead feed it to the next state
+# (this tends to make the states smaller, but be careful: you
+# can make infinite loops). 'noeat' implies 'recolor=-1'.
+#
+# recolor=-N Recolor the past N characters with the color of the
+# target-state. For example once /* is recognized as the
+# start of C comment, you want to color the /* with the C
+# comment color with recolor=-2.
+#
+# mark Mark beginning of a region with current position.
+#
+# markend Mark end of region.
+#
+# recolormark Recolor all of the characters in the marked region with
+# the color of the target-state. If markend is not given,
+# all of the characters up to the current position are recolored.
+# Note that the marked region can not cross line boundaries and
+# must be on the same line as recolormark.
+#
+# buffer start copying characters to a string buffer, beginning with this
+# one (it's ok to not terminate buffering with a matching
+# 'strings' option- the buffer is limited to leading 23
+# characters).
+#
+# save_c Save character in delimiter match buffer.
+#
+# save_s Copy string buffer to delimiter match buffer.
+#
+# strings A list of strings follows. If the buffer matches any of the
+# given strings, a jump to the target-state in the string list
+# is taken instead of the normal jump.
+#
+# istrings Same as strings, but case is ignored.
+#
+# Note: strings and istrings should be the last option on the
+# line. They cause any options which follow them to be ignored.
+#
+# hold Stop buffering string- a future 'strings' or 'istrings' will
+# look at contents of buffer at this point. Useful for distinguishing
+# commands and function calls in some languages 'write 7' is a command
+# 'write (' is a function call- hold lets us stop at the space and delay
+# the string lookup until the ( or 7.
+#
+# The format of the string list is:
+#
+# "string" <target-state> [<options>s]
+# "string" <target-state> [<options>s]
+# "&" <target-state> [<options>s] # matches contents of delimiter match buffer
+# done
+#
+# (all of the options above are allowed except "strings", "istrings" and "noeat". noeat is
+# always implied after a matched string).
+#
+# Weirdness: only states have colors, not transitions. This means that you
+# sometimes have to make dummy states with '* next-state noeat' just to get
+# a color specification.
+#
+# Delimiter match buffer is for perl and shell: a regex in perl can be s<..>(...)
+# and in shell you can say: <<EOS ....... EOS
+
+# New feature: subroutines
+#
+# Highlighter state machines can now make subroutine calls. The highlighter has
+# a run-time stack that allows unlimited recursion.
+#
+# To call a subroutine, use the 'call' option:
+#
+# "\"" fred call=string(dquote)
+#
+# The subroutine called 'string' is called and the jump to 'fred' is
+# ignored. The 'dquote' option is passed to the subroutine.
+#
+# The subroutine itself returns to the caller like this:
+# "\"" whatever return
+#
+# If we're in a subroutine, the return is made. Otherwise the jump
+# to 'whatever' is made.
+#
+# There are several ways of delimiting subroutines which show up in how it
+# is called. Here are the options:
+#
+# call=string() A file called string.jsf is the subroutine.
+# The entire file is the subroutine. The starting
+# point is the first state in the file.
+#
+# call=library.string() A file called library.jsf has the subroutine.
+# The subroutine within the file is called string.
+#
+# call=.string() There is a subroutine called string in the current file.
+#
+# When a subroutine is within a file, but is not the whole file, it is delimited
+# as follows:
+#
+# .subr string
+#
+# . . . states for string subroutine . . .
+#
+# .end
+#
+# Option flags can be passed to subroutines which control preprocessor-like
+# directives. For example:
+#
+# .ifdef dquote
+# "\"" idle return
+# .endif
+# .ifdef squote
+# "'" idle return
+# .endif
+#
+# .else if also available. .ifdefs can be nested.
+
+
+# Obsolete feature: the sync lines specification no longer matter. We now always parse
+# from the beginning of the file. Here is the old description:
+#
+# Define no. sync lines
+# You can say:
+# -200 means 200 lines
+# - means always start parsing from beginning of file when we lose sync
+# if nothing is specified, the default is -50
+-
+
+# Define colors and attributes. Give a list of attributes, one
+# background color and one foreground color (default is used if
+# color is left out).
+#
+# Attributes:
+# bold inverse blink dim underline italic
+#
+# Standard colors:
+#
+# Foreground:
+# white cyan magenta blue yellow green red black
+#
+# Background:
+# bg_white bg_cyan bg_magenta bg_blue bg_yellow bg_green bg_red bg_black
+#
+# For 16 color and 256 color xterms: "export TERM=xterm-16color", these
+# brighter than normal colors are available:
+#
+# Note that you need an xterm which was compiled to support 16 or 256 colors
+# and a matching termcap/terminfo entry for it.
+#
+# Foreground:
+# WHITE CYAN MAGENTA BLUE YELLOW GREEN RED BLACK
+#
+# Background:
+# bg_WHITE bg_CYAN bg_MAGENTA bg_BLUE bg_YELLOW bg_GREEN bg_RED bg_BLACK
+#
+# For 256 color xterm: "export TERM=xterm-256color", these become available:
+#
+# Note that you need an xterm which was compiled to support 256 colors and a
+# matching termcap/terminfo entry for it.
+#
+# fg_RGB and bg_RGB, where R, G, and B range from 0 - 5. So: fg_500 is bright red.
+#
+# fg_NN and bg_NN give shades of grey, where the intensity, NN, ranges from 0 - 23.
+
+=Idle
+=Bad bold red
+=Preproc blue
+=Define bold blue
+=Comment red
+=IncLocal cyan
+=IncSystem bold cyan
+=Constant magenta
+=Escape bold cyan
+=Type bold
+=Keyword bold
+=CppKeyword bold
+=Brace green
+=Control cyan
+
+:reset Idle
+ * first noeat
+ " \t" reset
+
+:first Idle
+ * idle noeat
+ "#" pre recolor=-1
+
+:pre Preproc
+ * preproc noeat
+ " \t" pre
+ "a-z" preident recolor=-1 buffer
+
+:preident Preproc
+ * preproc noeat strings
+ "define" predef
+ "include" preinc
+done
+ "a-z" preident
+
+:preinc Preproc
+ * preinc
+ " \t" preinc_ws
+ "\n" reset
+
+:preinc_ws Preproc
+ * prebad recolor=-1
+ " \t" preinc_ws
+ "\"" preinc_local recolor=-1
+ "<" preinc_system recolor=-1
+
+:preinc_local IncLocal string
+ * preinc_local
+ "\"\n" reset
+
+:preinc_system IncSystem string
+ * preinc_system
+ ">\n" reset
+
+:prebad Bad
+ * prebad
+ "\n" reset
+
+
+:predef Preproc
+ * predef
+ " \t" predef_ws
+ "\n" reset
+
+:predef_ws Preproc
+ * prebad recolor=-1
+ " \t" predef_ws
+ "\c" predef_ident recolor=-1
+
+:predef_ident Define
+ * idle noeat
+ "\c" predef_ident
+
+
+:preproc Preproc
+ * preproc
+ "\n" reset
+ "\\" preproc_cont
+ "/" preproc_slash
+
+:preproc_slash Preproc
+ * preproc noeat
+ "*" comment recolor=-2
+ "/" line_comment recolor=-2
+
+:preproc_cont Preproc
+ * preproc_cont
+ "\n" preproc
+
+# All following states are for when we're not in a preprocessor line
+
+:idle Idle
+ * idle
+ "\n" reset
+ "0" first_digit recolor=-1
+ "1-9" decimal recolor=-1
+ "." maybe_float
+ "\"" string recolor=-1
+ "'" char recolor=-1
+ "\i" ident buffer
+ "\\" outside_escape recolor=-1
+ "{}:,;" brace recolor=-1
+ ",=()><[]*&|!~+\-%^\/" control recolor=-1
+ "/" slash
+
+
+:outside_escape Escape
+ * idle
+
+:brace Brace
+ * idle noeat
+
+:control Control
+ * idle noeat
+
+:slash Idle
+ * idle noeat recolor=-2 # Not sure about this
+ "*" comment recolor=-2
+ "/" line_comment recolor=-2
+
+:comment Comment comment
+ * comment
+ "*" maybe_end_comment
+
+:maybe_end_comment Comment comment
+ * comment
+ "/" idle
+ "*" maybe_end_comment
+
+:line_comment Comment comment
+ * line_comment
+ "\n" reset
+
+:first_digit Constant
+ * idle noeat
+ "xX" hex
+ "." float
+ "eE" epart
+ "0-7" octal
+ "89" bad_number recolor=-1
+
+:bad_number Bad
+ * idle noeat
+ "0-9" bad_number
+
+:octal Constant
+ * idle noeat
+ "0-7" octal
+ "89" bad_number recolor=-1
+
+:hex Constant
+ * idle noeat
+ "0-9A-Fa-f" hex
+
+:decimal Constant
+ * idle noeat
+ "0-9" decimal
+ "eE" epart
+ "." float
+
+:maybe_float Constant
+ * idle recolor=-2 noeat
+ "0-9" float recolor=-2
+
+:float Constant
+ * idle noeat
+ "eE" epart
+ "0-9" float
+
+:epart Constant
+ * idle noeat
+ "0-9+\-" enum
+
+:enum Constant
+ * idle noeat
+ "0-9" enum
+
+:string Constant string
+ * string
+ "\"" idle
+ "\\" string_escape recolor=-1
+ "%" string_control recolor=-1
+
+:string_escape Escape string
+ * string
+ "x" string_hex
+ "0-7" string_octal2
+ "\n" string recolor=-2
+
+# \x will consume all successive hex digits (ANSI C).
+:string_hex Escape string
+ * string noeat
+ "0-9a-fA-F" string_hex
+
+:string_octal2 Escape string
+ * string noeat
+ "0-7" string_octal3
+
+:string_octal3 Escape string
+ * string noeat
+ "0-7" string
+
+:string_control Escape string
+ * string
+ "\"" string noeat
+ "\n" reset
+ "\\" string_escape recolor=-1
+ "0-9.\-+ #hjILtz$" string_control
+
+:char Constant string
+ * char
+ "\n" reset
+ "'" idle
+ "\\" char_escape recolor=-1
+
+:char_escape Escape string
+ * char
+ "x" char_hex
+ "0-7" char_octal2
+ "\n" char recolor=-2
+
+# \x will consume all successive hex digits (ANSI C).
+:char_hex Escape string
+ * char noeat
+ "0-9a-fA-F" char_hex
+
+:char_octal2 Escape string
+ * char noeat
+ "0-7" char_octal3
+
+:char_octal3 Escape string
+ * char noeat
+ "0-7" char
+
+:ident Idle
+ * idle noeat strings
+ "int" type
+ "float" type
+ "long" type
+ "short" type
+ "char" type
+ "double" type
+ "signed" type
+ "unsigned" type
+ "void" type
+ "static" type
+ "register" type
+ "extern" type
+ "inline" type
+ "auto" type
+ "const" type
+ "volatile" type
+ "if" kw
+ "else" kw
+ "while" kw
+ "for" kw
+ "break" kw
+ "continue" kw
+ "do" kw
+ "case" kw
+ "default" kw
+ "switch" kw
+ "goto" kw
+ "struct" kw
+ "enum" kw
+ "return" kw
+ "sizeof" kw
+ "typedef" kw
+ "union" kw
+ "asm" kw
+ "case" kw
+# C++ keywords
+ #"asm" cppkw (listed above as a C keyword)
+ "bool" cppkw
+ "catch" cppkw
+ "class" cppkw
+ "const_cast" cppkw
+ "delete" cppkw
+ "dynamic_cast" cppkw
+ "nullptr" cppkw
+ "explicit" cppkw
+ "false" cppkw
+ "friend" cppkw
+ #"inline" cppkw (listed above as a C keyword)
+ "mutable" cppkw
+ "namespace" cppkw
+ "new" cppkw
+ "operator" cppkw
+ "private" cppkw
+ "protected" cppkw
+ "public" cppkw
+ "reinterpret_cast" cppkw
+ "static_cast" cppkw
+ "template" cppkw
+ "this" cppkw
+ "throw" cppkw
+ "true" cppkw
+ "try" cppkw
+ "typeid" cppkw
+ "typename" cppkw
+ "using" cppkw
+ "virtual" cppkw
+ "wchar_t" type
+# Non-Standard
+ "typeof" cppkw
+done
+ "\c" ident
+
+:type Type
+ * idle noeat
+
+:kw Keyword
+ * idle noeat
+
+:cppkw CppKeyword
+ * idle noeat
diff --git a/.joe/syntax/c.jsf~ b/.joe/syntax/c.jsf~
@@ -1,515 +1,906 @@
-# JOE syntax highlight file for C and C++
+# JOE syntax highlight file for C
# A (deterministic) state machine which performs lexical analysis of C.
# (This is the "assembly language" of syntax highlighting. A separate
# program could be used to convert a regular expression NFA syntax into this
# format).
-# Each state begins with ':<name> <color-name> <context>'
-#
+# Each state begins with ':<name> <color-name>'
# <color-name> is the color used for characters eaten by the state
# (really a symbol for a user definable color).
-#
-# <context> tells JOE if the current character is part of a comment or a string.
-# This allows JOE to skip over comments and strings when matching characters
-# such as parentheses. To use this feature, the -highlighter_context option
-# must be applied to the files highlighted by the corresponding syntax. To
-# apply the option, add it to ftyperc for those file entries.
-#
-# The valid contexts are:
-# comment This character is part of a comment. Example: /* comment */
-#
-# string This character is part of a string. Examples: "string" 'c' 'string'
-#
-# The comment and string delimiters themselves should be marked with the
-# appropriate context. The context is considered to be part of the color, so
-# the recolor=-N and recolormark options apply the context to previous
-# characters.
# The first state defined is the initial state.
# Within a state, define transitions (jumps) to other states. Each
# jump has the form: <character-list> <target-state> [<option>s]
-# There are three ways to specify <character-list>s, either * for any
-# character not otherwise specified, % or & to match the character in the
-# delimiter match buffer or a literal list of characters within quotes
-# (ranges and escape sequences allowed). When the next character matches
-# any in the list, a jump to the target-state is taken and the character is
-# eaten (we advance to the next character of the file to be colored).
+# There are two ways to specify <character-list>s, either * for any
+# character not otherwise specified, or a literal list of characters within
+# quotes (ranges and escape sequences allows). When the next character
+# matches any in the list, a jump to the target-state is taken and the
+# character is eaten (we advance to the next character of the file to be
+# colored).
#
# The * transition should be the first transition specified in the state.
#
# There are several options:
-# noeat do not eat the character, instead feed it to the next state
-# (this tends to make the states smaller, but be careful: you
-# can make infinite loops). 'noeat' implies 'recolor=-1'.
-#
-# recolor=-N Recolor the past N characters with the color of the
-# target-state. For example once /* is recognized as the
-# start of C comment, you want to color the /* with the C
-# comment color with recolor=-2.
-#
-# mark Mark beginning of a region with current position.
+# noeat do not eat the character, instead feed it to the next state
+# (this tends to make the states smaller, but be careful: you
+# can make infinite loops).
#
-# markend Mark end of region.
+# recolor=-N Recolor the past N characters with the color of the
+# target-state. For example once /* is recognized as the
+# start of C comment, you want to color the /* with the C
+# comment color.
#
-# recolormark Recolor all of the characters in the marked region with
-# the color of the target-state. If markend is not given,
-# all of the characters up to the current position are recolored.
-# Note that the marked region can not cross line boundaries and
-# must be on the same line as recolormark.
+# buffer start copying characters to a buffer, beginning with this
+# one (it's ok, to not terminate buffering with a matching
+# 'strings' option- the buffer is limited to leading 19
+# characters).
#
-# buffer start copying characters to a string buffer, beginning with this
-# one (it's ok to not terminate buffering with a matching
-# 'strings' option- the buffer is limited to leading 23
-# characters).
+# strings A list of strings follows. If the buffer matches any of the
+# given strings, a jump to the target-state in the string list
+# is taken instead of the normal jump.
#
-# save_c Save character in delimiter match buffer.
-#
-# save_s Copy string buffer to delimiter match buffer.
-#
-# strings A list of strings follows. If the buffer matches any of the
-# given strings, a jump to the target-state in the string list
-# is taken instead of the normal jump.
-#
-# istrings Same as strings, but case is ignored.
-#
-# Note: strings and istrings should be the last option on the
-# line. They cause any options which follow them to be ignored.
-#
-# hold Stop buffering string- a future 'strings' or 'istrings' will
-# look at contents of buffer at this point. Useful for distinguishing
-# commands and function calls in some languages 'write 7' is a command
-# 'write (' is a function call- hold lets us stop at the space and delay
-# the string lookup until the ( or 7.
+# istrings Same as strings, but case is ignored.
#
# The format of the string list is:
#
-# "string" <target-state> [<options>s]
-# "string" <target-state> [<options>s]
-# "&" <target-state> [<options>s] # matches contents of delimiter match buffer
+# "string" <target-state>
+# "string" <target-state>
# done
#
-# (all of the options above are allowed except "strings", "istrings" and "noeat". noeat is
-# always implied after a matched string).
-#
# Weirdness: only states have colors, not transitions. This means that you
# sometimes have to make dummy states with '* next-state noeat' just to get
# a color specification.
-#
-# Delimiter match buffer is for perl and shell: a regex in perl can be s<..>(...)
-# and in shell you can say: <<EOS ....... EOS
-
-# New feature: subroutines
-#
-# Highlighter state machines can now make subroutine calls. The highlighter has
-# a run-time stack that allows unlimited recursion.
-#
-# To call a subroutine, use the 'call' option:
-#
-# "\"" fred call=string(dquote)
-#
-# The subroutine called 'string' is called and the jump to 'fred' is
-# ignored. The 'dquote' option is passed to the subroutine.
-#
-# The subroutine itself returns to the caller like this:
-# "\"" whatever return
-#
-# If we're in a subroutine, the return is made. Otherwise the jump
-# to 'whatever' is made.
-#
-# There are several ways of delimiting subroutines which show up in how it
-# is called. Here are the options:
-#
-# call=string() A file called string.jsf is the subroutine.
-# The entire file is the subroutine. The starting
-# point is the first state in the file.
-#
-# call=library.string() A file called library.jsf has the subroutine.
-# The subroutine within the file is called string.
-#
-# call=.string() There is a subroutine called string in the current file.
-#
-# When a subroutine is within a file, but is not the whole file, it is delimited
-# as follows:
-#
-# .subr string
-#
-# . . . states for string subroutine . . .
-#
-# .end
-#
-# Option flags can be passed to subroutines which control preprocessor-like
-# directives. For example:
-#
-# .ifdef dquote
-# "\"" idle return
-# .endif
-# .ifdef squote
-# "'" idle return
-# .endif
-#
-# .else if also available. .ifdefs can be nested.
-
-# Obsolete feature: the sync lines specification no longer matter. We now always parse
-# from the beginning of the file. Here is the old description:
-#
# Define no. sync lines
# You can say:
# -200 means 200 lines
# - means always start parsing from beginning of file when we lose sync
# if nothing is specified, the default is -50
--
-
-# Define colors and attributes. Give a list of attributes, one
-# background color and one foreground color (default is used if
-# color is left out).
-#
-# Attributes:
-# bold inverse blink dim underline italic
-#
-# Standard colors:
-#
-# Foreground:
-# white cyan magenta blue yellow green red black
-#
-# Background:
-# bg_white bg_cyan bg_magenta bg_blue bg_yellow bg_green bg_red bg_black
-#
-# For 16 color and 256 color xterms: "export TERM=xterm-16color", these
-# brighter than normal colors are available:
-#
-# Note that you need an xterm which was compiled to support 16 or 256 colors
-# and a matching termcap/terminfo entry for it.
-#
-# Foreground:
-# WHITE CYAN MAGENTA BLUE YELLOW GREEN RED BLACK
-#
-# Background:
-# bg_WHITE bg_CYAN bg_MAGENTA bg_BLUE bg_YELLOW bg_GREEN bg_RED bg_BLACK
-#
-# For 256 color xterm: "export TERM=xterm-256color", these become available:
-#
-# Note that you need an xterm which was compiled to support 256 colors and a
-# matching termcap/terminfo entry for it.
-#
-# fg_RGB and bg_RGB, where R, G, and B range from 0 - 5. So: fg_500 is bright red.
-#
-# fg_NN and bg_NN give shades of grey, where the intensity, NN, ranges from 0 - 23.
-
-=Idle
-=Bad bold red
-=Preproc blue
-=Define bold blue
-=Comment green
-=IncLocal cyan
-=IncSystem bold cyan
-=Constant magenta
-=Escape bold cyan
-=Type white
-=Keyword white
-=CppKeyword white
-=Brace green
-=Control cyan
-
-:reset Idle
- * first noeat
- " \t" reset
-
-:first Idle
- * idle noeat
- "#" pre recolor=-1
-
-:pre Preproc
- * preproc noeat
- " \t" pre
- "a-z" preident recolor=-1 buffer
-
-:preident Preproc
- * preproc noeat strings
- "define" predef
- "include" preinc
+# THIS SETTING IS IGNORED BY Ad-hoc programming editor for DOSBox.
+-3000
+
+
+# Define colors
+#
+# Colors
+# white cyan magenta blue yellow green red black
+# bg_white bg_cyan bg_magenta bg_blue bg_yellow bg_green bg_red bg_black
+# THIS SETTING IS DIFFERENT IN Ad-hoc programming editor for DOSBox.
+# OUR COLORS ARE 8-BIT HEXADECIMAL NUMBERS:
+# IRGBirgb
+# \\\\\\\\_bit 0: blue for foreground
+# \\\\\\\_bit 1: green for foreground
+# \\\\\\_bit 2: red for foreground
+# \\\\\_bit 3: intensity bit for foreground
+# \\\\_bit 4: blue for background
+# \\\_bit 5: green for background
+# \\_bit 6: red for background
+# \_bit 7: intensity bit for background
+# For example, 03 = black background, cyan foreground.
+
+
+
+=Background black / bg_black
+=CPreproc cyan
+=CPreprocKW bold cyan
+=CPreproc_cKW bold cyan
+=CPreproc_sym bold blue
+=CPreprocCComment yellow
+=CPreprocUnknown bold cyan / bg_blue
+=OpenMP green
+=OpenMPkw bold green
+=OpenMPkw2 bold green
+=OpenMPcomment yellow
+=OpenMPnonkw red / bg_green
+=OpenMP_space bold cyan
+=CComment bold red
+=Special cyan
+=Special2 green
+=GlueColor cyan
+=AssignColor bold green
+=Numeric bold blue
+=InvalidNumber bold magenta / bg_red
+=NumericSuffix magenta
+=String bold green
+=StringContent green
+=WString bold blue
+=WStringContent cyan
+=Char bold magenta
+=CharContent magenta
+=WChar bold blue
+=WCharContent cyan
+=AbruptStringTermination bold green / bg_red
+=CKeyword bold white
+=CType bold white
+=STLkw bold white
+=Identifier white
+=Mystery bold green / bg_red
+=TrailingSpace black / bg_cyan
+
+
+########################
+# The rules begin here.
+:newline Background
+ * idle noeat
+ "#" pre_hash recolor=-1
+ " \t" newline_space
+:newline_space Background
+ * newline noeat
+ "\n" trailing_space recolor=-2
+
+:pre_hash CPreprocKW
+ * pre noeat
+:pre CPreproc
+ * preident recolor=-1 buffer
+ "/" pre1_slash recolor=-1
+ " \t" pre
+ "\n" newline
+:preident CPreprocUnknown
+ * preproc noeat strings
+ "define" preproc_known
+ "elif" preproc_known
+ "else" preproc_known
+ "endif" preproc_known
+ "error" preproc_known
+ "if" preproc_known
+ "ifdef" preproc_known
+ "ifndef" preproc_known
+ "include" preproc_known
+ "include_next" preproc_known
+ "line" preproc_known
+ "pragma" preproc_pragma
+ "undef" preproc_known
+ "warning" preproc_known
done
- "a-z" preident
-
-:preinc Preproc
- * preinc
- " \t" preinc_ws
- "\n" reset
-
-:preinc_ws Preproc
- * prebad recolor=-1
- " \t" preinc_ws
- "\"" preinc_local recolor=-1
- "<" preinc_system recolor=-1
-
-:preinc_local IncLocal string
- * preinc_local
- "\"\n" reset
-
-:preinc_system IncSystem string
- * preinc_system
- ">\n" reset
-
-:prebad Bad
- * prebad
- "\n" reset
-
-
-:predef Preproc
- * predef
- " \t" predef_ws
- "\n" reset
-
-:predef_ws Preproc
- * prebad recolor=-1
- " \t" predef_ws
- "\c" predef_ident recolor=-1
-
-:predef_ident Define
- * idle noeat
- "\c" predef_ident
-
-
-:preproc Preproc
- * preproc
- "\n" reset
- "\\" preproc_cont
- "/" preproc_slash
-
-:preproc_slash Preproc
- * preproc noeat
- "*" comment recolor=-2
- "/" line_comment recolor=-2
-
-:preproc_cont Preproc
- * preproc_cont
- "\n" preproc
+ "a-z$0-9A-Z_" preident
+
+# CPreprocessor directives that begin with an actual keyword
+:preproc_known CPreprocKW
+ * preproc noeat
+:preproc CPreproc
+ * preproc
+ " \t" preproc_space
+ "\n" newline
+ "a-z$A-Z_" preproc_ident recolor=-1 buffer
+ "-()?~[]{},;:!<>=+*%&|^" preproc_sym recolor=-1 noeat
+ "/" pre2_slash recolor=-1
+ "\"" pre2_string recolor=-1
+ "'" pre2_char recolor=-1
+ "\\" preproc_cont recolor=-1
+:preproc_space CPreproc
+ * preproc noeat
+ "\n" trailing_space recolor=-2
+:preproc_sym CPreproc_sym
+ * preproc
+:preproc_cont CPreproc_sym
+ * preproc_cont
+ "\n" preproc_newline
+:preproc_newline Background
+ * preproc noeat
+ " \t" preproc_newline_space
+:preproc_newline_space CPreproc
+ * preproc_newline noeat
+ "\n" trailing_space recolor=-2
+:preproc_ident CPreproc
+ * preproc noeat strings
+ "auto" preproc_ident_known
+ "char" preproc_ident_known
+ "const" preproc_ident_known
+ "decltype" preproc_ident_known
+ "double" preproc_ident_known
+ "enum" preproc_ident_known
+ "extern" preproc_ident_known
+ "float" preproc_ident_known
+ "inline" preproc_ident_known
+ "int" preproc_ident_known
+ "long" preproc_ident_known
+ "register" preproc_ident_known
+ "short" preproc_ident_known
+ "signed" preproc_ident_known
+ "static" preproc_ident_known
+ "struct" preproc_ident_known
+ "typedef" preproc_ident_known
+ "union" preproc_ident_known
+ "unsigned" preproc_ident_known
+ "void" preproc_ident_known
+ "volatile" preproc_ident_known
+ "break" preproc_ident_known
+ "case" preproc_ident_known
+ "continue" preproc_ident_known
+ "default" preproc_ident_known
+ "do" preproc_ident_known
+ "else" preproc_ident_known
+ "for" preproc_ident_known
+ "goto" preproc_ident_known
+ "if" preproc_ident_known
+ "return" preproc_ident_known
+ "sizeof" preproc_ident_known
+ "switch" preproc_ident_known
+ "while" preproc_ident_known
+ "bitand" preproc_ident_known #c++
+ "bitor" preproc_ident_known #c++
+ "catch" preproc_ident_known #c++
+ "compl" preproc_ident_known #c++
+ "delete" preproc_ident_known #c++
+ "explicit" preproc_ident_known #c++
+ "export" preproc_ident_known #c++
+ "false" preproc_ident_known #c++
+ "friend" preproc_ident_known #c++
+ "namespace" preproc_ident_known #c++
+ "new" preproc_ident_known #c++
+ "not" preproc_ident_known #c++
+ "not_eq" preproc_ident_known #c++
+ "operator" preproc_ident_known #c++
+ "or" preproc_ident_known #c++
+ "or_eq" preproc_ident_known #c++
+ "private" preproc_ident_known #c++
+ "protected" preproc_ident_known #c++
+ "public" preproc_ident_known #c++
+ "throw" preproc_ident_known #c++
+ "true" preproc_ident_known #c++
+ "try" preproc_ident_known #c++
+ "using" preproc_ident_known #c++
+ "virtual" preproc_ident_known #c++
+ "xor" preproc_ident_known #c++
+ "xor_eq" preproc_ident_known #c++
+done
+ "a-z$A-Z0-9_" preproc_ident
+:preproc_ident_known CPreproc_cKW
+ * preproc noeat
+
+:pre2_slash CPreproc_sym
+ * preproc recolor=-1
+ "*" pre2_comment recolor=-2
+ "/" pre2_line_comment recolor=-2
+:pre2_comment CPreprocCComment
+ * pre2_comment
+ "*" pre2_comment_maybe_end
+:pre2_comment_maybe_end CPreprocCComment
+ * pre2_comment
+ "/" preproc
+ "*" pre2_comment_maybe_end
+:pre2_line_comment CPreprocCComment
+ * pre2_line_comment
+ "\\" pre2_line_comment_escape
+ "\n" newline
+:pre2_line_comment_escape CPreprocCComment
+ * pre2_line_comment
+:pre2_string CPreproc_sym
+ * pre2_string
+ "\"" preproc
+ "\\" pre2_string_escape
+:pre2_string_escape CPreproc_sym
+ * pre2_string
+:pre2_char CPreproc_sym
+ * pre2_char
+ "'" preproc
+ "\\" pre2_char_escape
+:pre2_char_escape CPreproc_sym
+ * pre2_char
+
+# CPreprocessor directives that just begin with #, no keyword
+:pre1_slash CPreprocUnknown
+ * pre recolor=-1
+ "*" pre1_comment recolor=-2
+ "/" pre1_line_comment recolor=-2
+:pre1_comment CPreprocCComment
+ * pre1_comment
+ " " pre1_comment_space
+ "*" pre1_comment_maybe_end
+:pre1_comment_space CPreprocCComment
+ * pre1_comment noeat
+ "\n" pre1_comment_trailing_space recolor=-2
+:pre1_comment_trailing_space TrailingSpace
+ * pre1_comment noeat
+:pre1_comment_maybe_end CPreprocCComment
+ * pre1_comment
+ "/" pre
+ "*" pre1_comment_maybe_end
+:pre1_line_comment CPreprocCComment
+ * pre1_line_comment
+ "\\" pre1_line_comment_escape
+ "\n" newline
+:pre1_line_comment_escape CPreprocCComment
+ * pre1_line_comment
+
+
+# Special care about OpenMP #pragma constructs
+:preproc_pragma CPreprocKW
+ * preproc_pragma0 noeat
+:preproc_pragma0 CPreproc
+ * preproc noeat
+ " " preproc_pragma0
+ "o" openmp1
+:openmp1 CPreproc
+ * preproc noeat
+ "m" openmp2
+:openmp2 CPreproc
+ * preproc noeat
+ "p" openmp3
+:openmp3 CPreproc
+ * preproc noeat
+ " " openmp_keyword_known recolor=-12
+
+:openmp OpenMP
+ * openmp
+ " \t" openmp_space recolor=-1
+ "(" openmp_parens
+ "\\" openmp_cont
+ "a-z_" openmp_keyword recolor=-1 buffer
+ "/" openmp_slash
+ "\n" newline
+:openmp_space OpenMP_space
+ * openmp noeat
+ "\n" trailing_space recolor=-2
+:openmp_slash OpenMP
+ * openmp
+ "*" openmp_comment recolor=-2
+ "/" openmp_line_comment recolor=-2
+:openmp_comment OpenMPcomment
+ * openmp_comment
+ "*" openmp_comment_maybe_end
+:openmp_comment_maybe_end OpenMPcomment
+ * openmp_comment
+ "*" openmp_comment_maybe_end
+ "/" openmp
+:openmp_line_comment OpenMPcomment
+ * openmp_line_comment
+ "\\" openmp_line_comment_escape
+ "\n" newline
+:openmp_line_comment_escape OpenMPcomment
+ * openmp_line_comment
+
+:openmp_parens OpenMP
+ * openmp_parens
+ "\\" openmp_parens_cont
+ "/" openmp_parens_slash
+ ")" openmp
+ "\n" newline
+:openmp_cont OpenMP
+ * openmp
+:openmp_parens_cont OpenMP
+ * openmp_parens
+:openmp_parens_slash OpenMP
+ * openmp_parens noeat
+ "*" openmp_parens_comment recolor=-2
+:openmp_parens_comment OpenMPcomment
+ * openmp_parens_comment
+ "*" openmp_parens_comment_maybe_end
+:openmp_parens_comment_maybe_end OpenMPcomment
+ * openmp_parens_comment
+ "*" openmp_parens_comment_maybe_end
+ "/" openmp_parens
+
+:openmp_keyword OpenMPnonkw
+ * openmp noeat strings
+ "atomic" openmp_keyword_known2
+ "barrier" openmp_keyword_known2
+ "collapse" openmp_keyword_known
+ "copyin" openmp_keyword_known
+ "copyprivate" openmp_keyword_known
+ "critical" openmp_keyword_known2
+ "default" openmp_keyword_known_do_parens
+ "dynamic" openmp_keyword_known_end_parens
+ "firstprivate" openmp_keyword_known
+ "for" openmp_keyword_known2
+ "flush" openmp_keyword_known2
+ "guided" openmp_keyword_known_end_parens
+ "if" openmp_keyword_known
+ "lastprivate" openmp_keyword_known
+ "master" openmp_keyword_known2
+ "nowait" openmp_keyword_known
+ "none" openmp_keyword_known_end_parens
+ "num_threads" openmp_keyword_known
+ "ordered" openmp_keyword_known2
+ "parallel" openmp_keyword_known2
+ "private" openmp_keyword_known_end_parens
+ "reduction" openmp_keyword_known
+ "schedule" openmp_keyword_known_do_parens
+ "section" openmp_keyword_known2
+ "sections" openmp_keyword_known2
+ "shared" openmp_keyword_known_end_parens
+ "single" openmp_keyword_known2
+ "static" openmp_keyword_known_end_parens
+ "task" openmp_keyword_known2
+ "taskwait" openmp_keyword_known
+ "threadprivate" openmp_keyword_known
+ "untied" openmp_keyword_known
+done
+ "a-z0-9A-Z_" openmp_keyword
+:openmp_keyword_known OpenMPkw
+ * openmp noeat
+:openmp_keyword_known2 OpenMPkw2
+ * openmp noeat
+:openmp_keyword_known_do_parens OpenMPkw
+ * openmp noeat
+ "(" openmp_keyword_known_do_parens1 recolor=-1
+:openmp_keyword_known_end_parens OpenMPkw
+ * openmp_keyword_known_end_parens1 noeat
+:openmp_keyword_known_end_parens1 OpenMP
+ * openmp noeat
+ " " openmp_keyword_known_end_parens1
+ "," openmp_parens
+:openmp_keyword_known_do_parens1 OpenMP
+ * openmp_parens noeat
+ "a-z_" openmp_keyword recolor=-1 buffer
# All following states are for when we're not in a preprocessor line
-:idle Idle
- * idle
- "\n" reset
- "0" first_digit recolor=-1
- "1-9" decimal recolor=-1
- "." maybe_float
- "\"" string recolor=-1
- "'" char recolor=-1
- "\i" ident buffer
- "\\" outside_escape recolor=-1
- "{}:,;" brace recolor=-1
- ",=()><[]*&|!~+\-%^\/" control recolor=-1
- "/" slash
-
-
-:outside_escape Escape
- * idle
-
-:brace Brace
- * idle noeat
-
-:control Control
- * idle noeat
-
-:slash Idle
- * idle noeat recolor=-2 # Not sure about this
- "*" comment recolor=-2
- "/" line_comment recolor=-2
-
-:comment Comment comment
- * comment
- "*" maybe_end_comment
-
-:maybe_end_comment Comment comment
- * comment
- "/" idle
- "*" maybe_end_comment
-
-:line_comment Comment comment
- * line_comment
- "\n" reset
-
-:first_digit Constant
- * idle noeat
- "xX" hex
- "." float
- "eE" epart
- "0-7" octal
- "89" bad_number recolor=-1
-
-:bad_number Bad
- * idle noeat
- "0-9" bad_number
-
-:octal Constant
- * idle noeat
- "0-7" octal
- "89" bad_number recolor=-1
-
-:hex Constant
- * idle noeat
- "0-9A-Fa-f" hex
-
-:decimal Constant
- * idle noeat
- "0-9" decimal
- "eE" epart
- "." float
-
-:maybe_float Constant
- * idle recolor=-2 noeat
- "0-9" float recolor=-2
-
-:float Constant
- * idle noeat
- "eE" epart
- "0-9" float
-
-:epart Constant
- * idle noeat
- "0-9+\-" enum
-
-:enum Constant
- * idle noeat
- "0-9" enum
-
-:string Constant string
- * string
- "\"" idle
- "\\" string_escape recolor=-1
- "%" string_control recolor=-1
-
-:string_escape Escape string
- * string
- "x" string_hex
- "0-7" string_octal2
- "\n" string recolor=-2
-
-# \x will consume all successive hex digits (ANSI C).
-:string_hex Escape string
- * string noeat
- "0-9a-fA-F" string_hex
-
-:string_octal2 Escape string
- * string noeat
- "0-7" string_octal3
-
-:string_octal3 Escape string
- * string noeat
- "0-7" string
-
-:string_control Escape string
- * string
- "\"" string noeat
- "\n" reset
- "\\" string_escape recolor=-1
- "0-9.\-+ #hjILtz$" string_control
-
-:char Constant string
- * char
- "\n" reset
- "'" idle
- "\\" char_escape recolor=-1
-
-:char_escape Escape string
- * char
- "x" char_hex
- "0-7" char_octal2
- "\n" char recolor=-2
-
-# \x will consume all successive hex digits (ANSI C).
-:char_hex Escape string
- * char noeat
- "0-9a-fA-F" char_hex
-
-:char_octal2 Escape string
- * char noeat
- "0-7" char_octal3
-
-:char_octal3 Escape string
- * char noeat
- "0-7" char
-
-:ident Idle
- * idle noeat strings
- "int" type
- "float" type
- "long" type
- "short" type
- "char" type
- "double" type
- "signed" type
- "unsigned" type
- "void" type
- "static" type
- "register" type
- "extern" type
- "inline" type
- "auto" type
- "const" type
- "volatile" type
- "if" kw
- "else" kw
- "while" kw
- "for" kw
- "break" kw
- "continue" kw
- "do" kw
- "case" kw
- "default" kw
- "switch" kw
- "goto" kw
- "struct" kw
- "enum" kw
- "return" kw
- "sizeof" kw
- "typedef" kw
- "union" kw
- "asm" kw
-# C++ keywords
- #"asm" cppkw (listed above as a C keyword)
- "bool" cppkw
- "catch" cppkw
- "class" cppkw
- "const_cast" cppkw
- "delete" cppkw
- "dynamic_cast" cppkw
- "explicit" cppkw
- "false" cppkw
- "friend" cppkw
- #"inline" cppkw (listed above as a C keyword)
- "mutable" cppkw
- "namespace" cppkw
- "new" cppkw
- "operator" cppkw
- "private" cppkw
- "protected" cppkw
- "public" cppkw
- "reinterpret_cast" cppkw
- "static_cast" cppkw
- "template" cppkw
- "this" cppkw
- "throw" cppkw
- "true" cppkw
- "try" cppkw
- "typeid" cppkw
- "typename" cppkw
- "using" cppkw
- "virtual" cppkw
- "wchar_t" type
-# Non-Standard
- "typeof" cppkw
+:idle Background
+ * idle_mystery recolor=-1
+ "()?~" special recolor=-1
+ "[]{},;" special2 recolor=-1
+ ":" maybe_glue recolor=-1
+ "!<>" maybe_comp recolor=-1
+ "=" maybe_comp_eq recolor=-1
+ "-+*%&|^" maybe_op_assign recolor=-1
+ " \t" space recolor=-1
+ "/" slash recolor=-1
+ "0" first_digit_0 recolor=-1
+ "1-9" first_digit recolor=-1
+ "." period recolor=-1
+ "\"" stringbegin recolor=-1 noeat
+ "'" charbegin recolor=-1 noeat
+ "a-z$A-Z_" ident recolor=-1 buffer
+ "L" maybe_wide recolor=-1 buffer
+ "\n" newline recolor=-1
+:idle_mystery Mystery
+ * idle noeat
+:space Background
+ * idle noeat
+ "\n" trailing_space recolor=-2
+:trailing_space TrailingSpace
+ * newline noeat
+
+# Delimiters
+:special Special
+ * idle noeat
+:special2 Special2
+ * idle noeat
+:period Special
+ * idle noeat
+ ":" typoed_glue recolor=-2
+ "0-9" float recolor=-2
+:slash Special
+ * idle noeat
+ "*" comment recolor=-2 # "/*"
+ "/" line_comment recolor=-2 # "//"
+ "=" was_op_assign recolor=-2 # "/="
+
+# "::"
+:maybe_glue Special
+ * idle noeat
+ "." typoed_glue recolor=-2
+ ":" was_glue recolor=-2
+:was_glue GlueColor
+ * idle noeat
+
+:typoed_glue InvalidNumber
+ * idle noeat
+
+# "==" vs "="
+:maybe_comp_eq AssignColor
+ * idle noeat
+ "=" was_comp recolor=-2
+# "<=", ">=", "==", "!="
+:maybe_comp Special
+ * idle noeat
+ "=" was_comp recolor=-2
+:was_comp Special
+ * idle noeat
+
+# "+=", "-=", "*=", "/=", "%=", "&=", "|="
+:maybe_op_assign Special
+ * idle noeat
+ "=" was_op_assign recolor=-2
+:was_op_assign AssignColor
+ * idle noeat
+
+
+# CComments
+:comment CComment
+ * comment
+ " " comment_space
+ "*" maybe_end_comment
+:comment_space CComment
+ * comment noeat
+ "\n" comment_trailing_space recolor=-2
+:comment_trailing_space TrailingSpace
+ * comment noeat
+:maybe_end_comment CComment
+ * comment
+ "/" idle
+ "*" maybe_end_comment
+:line_comment CComment
+ * line_comment
+ "\\" line_comment_escape
+ "\n" newline recolor=-1
+:line_comment_escape CComment
+ * line_comment
+
+# Numeric constants
+:first_digit_0 Numeric
+ * first_digit noeat
+ "xX" hex_first
+:first_digit Numeric
+ * number_before_e noeat
+
+:hex_first Numeric
+ * end_number_suffix noeat recolor=-2
+ "0-9A-Fa-f" hex
+ "." hexfloat
+:hex Numeric
+ * end_int noeat
+ "0-9A-Fa-f" hex
+ "." hexfloat
+ "pP" epart
+:hexfloat Numeric
+ * end_number_suffix noeat recolor=-2
+ "0-9A-Fa-f" hexfloat
+ "pP" epart
+:number_before_e Numeric
+ * end_int noeat
+ "0-9" number_before_e
+ "." float
+ "eE" epart
+
+:float Numeric
+ * end_float noeat
+ "eE" epart
+ "0-9" float
+:epart Numeric
+ * enum_first noeat
+ "-+" enum_first
+:enum_first Numeric
+ * end_number_suffix noeat recolor=-2
+ "0-9" enum
+:enum Numeric
+ * end_float noeat
+ "0-9" enum
+:end_float NumericSuffix
+ * end_number_suffix noeat
+ "fFlL" end_number_suffix #f, #l
+:end_int NumericSuffix
+ * end_number_suffix noeat
+ "uU" int_suffix_u #u
+ "lL" int_suffix_l #l
+:int_suffix_u NumericSuffix
+ * end_number_suffix noeat
+ "lL" int_suffix_ul #ul
+:int_suffix_ul NumericSuffix
+ * end_number_suffix noeat
+ "lL" end_number_suffix #ull
+:int_suffix_l NumericSuffix
+ * end_number_suffix noeat
+ "uU" end_number_suffix #lu
+ "lL" int_suffix_ll #ll
+:int_suffix_ll NumericSuffix
+ * end_number_suffix noeat
+ "uU" end_number_suffix #llu
+:end_number_suffix InvalidNumber
+ * idle noeat
+ "a-z$A-Z_0-9" end_number_suffix
+
+# Strings
+:stringbegin String
+ * string
+:stringend String
+ * idle
+
+:string StringContent
+ * string
+ "\"" stringend noeat
+ "\\" string_escape
+ "\n" invalid_string_char_flush recolor=-2
+:string_escape StringContent
+ * string
+ "\n" string
+ "" string_escape_ignore noeat
+:string_escape_ignore Background
+ * string_escape
+
+:wstringbegin WString
+ * wstring
+:wstringend WString
+ * idle
+
+:wstring WStringContent
+ * wstring
+ "\"" wstringend noeat
+ "\\" wstring_escape
+ "\n" invalid_string_char_flush recolor=-2
+:wstring_escape WStringContent
+ * wstring
+ "\n" wstring
+ "" wstring_escape_ignore noeat
+:wstring_escape_ignore Background
+ * wstring_escape
+
+
+# Chars
+:charbegin Char
+ * char
+:charend Char
+ * idle
+
+:char CharContent
+ * char
+ "'" charend noeat
+ "\\" char_escape
+ "\n" invalid_string_char_flush recolor=-2
+:char_escape CharContent
+ * char
+ "\n" char
+:char_escape_ignore Background
+ * char_escape
+
+:wcharbegin WChar
+ * wchar
+:wcharend WChar
+ * idle
+:wchar WCharContent
+ * wchar
+ "'" wcharend noeat
+ "\\" wchar_escape
+ "\n" invalid_string_char_flush recolor=-2
+:wchar_escape WCharContent
+ * wchar
+ "\n" wchar
+:wchar_escape_ignore Background
+ * wchar_escape
+
+
+:maybe_wide Identifier
+ * ident noeat
+ "'" wcharbegin noeat recolor=-2
+ "\"" wstringbegin noeat recolor=-2
+
+
+# This is if a "\n" is met inside a string or char constant.
+# It serves two purposes:
+# Helps getting back in sync
+# Minimizes terminal traffic when entering strings
+:invalid_string_char_flush AbruptStringTermination
+ * newline noeat
+
+# Special identifiers
+:ident Identifier
+ * idle noeat strings
+ "auto" type
+ "char" type
+ "const" type
+ "decltype" type
+ "double" type
+ "enum" type
+ "extern" type
+ "float" type
+ "inline" type
+ "int" type
+ "long" type
+ "register" type
+ "short" type
+ "signed" type
+ "static" type
+ "struct" type
+ "typedef" type
+ "union" type
+ "unsigned" type
+ "void" type
+ "volatile" type
+ "bool" type #c++
+ "class" type #c++
+ "const_cast" type #c++
+ "dynamic_cast" type #c++
+ "mutable" type #c++
+ "reinterpret_cast" type #c++
+ "static_cast" type #c++
+ "template" type #c++
+ "typeid" type #c++
+ "typename" type #c++
+ "wchar_t" type #c++
+ "break" kw
+ "case" kw
+ "continue" kw
+ "default" kw
+ "do" kw
+ "else" kw
+ "for" kw
+ "goto" kw
+ "if" kw
+ "return" kw
+ "sizeof" kw
+ "switch" kw
+ "while" kw
+ "bitand" kw #c++
+ "bitor" kw #c++
+ "catch" kw #c++
+ "compl" kw #c++
+ "delete" kw #c++
+ "explicit" kw #c++
+ "export" kw #c++
+ "false" kw #c++
+ "friend" kw #c++
+ "namespace" kw #c++
+ "new" kw #c++
+ "not" kw #c++
+ "not_eq" kw #c++
+ "operator" kw #c++
+ "or" kw #c++
+ "or_eq" kw #c++
+ "private" kw #c++
+ "protected" kw #c++
+ "public" kw #c++
+ "this" kw #c++
+ "throw" kw #c++
+ "true" kw #c++
+ "try" kw #c++
+ "using" kw #c++
+ "virtual" kw #c++
+ "xor" kw #c++
+ "xor_eq" kw #c++
+ "accumulate" stlkw
+ "adjacent_difference" stlkw
+ "adjacent_find" stlkw
+ "advance" stlkw
+ "allocator" stlkw
+ "auto_ptr" stlkw
+ "back_insert_iterator" stlkw
+ "back_inserter" stlkw
+ "basic_string" stlkw
+ "binary_function" stlkw
+ "binary_negate" stlkw
+ "binary_search" stlkw
+ "bind1st" stlkw
+ "bind2nd" stlkw
+ "binder1st" stlkw
+ "binder2nd" stlkw
+ "bitset" stlkw
+ "complex" stlkw
+ "copy" stlkw
+ "copy_backward" stlkw
+ "count" stlkw
+ "count_if" stlkw
+ "deque" stlkw
+ "distance" stlkw
+ "distance_type" stlkw
+ "divides" stlkw
+ "equal" stlkw
+ "equal_range" stlkw
+ "equal_to" stlkw
+ "exception" stlkw
+ "fill" stlkw
+ "fill_n" stlkw
+ "find" stlkw
+ "find_end" stlkw
+ "find_first_of" stlkw
+ "find_if" stlkw
+ "for_each" stlkw
+ "front_insert_iterator" stlkw
+ "front_inserter" stlkw
+ "generate" stlkw
+ "generate_n" stlkw
+ "get_temporary_buffer" stlkw
+ "greater" stlkw
+ "greater_equal" stlkw
+ "includes" stlkw
+ "inner_product" stlkw
+ "inplace_merge" stlkw
+ "insert_iterator" stlkw
+ "inserter" stlkw
+ "istream_iterator" stlkw
+ "iter_swap" stlkw
+ "iterator_category" stlkw
+ "less" stlkw
+ "less_equal" stlkw
+ "lexicographical_compare" stlkw
+ "limits" stlkw
+ "list" stlkw
+ "logical_and" stlkw
+ "logical_not" stlkw
+ "logical_or" stlkw
+ "lower_bound" stlkw
+ "make_heap" stlkw
+ "map" stlkw
+ "max" stlkw
+ "max_element" stlkw
+ "merge" stlkw
+ "min" stlkw
+ "min_element" stlkw
+ "minus" stlkw
+ "mismatch" stlkw
+ "modulus" stlkw
+ "move" stlkw
+ "multimap" stlkw
+ "multiset" stlkw
+ "negate" stlkw
+ "next_permutation" stlkw
+ "not1" stlkw
+ "not2" stlkw
+ "not_equal_to" stlkw
+ "nth_element" stlkw
+ "numeric_limits" stlkw
+ "ostream_iterator" stlkw
+ "pair" stlkw
+ "partial_sort" stlkw
+ "partial_sort_copy" stlkw
+ "partial_sum" stlkw
+ "partition" stlkw
+ "permutation" stlkw
+ "plus" stlkw
+ "pointer_to_binary_function" stlkw
+ "pointer_to_unary_function" stlkw
+ "pop_heap" stlkw
+ "prev_permutation" stlkw
+ "priority_queue" stlkw
+ "ptr_fun" stlkw
+ "push_heap" stlkw
+ "queue" stlkw
+ "random_shuffle" stlkw
+ "raw_storage_iterator" stlkw
+ "remove" stlkw
+ "remove_copy" stlkw
+ "remove_copy_if" stlkw
+ "remove_if" stlkw
+ "replace" stlkw
+ "replace_copy" stlkw
+ "replace_copy_if" stlkw
+ "replace_if" stlkw
+ "return_temporary_buffer" stlkw
+ "reverse" stlkw
+ "reverse_bidirectional_iterator" stlkw
+ "reverse_copy" stlkw
+ "reverse_iterator" stlkw
+ "rotate" stlkw
+ "rotate_copy" stlkw
+ "search" stlkw
+ "search_n" stlkw
+ "set" stlkw
+ "set_difference" stlkw
+ "set_intersection" stlkw
+ "set_symmetric_difference" stlkw
+ "set_union" stlkw
+ "sort" stlkw
+ "sort_heap" stlkw
+ "stable_partition" stlkw
+ "stable_sort" stlkw
+ "stack" stlkw
+ "string" stlkw
+ "string_char_traits" stlkw
+ "swap" stlkw
+ "swap_ranges" stlkw
+ "times" stlkw
+ "transform" stlkw
+ "unary_function" stlkw
+ "unary_negate" stlkw
+ "uninitialized_copy" stlkw
+ "uninitialized_fill" stlkw
+ "uninitialized_fill_n" stlkw
+ "unique" stlkw
+ "unique_copy" stlkw
+ "upper_bound" stlkw
+ "value_type" stlkw
+ "vector" stlkw
+ "wstring" stlkw
+ "std" stlkw
+ "iterator" stlkw
+ "const_iterator" stlkw
+ "const_reverse_iterator" stlkw
done
- "\c" ident
+ "a-z$A-Z0-9_" ident
+
-:type Type
- * idle noeat
-:kw Keyword
- * idle noeat
-:cppkw CppKeyword
- * idle noeat
+:type CType
+ * idle noeat
+:kw CKeyword
+ * idle noeat
+:stlkw STLkw
+ * idle noeat
+ ":" stlkw_colon recolor=-1
+:stlkw_colon InvalidNumber
+ * idle noeat
+ ":" was_glue recolor=-2