-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parser #2
Open
dem4ron
wants to merge
1
commit into
exercism:main
Choose a base branch
from
dem4ron:add-parser
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add parser #2
+33
−1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the help! I don't fully understand this change. If I run bun prepare
and then check what dist/index.js
's content is, it looks like this:
import { LRParser } from '@lezer/lr';
import { LRLanguage, indentNodeProp, delimitedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language';
import { styleTags, tags } from '@lezer/highlight';
// This file was generated by lezer-generator. You probably shouldn't edit it.
const parser = LRParser.deserialize({
version: 14,
states: "%^QYQPOOO#RQPO'#C_O#YQPO'#C_O#aQPO'#CqOOQO'#Ca'#CaOOQO'#C|'#C|O$eQPO'#CgOOQO'#Cr'#CrO$oQPO'#CiOOQO'#Cq'#CqOOQO'#Ck'#CkQYQPOOO$tQPO'#ClO%{QPO,58yOOQO,58y,58yO&SQPO,58yO!WQPO'#CmO&ZQPO,58yO'hQPO,59ROOQO,59R,59RO'hQPO,59RO'oQPO,59TOOQO-E6i-E6iOOQO-E6j-E6jOOQO1G.e1G.eOOQO,59X,59XOOQO-E6k-E6kOOQO1G.m1G.mO'vQPO1G.mO'}QPO1G.oO!WQPO1G.oOOQO7+$X7+$XO)RQPO7+$Z",
stateData: "*_~OdOSPOS~OSVOUTOVTOWTOXTOYVO^WOgPOiQOlSOmSOnSOoSOrUO~OSVOUTOVTOWTOXTOYVOgPOiQOlSOmSOnSOoSOrUO~Oh^O~P!WOj^O~P!WOk`OSeXUeXVeXWeXXeXYeX^eXbeXgeXieXleXmeXneXoeXreX~O[dOqcO~P!WOseO~Ok`OS`XU`XV`XW`XX`XY`Xg`Xh`Xi`Xl`Xm`Xn`Xo`Xr`Xj`Xq`X~OhhO~P!WOjhO~P!WOk`OSRaURaVRaWRaXRaYRa^RabRagRaiRalRamRanRaoRarRahRajRaqRa~OqkO~P!WO[nO~P!WOqoO~P!WOk`OS]iU]iV]iW]iX]iY]i^]ib]ig]ii]il]im]in]io]ir]i~Ok`OS]qU]qV]qW]qX]qY]q^]qb]qg]qi]ql]qm]qn]qo]qr]q~O^[WVUYV~",
goto: "#eqPPPrPrPPPPPrP!RP!V!]!oPPP!x!|PPPPPPPPPrkVOPQUZ]_`bdelnTXOZQZORfZQ]PQ_QQbUWg]_blRldWaR[mpRjaTYOZSROZ`[PQU]_bdlQi`QmeRpn",
nodeNames: "⚠ LineComment Program Array String Char Integer Floating Fraction SpecialNumber Glyph Inline Signature Binding Identifier",
maxTerm: 35,
skippedNodes: [0,1],
repeatNodeCount: 3,
tokenData: "6]~R$OX^*Rpq*Rrs*vtu,dxy-_yz-d{|-i}!O-i!O!P-i!P!Q-i!Q![-n![!]-i!]!^/e!^!_-i!_!`-i!`!a-i!a!b-i!b!c/|!c!}4O!}#O4o#P#Q4t#R#S4y#T#o4O#o#p5O#p#q5T#q#r5t#y#z*R$f$g*R$j$k-i$r$s-i$u$v5y$v$w-i$w$x-i%o%p-i&a&b-i0z0{-i5o5p6R5x5y6R5|5}6R#BY#BZ*R$IS$I_*R$Im$In-i$I|$JO*R$JT$JU*R$Jk$Jl-i$KV$KW*R$Kw$Kx-i$Lc$Ld-i$Np$Nq-i%#t%#u6W%#|%#}-i%#}%$O-i%$Z%$[-i%$]%$^-i%$e%$f-i%$q%$r-i%%S%%T-i%%i%%j-i%&[%&]-i%&b%&c-i%&d%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.k~.vP!Q![.k~.|R{|/V}!O/V!Q![/]~/YP!Q![/]~/bPU~!Q![/]~/jSP~OY/eZ;'S/e;'S;=`/v<%lO/e~/yP;=`<%l/e~0PTO#O0`#O#P0e#P;'S0`;'S;=`3v;=`O0`~0eOo~~0jZo~!Q!R1]#O#P1]#U#V1]#Y#Z1]#b#c1]#f#g1]#g#h1]#h#i1]#i#j1b#j#k1]#l#m3X~1bOn~~1eS!Q![1q!c!i1q#T#Z1q#o#p2l~1tR!Q![1}!c!i1}#T#Z1}~2QR!Q![2Z!c!i2Z#T#Z2Z~2^R!Q![2g!c!i2g#T#Z2g~2lOm~~2oR!Q![2x!c!i2x#T#Z2x~2{S!Q![2x!c!i2x#T#Z2x#q#r2g~3[R!Q![3e!c!i3e#T#Z3e~3hR!Q![3q!c!i3q#T#Z3q~3vOl~~3{Po~;=`<%l0`~4TR^~!c!}4O#R#S4^#T#o4O~4aQ!Q![4g#R#S4^~4lP^~!Q![4g~4tOg~~4yOh~~5OOk~~5TOi~~5WP!Q![5Z~5`Q[~!O!P5f!Q![5Z~5iP!Q![5l~5qP[~!Q![5l~5yOj~~6OPY~!Q![-n~6WOX~~6]Os~",
tokenizers: [0],
topRules: {"Program":[0,2]},
tokenPrec: 421
});
const uiuaLanguage = LRLanguage.define({
name: "uiua",
parser: parser.configure({
props: [
indentNodeProp.add({
Application: delimitedIndent({ closing: ")", align: false }),
}),
foldNodeProp.add({
Application: foldInside,
}),
styleTags({
String: tags.string,
LineComment: tags.lineComment,
Char: tags.character,
"Integer SpecialNumber": tags.number,
"Floating Fraction": tags.float,
"( )": tags.paren,
"[ ]": tags.squareBracket,
"{ }": tags.brace,
Escape: tags.escape,
Identifier: tags.function(tags.definition(tags.variableName)),
Signature: tags.meta,
Glyph: tags.atom,
}),
],
}),
languageData: {
commentTokens: { line: ";" },
},
});
function uiua() {
return new LanguageSupport(uiuaLanguage);
}
export { uiua, uiuaLanguage };
Isn't that correct? And how does this PR fix that?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.