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

Update for dart keyword. #2355

Merged
merged 4 commits into from May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/prism-dart.js
Expand Up @@ -11,7 +11,7 @@ Prism.languages.dart = Prism.languages.extend('clike', {
],
'keyword': [
/\b(?:async|sync|yield)\*/,
/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|default|deferred|do|dynamic|else|enum|export|external|extends|factory|final|finally|for|get|if|implements|import|in|library|new|null|operator|part|rethrow|return|set|static|super|switch|this|throw|try|typedef|var|void|while|with|yield)\b/
/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extension|external|extends|factory|final|finally|for|Function|get|hide|if|implements|interface|import|in|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/
],
'operator': /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/
});
Expand All @@ -21,4 +21,4 @@ Prism.languages.insertBefore('dart','function',{
pattern: /@\w+/,
alias: 'symbol'
}
});
});
2 changes: 1 addition & 1 deletion components/prism-dart.min.js

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

31 changes: 18 additions & 13 deletions tests/languages/dart/keyword_feature.test
Expand Up @@ -3,19 +3,22 @@ abstract assert async await
break case catch
class;
const
continue default deferred
continue covariant default deferred
do dynamic else enum
export external
export extension external
extends;
factory final finally for
get if
factory final finally for Function
get hide if
implements;
interface;
import
in library
in
library
mixin
new;
null
operator part rethrow return
set static super switch this
on operator part rethrow return
set show static super switch sync this
throw try typedef var
void while with yield

Expand All @@ -27,19 +30,21 @@ void while with yield
["keyword", "break"], ["keyword", "case"], ["keyword", "catch"],
["keyword", "class"], ["punctuation", ";"],
["keyword", "const"],
["keyword", "continue"], ["keyword", "default"], ["keyword", "deferred"],
["keyword", "continue"], ["keyword", "covariant"], ["keyword", "default"], ["keyword", "deferred"],
["keyword", "do"], ["keyword", "dynamic"], ["keyword", "else"], ["keyword", "enum"],
["keyword", "export"], ["keyword", "external"],
["keyword", "export"], ["keyword", "extension"], ["keyword", "external"],
["keyword", "extends"], ["punctuation", ";"],
["keyword", "factory"], ["keyword", "final"], ["keyword", "finally"], ["keyword", "for"],
["keyword", "get"], ["keyword", "if"],
["keyword", "factory"], ["keyword", "final"], ["keyword", "finally"], ["keyword", "for"], ["keyword", "Function"],
["keyword", "get"], ["keyword", "hide"], ["keyword", "if"],
["keyword", "implements"], ["punctuation", ";"],
["keyword", "interface"], ["punctuation", ";"],
["keyword", "import"],
["keyword", "in"], ["keyword", "library"],
["keyword", "mixin"],
["keyword", "new"], ["punctuation", ";"],
["keyword", "null"],
["keyword", "operator"], ["keyword", "part"], ["keyword", "rethrow"], ["keyword", "return"],
["keyword", "set"], ["keyword", "static"], ["keyword", "super"], ["keyword", "switch"], ["keyword", "this"],
["keyword", "on"], ["keyword", "operator"], ["keyword", "part"], ["keyword", "rethrow"], ["keyword", "return"],
["keyword", "set"], ["keyword", "show"], ["keyword", "static"], ["keyword", "super"], ["keyword", "switch"], ["keyword", "sync"], ["keyword", "this"],
["keyword", "throw"], ["keyword", "try"], ["keyword", "typedef"], ["keyword", "var"],
["keyword", "void"], ["keyword", "while"], ["keyword", "with"], ["keyword", "yield"]
]
Expand Down