mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
RGL Browser: proper syntax highlighting for GF
This commit is contained in:
15
lib/doc/browse/google-code-prettify/lang-gf.js
Normal file
15
lib/doc/browse/google-code-prettify/lang-gf.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
GF language
|
||||
Customised from lang-hs.js (Haskell)
|
||||
*/
|
||||
PR.registerLangHandler(PR.createSimpleLexer([
|
||||
["pln", /^[\t-\r ]+/, null, "\t\n\r "],
|
||||
["str", /^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/, null, '"'],
|
||||
// ["str", /^'(?:[^\n\f\r'\\]|\\[^&])'?/, null, "'"],
|
||||
["lit", /^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i, null, "0123456789"]
|
||||
], [
|
||||
["com", /^(?:--[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],
|
||||
["kwd", /^(?:abstract|case|cat|concrete|data|def|flags|fun|in|incomplete|instance|interface|let|lin|lincat|lindef|of|open|oper|param|pre|printname|resource|strs|table|transfer|variants|where|with)(?=[^\d'A-Za-z_]|$)/, null],
|
||||
["pln", /^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],
|
||||
["pun", /^[^\d\t-\r "'A-Za-z]+/]
|
||||
]), ["gf"]);
|
||||
Reference in New Issue
Block a user