Skip to content

Commit

Permalink
Dart: Added missing keywords (#2355)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaiJingLong authored May 6, 2020
1 parent 10ca643 commit 4172ab6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions components/prism-dart.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 4172ab6

Please sign in to comment.