summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2020-11-10 09:41:26 +0100
committerGitHub <noreply@github.com>2020-11-10 09:41:26 +0100
commitee78d7610853f4866c9b3d1e81d523b7ef339da0 (patch)
tree48fb70888df2e0dde545e9b40a25d39ad302d1a0 /compiler
parentd8e7caf5dd4ab70b7429896c1587cde992e7855a (diff)
downloadNim-ee78d7610853f4866c9b3d1e81d523b7ef339da0.tar.gz
rst: add support for markdown tables (#15854)
* rst: add support for markdown tables

* change template into proc

* don't create unnecessary `seq[string]`
Diffstat (limited to 'compiler')
-rw-r--r--compiler/docgen.nim1
-rw-r--r--compiler/lineinfos.nim30
2 files changed, 17 insertions, 14 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim
index 7609c96ee..8f6b7a560 100644
--- a/compiler/docgen.nim
+++ b/compiler/docgen.nim
@@ -127,6 +127,7 @@ template declareClosures =
     of meCannotOpenFile: k = errCannotOpenFile
     of meExpected: k = errXExpected
     of meGridTableNotImplemented: k = errGridTableNotImplemented
+    of meMarkdownIllformedTable: k = errMarkdownIllformedTable
     of meNewSectionExpected: k = errNewSectionExpected
     of meGeneralParseError: k = errGeneralParseError
     of meInvalidDirective: k = errInvalidDirectiveX
diff --git a/compiler/lineinfos.nim b/compiler/lineinfos.nim
index 759002312..f9ea90caf 100644
--- a/compiler/lineinfos.nim
+++ b/compiler/lineinfos.nim
@@ -30,42 +30,43 @@ type
     errUnknown, errInternal, errIllFormedAstX, errCannotOpenFile,
     errXExpected,
     errGridTableNotImplemented,
+    errMarkdownIllformedTable,
     errGeneralParseError,
     errNewSectionExpected,
     errInvalidDirectiveX,
     errProveInit, # deadcode
     errGenerated,
     errUser,
-    
-    warnCannotOpenFile = "CannotOpenFile", warnOctalEscape = "OctalEscape", 
+
+    warnCannotOpenFile = "CannotOpenFile", warnOctalEscape = "OctalEscape",
     warnXIsNeverRead = "XIsNeverRead", warnXmightNotBeenInit = "XmightNotBeenInit",
     warnDeprecated = "Deprecated", warnConfigDeprecated = "ConfigDeprecated",
-    warnSmallLshouldNotBeUsed = "SmallLshouldNotBeUsed", warnUnknownMagic = "UnknownMagic", 
-    warnRedefinitionOfLabel = "RedefinitionOfLabel", warnUnknownSubstitutionX = "UnknownSubstitutionX", 
-    warnLanguageXNotSupported = "LanguageXNotSupported", warnFieldXNotSupported = "FieldXNotSupported", 
+    warnSmallLshouldNotBeUsed = "SmallLshouldNotBeUsed", warnUnknownMagic = "UnknownMagic",
+    warnRedefinitionOfLabel = "RedefinitionOfLabel", warnUnknownSubstitutionX = "UnknownSubstitutionX",
+    warnLanguageXNotSupported = "LanguageXNotSupported", warnFieldXNotSupported = "FieldXNotSupported",
     warnCommentXIgnored = "CommentXIgnored", warnTypelessParam = "TypelessParam",
-    warnUseBase = "UseBase", warnWriteToForeignHeap = "WriteToForeignHeap", 
+    warnUseBase = "UseBase", warnWriteToForeignHeap = "WriteToForeignHeap",
     warnUnsafeCode = "UnsafeCode", warnUnusedImportX = "UnusedImport",
     warnInheritFromException = "InheritFromException", warnEachIdentIsTuple = "EachIdentIsTuple",
     warnUnsafeSetLen = "UnsafeSetLen", warnUnsafeDefault = "UnsafeDefault",
     warnProveInit = "ProveInit", warnProveField = "ProveField", warnProveIndex = "ProveIndex",
     warnUnreachableElse = "UnreachableElse", warnUnreachableCode = "UnreachableCode",
     warnStaticIndexCheck = "IndexCheck", warnGcUnsafe = "GcUnsafe", warnGcUnsafe2 = "GcUnsafe2",
-    warnUninit = "Uninit", warnGcMem = "GcMem", warnDestructor = "Destructor", 
-    warnLockLevel = "LockLevel", warnResultShadowed = "ResultShadowed", 
-    warnInconsistentSpacing = "Spacing",  warnCaseTransition = "CaseTransition", 
-    warnCycleCreated = "CycleCreated", warnObservableStores = "ObservableStores", 
+    warnUninit = "Uninit", warnGcMem = "GcMem", warnDestructor = "Destructor",
+    warnLockLevel = "LockLevel", warnResultShadowed = "ResultShadowed",
+    warnInconsistentSpacing = "Spacing",  warnCaseTransition = "CaseTransition",
+    warnCycleCreated = "CycleCreated", warnObservableStores = "ObservableStores",
     warnUser = "User",
 
     hintSuccess = "Success", hintSuccessX = "SuccessX", hintCC = "CC",
     hintLineTooLong = "LineTooLong", hintXDeclaredButNotUsed = "XDeclaredButNotUsed",
     hintXCannotRaiseY = "XCannotRaiseY", hintConvToBaseNotNeeded = "ConvToBaseNotNeeded",
-    hintConvFromXtoItselfNotNeeded = "ConvFromXtoItselfNotNeeded", hintExprAlwaysX = "ExprAlwaysX", 
-    hintQuitCalled = "QuitCalled", hintProcessing = "Processing", hintCodeBegin = "CodeBegin", 
+    hintConvFromXtoItselfNotNeeded = "ConvFromXtoItselfNotNeeded", hintExprAlwaysX = "ExprAlwaysX",
+    hintQuitCalled = "QuitCalled", hintProcessing = "Processing", hintCodeBegin = "CodeBegin",
     hintCodeEnd = "CodeEnd", hintConf = "Conf", hintPath = "Path",
-    hintConditionAlwaysTrue = "CondTrue", hintConditionAlwaysFalse = "CondFalse", hintName = "Name", 
+    hintConditionAlwaysTrue = "CondTrue", hintConditionAlwaysFalse = "CondFalse", hintName = "Name",
     hintPattern = "Pattern", hintExecuting = "Exec", hintLinking = "Link", hintDependency = "Dependency",
-    hintSource = "Source", hintPerformance = "Performance", hintStackTrace = "StackTrace", 
+    hintSource = "Source", hintPerformance = "Performance", hintStackTrace = "StackTrace",
     hintGCStats = "GCStats", hintGlobalVar = "GlobalVar", hintExpandMacro = "ExpandMacro",
     hintUser = "User", hintUserRaw = "UserRaw", hintExtendedContext = "ExtendedContext",
     hintMsgOrigin = "MsgOrigin", # since 1.3.5
@@ -79,6 +80,7 @@ const
     errCannotOpenFile: "cannot open '$1'",
     errXExpected: "'$1' expected",
     errGridTableNotImplemented: "grid table is not implemented",
+    errMarkdownIllformedTable: "illformed delimiter row of a markdown table",
     errGeneralParseError: "general parse error",
     errNewSectionExpected: "new section expected",
     errInvalidDirectiveX: "invalid directive: '$1'",