diff options
author | Andrey Makarov <ph.makarov@gmail.com> | 2022-09-11 20:52:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-11 13:52:43 -0400 |
commit | 088487f652638a745e8e7e440a8a3b381239597b (patch) | |
tree | 960d2b08b4d3f16520395d7d1239946fd9403edd /compiler | |
parent | 846cc746a2350ad3f845a4eb0ce97b864891cd35 (diff) | |
download | Nim-088487f652638a745e8e7e440a8a3b381239597b.tar.gz |
Implement Markdown definition lists (+ migration) (#20333)
Implements definition lists Markdown extension adopted in a few implementations including: * [Pandoc]( https://pandoc.org/MANUAL.html#definition-lists) * [kramdown]( https://kramdown.gettalong.org/quickref.html#definition-lists) * [PHP extra Markdown]( https://michelf.ca/projects/php-markdown/extra/#def-list) Also affected files have been migrated. RST definition lists are turned off for Markdown: this solves the problem of broken formatting mentioned in https://github.com/nim-lang/Nim/pull/20292.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/aliases.nim | 7 | ||||
-rw-r--r-- | compiler/nimpaths.nim | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/compiler/aliases.nim b/compiler/aliases.nim index 9ec72faa4..4b50fdb28 100644 --- a/compiler/aliases.nim +++ b/compiler/aliases.nim @@ -77,24 +77,29 @@ proc isPartOf*(a, b: PNode): TAnalysisResult = ## cases: ## ## YES-cases: + ## ``` ## x <| x # for general trees ## x[] <| x ## x[i] <| x ## x.f <| x + ## ``` ## ## NO-cases: + ## ``` ## x !<| y # depending on type and symbol kind ## x[constA] !<| x[constB] ## x.f !<| x.g ## x.f !<| y.f iff x !<= y + ## ``` ## ## MAYBE-cases: ## + ## ``` ## x[] ?<| y[] iff compatible type ## ## ## x[] ?<| y depending on type - ## + ## ``` if a.kind == b.kind: case a.kind of nkSym: diff --git a/compiler/nimpaths.nim b/compiler/nimpaths.nim index c6e188289..3756f956b 100644 --- a/compiler/nimpaths.nim +++ b/compiler/nimpaths.nim @@ -9,7 +9,7 @@ specialpaths is simpler because it doesn't need variables to be relocatable at runtime (eg for use in testament) interpolation variables: - $nimr: such that `$nimr/lib/system.nim` exists (avoids confusion with $nim binary) +: $nimr: such that `$nimr/lib/system.nim` exists (avoids confusion with $nim binary) in compiler, it's obtainable via getPrefixDir(); for other tools (eg koch), this could be getCurrentDir() or getAppFilename().parentDir.parentDir, depending on use case |