packages feed

skylighting-core 0.8.2 → 0.8.2.1

raw patch · 13 files changed

+175/−11 lines, 13 filesdep +regex-basePVP ok

version bump matches the API change (PVP)

Dependencies added: regex-base

API changes (from Hackage documentation)

Files

changelog.md view
@@ -1,5 +1,21 @@ # Revision history for skylighting and skylighting-core +## 0.8.2.1 -- 2019-09-25++  * Add upper bound for regex-base if regex-pcre-builtin is used.+    Currently regex-pcre-builtin won't build on ghc 8.4+ with+    regex-base 0.94.0.0.  When regex-pcre-builtin is updated, we+    can remove this.++  * Correct cabal wildcard to include .xml.patch files in distribution.++  * Update breezedark style (Kien Dang).++  * Update markdown.xml so first list marker is included in list (#84).++  * skylighting.cabal - removed some build dependencies+    which are not necessary (they're dependencies of skylighting-core).+ ## 0.8.2 -- 2019-07-14    * Change matchRegex so it gives "no match" on a regex error@@ -16,6 +32,7 @@     java jsp nasm protobuf pure go objectivecpp gnuassembler povray     actionscript c cs opencl boo rhtml elixir.  This fixes a     regression introduced in version 0.3.1.+  * Ensure line span css only applied to lines (David Baynard).  ## 0.8.1.1 -- 2019-06-13 
skylighting-core.cabal view
@@ -1,5 +1,5 @@ name:                skylighting-core-version:             0.8.2+version:             0.8.2.1 synopsis:            syntax highlighting library description:         Skylighting is a syntax highlighting library.                      It derives its tokenizers from XML syntax@@ -27,6 +27,7 @@ extra-source-files:  README.md                      changelog.md                      xml/*.xml+                     xml/*.xml.patch                      test/default.theme                      test/cases/abc.ada                      test/cases/abc.agda@@ -131,7 +132,10 @@   if flag(system-pcre)     build-depends:     regex-pcre   else-    build-depends:     regex-pcre-builtin+    build-depends:     regex-pcre-builtin,+                       regex-base < 0.94+         -- for the above, see https://github.com/jgm/pandoc/issues/5776+         -- this can be removed if we have a new regex-pcre-builtin release   hs-source-dirs:      src   ghc-prof-options:    -fprof-auto-exported   default-language:    Haskell2010
src/Skylighting/Styles.hs view
@@ -67,12 +67,12 @@ breezeDark :: Style breezeDark = Style     { tokenStyles = Map.fromList-        [ ( KeywordTok, defStyle { tokenColor = Just (RGB 207 207 194) })+        [ ( KeywordTok, defStyle { tokenColor = Just (RGB 207 207 194), tokenBold = True })         , ( DataTypeTok, defStyle { tokenColor = Just (RGB 41 128 185) })         , ( DecValTok, defStyle { tokenColor = Just (RGB 246 116 0) })         , ( BaseNTok, defStyle { tokenColor = Just (RGB 246 116 0) })         , ( FloatTok, defStyle { tokenColor = Just (RGB 246 116 0) })-        , ( ConstantTok, defStyle { tokenColor = Just (RGB 39 174 174) })+        , ( ConstantTok, defStyle { tokenColor = Just (RGB 39 174 174), tokenBold = True })         , ( CharTok, defStyle { tokenColor = Just (RGB 61 174 233) })         , ( SpecialCharTok, defStyle { tokenColor = Just (RGB 61 174 233) })         , ( StringTok, defStyle { tokenColor = Just (RGB 244 79 79) })@@ -86,17 +86,17 @@         , ( OtherTok, defStyle { tokenColor = Just (RGB 39 174 96) })         , ( FunctionTok, defStyle { tokenColor = Just (RGB 142 68 173) })         , ( VariableTok, defStyle { tokenColor = Just (RGB 39 174 174) })-        , ( ControlFlowTok, defStyle { tokenColor = Just (RGB 253 188 75) })+        , ( ControlFlowTok, defStyle { tokenColor = Just (RGB 253 188 75), tokenBold = True })         , ( OperatorTok, defStyle { tokenColor = Just (RGB 207 207 194) })         , ( BuiltInTok, defStyle { tokenColor = Just (RGB 127 140 141) })-        , ( ExtensionTok, defStyle { tokenColor = Just (RGB 0 153 255) })+        , ( ExtensionTok, defStyle { tokenColor = Just (RGB 0 153 255), tokenBold = True })         , ( PreprocessorTok, defStyle { tokenColor = Just (RGB 39 174 96) })         , ( AttributeTok, defStyle { tokenColor = Just (RGB 41 128 185) })-        , ( RegionMarkerTok, defStyle { tokenColor = Just (RGB 41 128 185) })+        , ( RegionMarkerTok, defStyle { tokenColor = Just (RGB 41 128 185), tokenBackground = Just (RGB 21 48 66) })         , ( InformationTok, defStyle { tokenColor = Just (RGB 196 91 0) })         , ( WarningTok, defStyle { tokenColor = Just (RGB 218 68 83) })-        , ( AlertTok, defStyle { tokenColor = Just (RGB 149 218 76) })-        , ( ErrorTok, defStyle { tokenColor = Just (RGB 218 68 83) })+        , ( AlertTok, defStyle { tokenColor = Just (RGB 149 218 76), tokenBackground = Just (RGB 77 31 36), tokenBold = True })+        , ( ErrorTok, defStyle { tokenColor = Just (RGB 218 68 83), tokenUnderline = True })         , ( NormalTok, defStyle { tokenColor = Just (RGB 207 207 194) })         ]     , defaultColor = Just (RGB 207 207 194)
+ xml/bash.xml.patch view
@@ -0,0 +1,12 @@+--- a/skylighting-core/xml/bash.xml++++ b/skylighting-core/xml/bash.xml+@@ -482,7 +482,7 @@+       <!-- FindComments consumes shell comments till EOL -->+       <context attribute="Normal Text" lineEndContext="#pop" name="FindComments">+         <DetectChar attribute="Comment" context="Comment" char="#" firstNonSpace="true"/>+-        <RegExpr attribute="Normal Text" context="Comment" String="[\s;](?=#)" />++        <RegExpr attribute="Normal Text" context="Comment" String="\s*[\s;](?=#)" />+       </context>+       <context attribute="Comment" lineEndContext="#pop" name="Comment">+         <IncludeRules context="##Alerts" />+
+ xml/cmake.xml.patch view
@@ -0,0 +1,13 @@+--- cmake.xml.orig	2018-06-08 10:09:39.000000000 -0700++++ cmake.xml	2018-06-08 09:49:50.000000000 -0700+@@ -3304,6 +3304,10 @@+       <context attribute="Normal Text" lineEndContext="#stay" name="Detect Builtin Variables">+         <keyword attribute="Builtin Variable" context="#stay" String="variables" insensitive="false" />+         <IncludeRules context="Detect More Builtin Variables" />++        <!-- JGM: next line is needed because we don't really handle++             \b at the beginning of a regex, and we don't want to++             capture part of FOO_BAR as an "Internal Name" -->++        <RegExpr attribute="Normal Text" context="#stay" String="&id_re;\b" />+         <RegExpr attribute="Internal Name" context="#stay" String="\b_&id_re;\b" />+       </context>+ 
+ xml/erlang.xml.patch view
@@ -0,0 +1,13 @@+diff --git a/skylighting-core/xml/erlang.xml b/skylighting-core/xml/erlang.xml+index 7bbcbc9..b631afd 100644+--- a/skylighting-core/xml/erlang.xml++++ b/skylighting-core/xml/erlang.xml+@@ -213,7 +213,7 @@+ +       <!-- finish off the atom in quoted string (allow for escaped single quotes -->+       <context name="stringquote" attribute="String" lineEndContext="#pop">+-        <RegExpr attribute="String" context="#pop" String="(?:(?:\\&quot;)?[^&quot;]*)*&quot;" />++        <RegExpr attribute="String" context="#pop" String="(?:\\&quot;|[^&quot;])*&quot;" />+       </context>+       +       <!-- finish off the comment (allows for alerts) -->
+ xml/haskell.xml.patch view
@@ -0,0 +1,26 @@+diff --git a/haskell.xml b/haskell.xml+index a71d649..84f4f85 100644+--- a/haskell.xml++++ b/haskell.xml+@@ -482,7 +482,7 @@+       <RegExpr    attribute="Octal"   context="#stay" String="0[Oo][0-7]+"/>+       <RegExpr    attribute="Hex"     context="#stay" String="0[Xx][0-9A-Fa-f]+"/>+       <Int        attribute="Decimal" context="#stay" />+-      <DetectChar attribute="Char"    context="char" char="'" />++      <RegExpr    attribute="Char"    context="#stay" String="'(\\'|\\[^']+|[^\\\n])'" />+       <DetectChar attribute="String"  context="string" char="&quot;" />+ +       <DetectChar attribute="Function Infix" context="infix" char="`"/>+@@ -605,9 +605,9 @@+ +     <itemData name="Keyword"          defStyleNum="dsKeyword"  spellChecking="false" />+     <itemData name="Type Prelude"     defStyleNum="dsDataType" spellChecking="false" />+-    <itemData name="Function Prelude" defStyleNum="dsFunction" spellChecking="false" />+-    <itemData name="Data Prelude"     defStyleNum="dsKeyword"  spellChecking="false" />+-    <itemData name="Class Prelude"    defStyleNum="dsKeyword"  spellChecking="false" />++    <itemData name="Function Prelude" defStyleNum="dsNormal"   spellChecking="false" />++    <itemData name="Data Prelude"     defStyleNum="dsDataType" spellChecking="false" />++    <itemData name="Class Prelude"    defStyleNum="dsDataType" spellChecking="false" />+ +     <itemData name="Signature"        defStyleNum="dsOthers"  spellChecking="false" />+     <itemData name="Function"         defStyleNum="dsNormal"   spellChecking="false" />
+ xml/lua.xml.patch view
@@ -0,0 +1,11 @@+--- xml/lua.xml.orig	2018-06-08 09:28:41.000000000 -0700++++ xml/lua.xml	2018-06-08 09:28:33.000000000 -0700+@@ -518,7 +518,7 @@+       <itemData name="Strings"         defStyleNum="dsString"/>+       <itemData name="RawStrings"      defStyleNum="dsVerbatimString"/>+       <itemData name="Symbols"         defStyleNum="dsOperator" spellChecking="false"/>+-      <itemData name="Variable"        defStyleNum="dsKeyword" color="#5555FF" selColor="#ffffff" bold="0" italic="0" spellChecking="false"/>++      <itemData name="Variable"        defStyleNum="dsNormal" /> <!-- JGM -->+     </itemDatas>+   </highlighting>+   <general>
xml/markdown.xml view
@@ -51,8 +51,9 @@         <RegExpr attribute="emphasis" String="&emphasisregex;"/>         <RegExpr attribute="strongemphasis" String="&strongemphasisregex;"/>         <RegExpr attribute="code" String="^([\s]{4,}|\t+).*$"/>-        <RegExpr context="bullet" String="^[\*\+\-]\s"/>-        <RegExpr context="numlist" String="^[\d]+\.\s"/>+        <!-- Next 2 lines modified: see https://github.com/jgm/skylighting/issues/84 -->+        <RegExpr context="bullet" String="^[\*\+\-]\s" lookAhead="true"/>+        <RegExpr context="numlist" String="^[\d]+\.\s" lookAhead="true"/>         <RegExpr attribute="meta" String="^(Title|Author|Date|Copyright|Revision|CSS|LaTeX\ XSLT|Categories|Tags|BaseName|Excerpt):(.*)+$"/>         <IncludeRules context="inc"/>       </context>
+ xml/markdown.xml.patch view
@@ -0,0 +1,16 @@+diff --git a/skylighting-core/xml/markdown.xml b/skylighting-core/xml/markdown.xml+index f888487..1cf6b14 100644+--- a/skylighting-core/xml/markdown.xml++++ b/skylighting-core/xml/markdown.xml+@@ -51,8 +51,9 @@+         <RegExpr attribute="emphasis" String="&emphasisregex;"/>+         <RegExpr attribute="strongemphasis" String="&strongemphasisregex;"/>+         <RegExpr attribute="code" String="^([\s]{4,}|\t+).*$"/>+-        <RegExpr context="bullet" String="^[\*\+\-]\s"/>+-        <RegExpr context="numlist" String="^[\d]+\.\s"/>++        <!-- Next 2 lines modified: see https://github.com/jgm/skylighting/issues/84 -->++        <RegExpr context="bullet" String="^[\*\+\-]\s" lookAhead="true"/>++        <RegExpr context="numlist" String="^[\d]+\.\s" lookAhead="true"/>+         <RegExpr attribute="meta" String="^(Title|Author|Date|Copyright|Revision|CSS|LaTeX\ XSLT|Categories|Tags|BaseName|Excerpt):(.*)+$"/>+         <IncludeRules context="inc"/>+       </context>
+ xml/perl.xml.patch view
@@ -0,0 +1,29 @@+--- ../syntax-highlighting/data/syntax/perl.xml	2016-12-14 12:44:11.000000000 +0100++++ perl.xml	2017-02-16 16:14:04.000000000 +0100+@@ -452,7 +452,7 @@+         <IncludeRules context="ipstring_internal" />+       </context>+       <context name="ip_string_6" attribute="String (interpolated)" lineEndContext="#stay" dynamic="true">+-        <RegExpr attribute="String (interpolated)" context="#stay" String="\%1" dynamic="true" />++        <RegExpr attribute="String (interpolated)" context="#stay" String="\\%1" dynamic="true" />+         <DetectChar attribute="Operator" context="#pop#pop#pop" char="1" dynamic="true"  endRegion="String"/>+         <IncludeRules context="ipstring_internal" />+       </context>+@@ -495,7 +495,7 @@+       <context name="string_6" attribute="String" lineEndContext="#stay" dynamic="true">+         <DetectIdentifier />+         <Detect2Chars attribute="String Special Character" context="#stay" char="\" char1="\" />+-        <RegExpr attribute="String Special Character" context="#stay" String="\%1" dynamic="true"/>++        <RegExpr attribute="String Special Character" context="#stay" String="\\%1" dynamic="true"/>+         <DetectChar attribute="Operator" context="#pop#pop" char="1" dynamic="true" endRegion="String" />+       </context>+ +@@ -600,7 +600,7 @@+         <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=%1)" dynamic="true" />+         <RegExpr attribute="Operator" context="#pop#pop" String="%1[cgimosx]*" dynamic="true" endRegion="Pattern" />+         <IncludeRules context="regex_pattern_internal_ip" />+-        <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=\%1)" dynamic="true" />++        <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=\\%1)" dynamic="true" />+       </context>+       <context name="pattern_brace" attribute="Pattern" lineEndContext="#stay">+         <RegExpr attribute="Operator" context="#pop#pop" String="\}[cgimosx]*" endRegion="Pattern" />
+ xml/php.xml.patch view
@@ -0,0 +1,11 @@+--- a/xml/php.xml++++ b/xml/php.xml+@@ -5412,6 +5412,7 @@+     </list>+ +     <contexts>++      <!-- JGM:  Added fallthrough so it will handle snippets that don't begin with <?php -->++      <context name="start" lineEndContext="#stay" attribute="Normal Text" fallthrough="true" fallthroughContext="phpsource">+-      <context name="start" lineEndContext="#stay" attribute="Normal Text">+         <RegExpr context="phpsource" attribute="Keyword" String="&lt;\?(?:=|php)?" insensitive="true" />+         <StringDetect attribute="Keyword" context="#pop" String="?&gt;" />
+ xml/tcsh.xml.patch view
@@ -0,0 +1,11 @@+--- tcsh.xml.orig	2018-06-08 09:32:02.000000000 -0700++++ tcsh.xml	2018-06-08 09:32:06.000000000 -0700+@@ -674,7 +674,7 @@+       <context attribute="Normal Text" lineEndContext="#pop" name="CmdSetEnv" fallthrough="true" fallthroughContext="#pop">+         <!-- handle command line options -->+         <RegExpr attribute="Variable" context="#pop" String="\b&varname;" />+-        <RegExpr attribute="Variable" context="Assign" String="\s" />++        <RegExpr attribute="Variable" context="Assign" String=" " />+         <IncludeRules context="FindMost" />+       </context>+