1
1
mirror of https://github.com/anoma/juvix.git synced 2025-01-05 22:46:08 +03:00

Add pragma face (#2312)

This pr assigns pragmas their own face, as opposed to the same face as
regular comments.
This commit is contained in:
Jan Mas Rovira 2023-08-29 20:42:17 +02:00 committed by GitHub
parent 3a1c519939
commit 15574caf02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 1 deletions

View File

@ -58,6 +58,7 @@ goFaceParsedItem i = WithLoc (i ^. parsedLoc) (PropertyFace f)
ParsedTagLiteralInt -> FaceNumber
ParsedTagLiteralString -> FaceString
ParsedTagComment -> FaceComment
ParsedTagPragma -> FacePragma
ParsedTagJudoc -> FaceJudoc
ParsedTagDelimiter -> FaceDelimiter

View File

@ -32,6 +32,7 @@ data Face
| FaceString
| FaceNumber
| FaceComment
| FacePragma
| FaceJudoc
| FaceError
@ -40,6 +41,7 @@ faceSymbolStr = \case
FaceAxiom -> Str.axiom
FaceInductive -> Str.inductive
FaceConstructor -> Str.constructor
FacePragma -> Str.pragma
FaceModule -> Str.module_
FaceKeyword -> Str.keyword
FaceDelimiter -> Str.delimiter

View File

@ -57,7 +57,7 @@ registerPragmas i =
registerItem
ParsedItem
{ _parsedLoc = i,
_parsedTag = ParsedTagComment
_parsedTag = ParsedTagPragma
}
registerLiteral :: (Member InfoTableBuilder r) => LiteralLoc -> Sem r LiteralLoc

View File

@ -13,6 +13,7 @@ data ParsedItemTag
| ParsedTagLiteralInt
| ParsedTagLiteralString
| ParsedTagComment
| ParsedTagPragma
| ParsedTagJudoc
| ParsedTagDelimiter
deriving stock (Eq, Show, Generic)

View File

@ -59,6 +59,9 @@ include = "include"
alias :: (IsString s) => s
alias = "alias"
pragma :: (IsString s) => s
pragma = "pragma"
import_ :: (IsString s) => s
import_ = "import"