Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# operator and punctuation changes #1532

Merged
merged 2 commits into from
Dec 1, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added :: operator and added punctuation test
RunDevelopment committed Nov 26, 2018
commit 8ef998e969f59acff30ac539fab877d4514ae359
4 changes: 2 additions & 2 deletions components/prism-csharp.js
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ Prism.languages.csharp = Prism.languages.extend('clike', {
],
'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)f?/i,
'operator': />>=?|<<=?|[-=]>|([-+&|?])\1|~|[-+*/%&|^!=<>]=?/,
'punctuation': /\?[?.]?|[{}[\];(),.:]/
'punctuation': /\?\.?|::|[{}[\];(),.:]/
});

Prism.languages.insertBefore('csharp', 'class-name', {
@@ -78,4 +78,4 @@ Prism.languages.insertBefore('csharp', 'class-name', {
}
});

Prism.languages.dotnet = Prism.languages.csharp;
Prism.languages.dotnet = Prism.languages.csharp;
2 changes: 1 addition & 1 deletion components/prism-csharp.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions tests/languages/csharp/operator_feature.test
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
! && ||
-> =>
= == != < > <= >=
??

----------------------------------------------------

@@ -49,9 +50,11 @@
["operator", "<"],
["operator", ">"],
["operator", "<="],
["operator", ">="]
["operator", ">="],

["operator", "??"]
]

----------------------------------------------------

Checks for all operators.
Checks for all operators.
27 changes: 27 additions & 0 deletions tests/languages/csharp/punctuation_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
. , ; : ::
? ?.
[ ] { } ( )

----------------------------------------------------

[
["punctuation", "."],
["punctuation", ","],
["punctuation", ";"],
["punctuation", ":"],
["punctuation", "::"],

["punctuation", "?"],
["punctuation", "?."],

["punctuation", "["],
["punctuation", "]"],
["punctuation", "{"],
["punctuation", "}"],
["punctuation", "("],
["punctuation", ")"]
]

----------------------------------------------------

Checks for punctuation.