diff options
author | thatch <devnull@localhost> | 2009-09-18 18:59:58 -0700 |
---|---|---|
committer | thatch <devnull@localhost> | 2009-09-18 18:59:58 -0700 |
commit | b6b647accb2bc7d80e5c340a47daeb72a359e2ec (patch) | |
tree | e2788379d8cab0fa5b900d54a802890e4165fb89 | |
parent | a9169767d5ef0ca94ccb3406da2f743fdd5ac562 (diff) | |
download | pygments-b6b647accb2bc7d80e5c340a47daeb72a359e2ec.tar.gz |
Add example file for !CMake
-rw-r--r-- | pygments/lexers/text.py | 1 | ||||
-rw-r--r-- | tests/examplefiles/main.cmake | 42 |
2 files changed, 42 insertions, 1 deletions
diff --git a/pygments/lexers/text.py b/pygments/lexers/text.py index 75be58ba..7a35c991 100644 --- a/pygments/lexers/text.py +++ b/pygments/lexers/text.py @@ -1554,7 +1554,6 @@ class CMakeLexer(RegexLexer): (r'\(', Punctuation, '#push'), (r'\)', Punctuation, '#pop'), (r'(\${)(.+?)(})', bygroups(Operator, Name.Variable, Operator)), - (r'$\w+', Name.Variable), (r'(?s)".*?"', String.Double), (r'\\\S+', String), (r'[^\)$"# \t\n]+', String), diff --git a/tests/examplefiles/main.cmake b/tests/examplefiles/main.cmake new file mode 100644 index 00000000..dac3da43 --- /dev/null +++ b/tests/examplefiles/main.cmake @@ -0,0 +1,42 @@ +SET( SOURCES back.c io.c main.c ) +MESSAGE( ${SOURCES} ) # three arguments, prints "back.cio.cmain.c" +MESSAGE( "${SOURCES}" ) # one argument, prints "back.c;io.c;main.c" +MESSAGE( "" ) # one argument, prints "" an empty line +MESSAGE( "${EMPTY_STRING}" ) # one argument, prints "" an empty line +MESSAGE( ${EMPTY_STRING} ) # zero arguments, causes CMake Error + # "MESSAGE called with incorrect number of arguments" +MESSAGE( \\\"\ \(\)\#\$\^ ) # this message contains literal characters + +MESSAGE( "This is practice." ) # prints "This is practice." +MESSAGE( "This;is;practice." ) # prints "This;is;practice." +MESSAGE( "Hi. ) MESSAGE( x )" ) # prints "Hi. ) MESSAGE( x )" + +MESSAGE( "Welc"ome ) # rule 1 +MESSAGE( Welc"ome" ) # rule 3 +MESSAGE( Welc"ome)" ) # rule 2 +MESSAGE( ""Thanks ) # rule 1 +MESSAGE( Thanks"" ) # rule 3 + +SET( x y A B C ) # stores "y;A;B;C" in x (without quote) +SET( ${x} ) # => SET( y;A;B;C ) => SET( y A B C) +MESSAGE( ${y} ) # prints "ABC" to stdout (without quotes) +SET( y x ) # stores "x" in y (without quotes) +SET( ${y} y = x ) # => SET( x y ) +MESSAGE( "\${x} = '${x}'" ) # prints "${x} = 'y;=;x'" to stdout (without quotes) +SET( y ${x} ) # => SET( y y = x ) => stores "y;=;x" in y (without quotes) +MESSAGE( ${y} ) # prints "y=x" to stdout (without quotes) + +SET( x a b c ) # stores "a;b;c" in x (without quotes) +SET( y "a b c" ) # stores "a b c" in y (without quotes) +MESSAGE( a b c ) # prints "abc" to stdout (without quotes) +MESSAGE( ${x} ) # prints "abc" to stdout (without quotes) +MESSAGE("${x}") # prints "a;b;c" to stdout (without quotes) +MESSAGE( ${y} ) # prints "a b c" to stdout (without quotes) +MESSAGE("${y}") # prints "a b c" to stdout (without quotes) + +# This is a comment. +COMMAND( arguments go here ) +ANOTHER_COMMAND() # this command has no arguments +YET_ANOTHER_COMMAND( these + arguments are spread # another comment + over several lines ) |