1
0
Fork 0
mirror of https://github.com/kou029w/quot.git synced 2025-01-31 14:28:06 +00:00

Compare commits

...

4 commits

Author SHA1 Message Date
ad1e6ba9e4 refactor syntax 2022-09-17 17:04:18 +09:00
eaab4dad30 fixed broken indent 2022-09-17 16:38:47 +09:00
0a02a259c3 fixed syntax 2022-09-17 16:38:41 +09:00
ec7357ee20 fixed cursor color 2022-09-17 15:44:34 +09:00
4 changed files with 16 additions and 22 deletions

View file

@ -1,15 +1,13 @@
@top Document { heading line* }
heading { Heading "\n" }
line { Indent* (AutoLink | Word) (AutoLink | Word | Spaces)* "\n" }
heading { Heading? "\n" }
line { Indent* ((AutoLink | word) space*)* "\n" }
@tokens {
space { $[ \t] }
letter { ![ \t\n]+ }
Heading { letter+ }
word { ![ \t\n]+ }
Heading { ![\n]+ }
Indent { space }
Spaces { space+ }
AutoLink { ("http" | "https") "://" letter+ }
Word { letter+ }
@precedence { AutoLink, Word }
AutoLink { ("http" | "https") "://" word }
@precedence { AutoLink, word }
}

View file

@ -2,15 +2,15 @@
import {LRParser} from "@lezer/lr"
export const parser = LRParser.deserialize({
version: 14,
states: "#`OQOPOOOVOPOOQ[OQOOOOOO'#Cd'#CdOgOQO'#ChOrOSO'#ChOOOO'#Cc'#CcQ[OQOOOOOO-E6b-E6bO!QOSO,59SOOOO'#Ce'#CeO!QOSO,59SOOOO,59S,59SOOOO-E6a-E6aO!`OSO1G.nOOOO1G.n1G.nOOOO-E6c-E6cOOOO7+$Y7+$Y",
stateData: "!q~OQPO~OZQO~ORROSTOTTO~ORROSXOTXO~OSYOTYOUYOZ[O~OSYOTYOUYOZ_O~OSYOTYOUYOZaO~OST~",
goto: "y]PPPPPPP^dkPPuQVQR]VSSQVRWSQZTQ^XT`Z^TUQV",
nodeNames: "⚠ Document Heading Indent AutoLink Word Spaces",
maxTerm: 12,
states: "#rOQOPOOOOOO'#Cf'#CfOYOPO'#CfQ_OQOOOOOO,59Q,59QOOOO'#Cb'#CbOmOQO'#ChO{OSO'#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k!P!Q%z!Q~kV&RVQP]UOXkXY!RZpkpq!Rq!Pk!P!Q&h!Q~kV&oTQP]UOX'OXY!RZp'Opq!Rq~'OV'XTQPSU]UOX'OXY!RZp'Opq!Rq~'OV'oVQP]UOXkXY!RZpkpq!Rq![k![!]%^!]~k",
tokenizers: [0, 1, 2],
topRules: {"Document":[0,1]},
tokenPrec: 76
tokenPrec: 82
})

View file

@ -13,7 +13,6 @@ export const quotLanguage = LRLanguage.define({
Heading: t.heading,
Indent: t.separator,
AutoLink: t.link,
Spaces: t.content,
}),
],
}),
@ -35,8 +34,5 @@ export const quotHighlighting = syntaxHighlighting(
tag: t.link,
class: "auto-link",
},
{
tag: t.content,
},
])
);

View file

@ -18,8 +18,8 @@
font-size: 1rem;
}
.editor .cm-line {
display: flex;
.editor .cm-cursor {
border-left-color: var(--nc-tx-1);
}
.editor .auto-link:hover {