1
1
mirror of https://github.com/anoma/juvix.git synced 2025-01-08 08:39:26 +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 ParsedTagLiteralInt -> FaceNumber
ParsedTagLiteralString -> FaceString ParsedTagLiteralString -> FaceString
ParsedTagComment -> FaceComment ParsedTagComment -> FaceComment
ParsedTagPragma -> FacePragma
ParsedTagJudoc -> FaceJudoc ParsedTagJudoc -> FaceJudoc
ParsedTagDelimiter -> FaceDelimiter ParsedTagDelimiter -> FaceDelimiter

View File

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

View File

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

View File

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

View File

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