Skip to content

Commit d095461

Browse files
committed
Split haPropertyDrawer into a haPropertyDrawerAppend variant too
1 parent 6439966 commit d095461

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/ntangle.nim

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ dbg "{tangledExt}"
3535

3636
type
3737
HeaderArgType = enum
38-
haPropertyKwd
39-
haPropertyDrawer
40-
haBeginSrc
41-
haNone
38+
haPropertyKwd # #+property: header-args ..
39+
haPropertyDrawer # :header-args: ..
40+
haPropertyDrawerAppend # :header-args+: ..
41+
haBeginSrc # #+begin_src foo ..
42+
haNone # none of the above
4243
UserError = object of Exception
4344
OrgError = object of Exception
4445
HeaderArgs = object
@@ -373,9 +374,13 @@ proc getHeaderArgs(s: string): LangAndArgs =
373374
headerArgsRaw = spaceSepParts[1 .. spaceSepParts.high]
374375
let
375376
kwdParts = spaceSepParts[0].split(":")
377+
doAssert kwdParts.len >= 3
376378
if kwdParts.len == 4:
377379
lang = kwdParts[2].strip(chars = {' ', '+'})
378-
haType = haPropertyDrawer
380+
if kwdParts[1].strip().endsWith("+"):
381+
haType = haPropertyDrawerAppend
382+
else:
383+
haType = haPropertyDrawer
379384
elif spaceSepParts.len >= 2 and
380385
spaceSepParts[0].toLowerAscii() == "#+begin_src":
381386
if spaceSepParts.len >= 3:

0 commit comments

Comments
 (0)