! Syntax Highlighting Patterns for R ! Contributed by Korbinian Strimmer (korbinian.strimmer@zoo.ox.ac.uk) ! Version 1.0 (Sept. 24, 2001) ! ! In NEdit Version 5.0.1 and beyond, load this pattern by starting nedit with: ! ! nedit -import ! ! Then, check that the patterns were loaded correctly, and choose Save Defaults ! from the Preferences menu. The new patterns will now be incorporated into ! your own .nedit file, so the next time you start NEdit, you will no longer ! need to use -import. ! ! In version 5.0, without -import, you must edit your .nedit file by hand and ! add the contents of each resource below to the corresponding list in your ! .nedit file. Be sure to separate new entries with \n, and continue resource ! strings by escaping all newlines within a resource value with \ (backslash), ! leaving only the last line of the resource value not ending in \. ! nedit.highlightPatterns: \ R:1:0 {\n\ comment:\"#\":\"$\"::Text Comment::\n\ string:\"\"\"\":\"\"\"\":\"\\n\":String::\n\ single quote:"'":"'"::String::\n\ numeric const:"<((([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)>":::Numeric Const::\n\ R identifiers 1:"<(for|while|if|else|break|repeat|next|switch|function|in|return)>":::Identifier::\n\ R identifiers 2:"<(\\.\\.\\.|\\.\\.1|\\.\\.2|\\.\\.3)>":::Identifier::\n\ R constants:\"<(TRUE|FALSE|NA|Inf|NaN|NULL)>\":::Text Key::\n\ brackets:"[][]":::Keyword::D\n\ braces:\"[{}]\":::Keyword::D\n\ parentheses:"[()]":::Keyword::D\n\ equality operator:"==":::Text Arg2::D\n\ assignment operators:"=|\\<-|-\\>":::Keyword::D\n\ formula operator:"~":::Keyword::D\n\ other operators:":|\\$|%":::Keyword::D\n\ arithmetic operators:"\\+|-|/|\\*|\\^":::Keyword::D\n\ comparison operators:"\\<=|\\>=|\\<|\\>|!=":::Text Arg2::D\n\ logical operators:"!|&|\\|":::Text Arg2::D\n\ } nedit.languageModes:\ R:.r .R::::::\".,/\\`'!|@#%^&*()-=+{}[]\"\":;<>?~\"\n\