URL highlighting with inline CM

This commit is contained in:
Gregory Schier
2023-02-28 11:26:26 -08:00
parent e57e7bcec5
commit d77ed0c5cc
11 changed files with 266 additions and 36 deletions

View File

@@ -0,0 +1,30 @@
@top url { Protocol Host Path Query }
Protocol {
ProtocolName Slashy
}
Path {
(Slash PathSegment)*
}
Query {
Question (QueryPair)*
}
QueryPair {
Amp? QueryName Equal QueryValue
}
@tokens {
ProtocolName { "http" | "https" }
Host { $[a-zA-Z0-9-_.]+ }
QueryName { $[a-zA-Z0-9-_.]+ }
QueryValue { $[a-zA-Z0-9-_.]+ }
PathSegment { $[a-zA-Z0-9-_.]+ }
Slashy { "://" }
Slash { "/" }
Question { "?" }
Equal { "=" }
Amp { "&" }
}