summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pygments/lexers/agile.py3
-rw-r--r--tests/examplefiles/example_file.fy16
2 files changed, 18 insertions, 1 deletions
diff --git a/pygments/lexers/agile.py b/pygments/lexers/agile.py
index 06226f24..9bd353be 100644
--- a/pygments/lexers/agile.py
+++ b/pygments/lexers/agile.py
@@ -1999,7 +1999,7 @@ class FancyLexer(RegexLexer):
# Comments
(r'#(.*?)\n', Comment.Single),
# Symbols
- (r'\'[^\'\s]+', String.Symbol),
+ (r'\'([^\'\s\[\]\(\)\{\}]+|\[\])', String.Symbol),
# Multi-line DoubleQuotedString
(r'"""(\\\\|\\"|[^"])*"""', String),
# DoubleQuotedString
@@ -2022,6 +2022,7 @@ class FancyLexer(RegexLexer):
('[A-Z][a-zA-Z0-9_]*', Name.Constant),
('@[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable.Instance),
('@@[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable.Class),
+ ('(@|@@)', Operator),
('[a-zA-Z_][a-zA-Z0-9_]*', Name),
# numbers - / checks are necessary to avoid mismarking regexes,
# see comment in RubyLexer
diff --git a/tests/examplefiles/example_file.fy b/tests/examplefiles/example_file.fy
index 12b3d969..43e80c1d 100644
--- a/tests/examplefiles/example_file.fy
+++ b/tests/examplefiles/example_file.fy
@@ -110,3 +110,19 @@ pm match_with_extract: "Hello : World!"
[3, 2, 1] reverse() each() |a| { puts(a) }
"Hello" sub("ll", "y") println
[3, 2, 1] map() |a| { a * 2 } inject(0) |s i| { s + i } println
+
+# test symbol highlighting
+['foo]
+['foo?!]
+{'foo}
+{'foo!?}
+{'foo:bar?!=&/:}
+('foo)
+
+# future sends
+42 @ to_s class println
+42 @ to_s: 16 . value println
+
+# async sends
+42 @@ println
+42 @@ upto: 100