Idris: add Idris 2 keywords, builtins, pragmas, and string interpolation#4063
Open
bio-aeon wants to merge 1 commit intoPrismJS:v2from
Open
Idris: add Idris 2 keywords, builtins, pragmas, and string interpolation#4063bio-aeon wants to merge 1 commit intoPrismJS:v2from
bio-aeon wants to merge 1 commit intoPrismJS:v2from
Conversation
✅ Deploy Preview for dev-prismjs-com ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or 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
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.
Closes #4062.
Brings the Idris grammar up to date with Idris 2 while keeping Idris 1 keywords for backward compatibility.
Changes:
auto,autobind,covering,default,failing,forall,open,prefix,typebind), cross-referenced with the Idris 2 lexer. Kept all existing Idris 1 keywords so older code still highlights.Typefromkeywordtobuiltinand populated the builtin token with common Idris types (Type,Int,Integer,Nat,Double,String,Char,Bool,List,Maybe,IO,Unit,Void).pragmatoken (/%\w+/) for%default,%inline,%foreign, etc. Usesalias: 'keyword'so pragmas pick up keyword styling with no theme changes.\{expr}string interpolation. This meant overriding the inherited Haskell string pattern - used/"(?:[^\\"]|\\[\s\S])*"/so multiline gap strings still work.Tests:
keyword_feature.test- updated with full keyword list (Idris 1 + 2)string_feature.test- updated expected format (strings now haveinside, so content is array-wrapped)builtin_feature.test- newpragma_feature.test- newinterpolation_feature.test- new