mirror of
ssh://devgit.janware.com/janware/proj/jw-python
synced 2026-06-18 03:36:38 +02:00
grammar.py: Add support for --irrelevant-symbols
Arguments to --irrelevant-symbols are not meant to be represented in the AST resulting from parsing.
Also, add pad() to misc.py.
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
6297f10f55
commit
8c5934725c
4 changed files with 43 additions and 19 deletions
|
|
@ -6,3 +6,12 @@ def silentremove(filename): #export
|
|||
except OSError as e:
|
||||
if e.errno != errno.ENOENT:
|
||||
raise # re-raise exception if a different error occurred
|
||||
|
||||
def pad(token, total_size, right_align = False):
|
||||
add = total_size - len(token)
|
||||
if add <= 0:
|
||||
return token
|
||||
space = ' ' * add
|
||||
if right_align:
|
||||
return space + token
|
||||
return token + space
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue