[highlightjs] Add virtual method keywords. (#1377)

This also tidies up the keyword detection for classes a bit so we won't
highlight bizarre things like `allyourbase class`, or `base classy` etc.
This commit is contained in:
Chandler Carruth authored and GitHub committed 2022-07-10 00:05:51 -07:00
1 parent 0ed6600615
commit b4d4f5423d
2 files changed
+9 -5

No files matched your search

+6 -2
View File
@@ -49,8 +49,12 @@ interface WidgetI {
constraint WidgetC {
}
abstract class Abstract {
abstract fn DoSomething[me: Self]();
}
base class Widget {
fn Print[addr me: Self*](var i: i64, x: f32 = 4.2, _: bool);
virtual fn Print[addr me: Self*](var i: i64, x: f32 = 4.2, _: bool);
}
fn Widget.Print[addr me: Self*](var i: i64, x: f32, _: bool, 47) {
@@ -68,7 +72,7 @@ fn Widget.Print[addr me: Self*](var i: i64, x: f32, _: bool, 47) {
}
class FancyWidget(T:! Type) extends Widget {
fn Print[me: Self]();
impl fn Print[me: Self]();
impl as Add(T) {
fn Op[me: Self]();