diff options
author | Karl Berry <karl@freefriends.org> | 2022-12-29 22:04:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-12-29 22:04:10 +0000 |
commit | 921eeb403db0cbafdaf2b1daf455b6364c3bd477 (patch) | |
tree | bf0d267dff7b03834aac5190cbdbe92b55307f71 /Master/texmf-dist/tex/lualatex/piton | |
parent | d479835ff53e32edf1aa443d9de138b2489f81ee (diff) |
piton (29dec22)
git-svn-id: svn://tug.org/texlive/trunk@65395 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/piton')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/piton/piton.sty | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/lualatex/piton/piton.sty b/Master/texmf-dist/tex/lualatex/piton/piton.sty index 5e38b27a12f..88ae2b21bfb 100644 --- a/Master/texmf-dist/tex/lualatex/piton/piton.sty +++ b/Master/texmf-dist/tex/lualatex/piton/piton.sty @@ -18,8 +18,8 @@ %% and version 1.3 or later is part of all distributions of %% LaTeX version 2005/12/01 or later. %% -\def\myfileversion{0.99} -\def\myfiledate{2022/11/29} +\def\myfileversion{1.0} +\def\myfiledate{2022/12/29} @@ -275,6 +275,8 @@ auto-gobble .value_forbidden:n = true , env-gobble .code:n = \int_set:Nn \l__piton_gobble_int { -2 } , env-gobble .value_forbidden:n = true , + tabs-auto-gobble .code:n = \int_set:Nn \l__piton_gobble_int { -3 } , + tabs-auto-gobble .value_forbidden:n = true , line-numbers .bool_set:N = \l__piton_line_numbers_bool , line-numbers .default:n = true , all-line-numbers .code:n = @@ -329,15 +331,17 @@ continuation-symbol,~ continuation-symbol-on-indentation,~ end-of-broken-line,~ - env-gobble,~gobble,~ - left-margin,~ + env-gobble,~ + gobble,~ indent-broken-lines,~ + left-margin,~ line-numbers,~ resume,~ show-spaces,~ slim,~ - splittable~ - and~tab-size.\\ + splittable,~ + tabs-auto-gobble,~ + and~tab-size. } \NewDocumentCommand \PitonOptions { } { \keys_set:nn { PitonOptions } } \int_new:N \g__piton_visual_line_int @@ -810,9 +814,11 @@ local ImportAs = 'Name.Namespace' ) * ( - ( Space * K ( P "as" , 'Keyword' ) * Space * K ( identifier , 'Name.Namespace' ) ) + ( Space * K ( P "as" , 'Keyword' ) * Space + * K ( identifier , 'Name.Namespace' ) ) + - ( SkipSpace * K ( P "," ) * SkipSpace * K ( identifier , 'Name.Namespace' ) ) ^ 0 + ( SkipSpace * K ( P "," ) * SkipSpace + * K ( identifier , 'Name.Namespace' ) ) ^ 0 ) local FromImport = K ( P "from" , 'Keyword' ) @@ -1117,6 +1123,20 @@ local AutoGobbleLPEG = * ( 1 - P " " ) * ( 1 - P "\r" ) ^ 0 ) ^ -1 , math.min ) +local TabsAutoGobbleLPEG = + ( space ^ 0 * P "\r" ) ^ -1 + * Cf ( + ( + ( P "\t" ) ^ 0 * P "\r" + + + Cf ( Cc(0) * ( P "\t" * Cc(1) ) ^ 0 , add ) + * ( 1 - P "\t" ) * ( 1 - P "\r" ) ^ 0 * P "\r" + ) ^ 0 + * + ( Cf ( Cc(0) * ( P "\t" * Cc(1) ) ^ 0 , add ) + * ( 1 - P "\t" ) * ( 1 - P "\r" ) ^ 0 ) ^ -1 , + math.min + ) local EnvGobbleLPEG = ( ( 1 - P "\r" ) ^ 0 * P "\r" ) ^ 0 * Cf ( Cc(0) * ( P " " * Cc(1) ) ^ 0 , add ) * -1 @@ -1125,6 +1145,9 @@ function piton.GobbleParse(n,code) then n = AutoGobbleLPEG : match(code) else if n==-2 then n = EnvGobbleLPEG : match(code) + else if n==-3 + then n = TabsAutoGobbleLPEG : match(code) + end end end piton.Parse(gobble(n,code)) |