Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"numpy",
"pyparsing",
"pyparsing>=3.0.0",
"rms-filecache",
"rms-julian"
]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ coverage
flake8
myst-parser
numpy
pyparsing
pyparsing>=3.0.0
pytest
rms-filecache
rms-julian
Expand Down
8 changes: 4 additions & 4 deletions textkernel/_DATA_GRAMMAR.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Combine,
Literal,
nums,
oneOf,
one_of,
OneOrMore,
Optional,
ParseException,
Expand Down Expand Up @@ -44,7 +44,7 @@
# Integer
############################################

SIGN = oneOf('+ -')
SIGN = one_of('+ -')
UNSIGNED_INT = Word(nums)
SIGNED_INT = Combine(Optional(SIGN) + UNSIGNED_INT)
INT = SIGNED_INT | UNSIGNED_INT
Expand All @@ -57,7 +57,7 @@
# Floating-point number
############################################

EXPONENT = Suppress(oneOf('e E d D')) + INT
EXPONENT = Suppress(one_of('e E d D')) + INT
EXPONENT.set_parse_action(lambda s, loc, toks: 'e' + toks[0])

FLOAT_WITH_INT = Combine(INT + '.' + Optional(UNSIGNED_INT) + Optional(EXPONENT))
Expand Down Expand Up @@ -140,7 +140,7 @@ def _parse_datetime(s, loc, tokens):
# Expressions
############################################

STATEMENT = NAME_ + oneOf('= +=') + OPT_NEWLINE + VALUE + NEWLINE
STATEMENT = NAME_ + one_of('= +=') + OPT_NEWLINE + VALUE + NEWLINE
STATEMENT.set_name('STATEMENT')
STATEMENT.set_parse_action(lambda s, loc, toks: tuple(toks))

Expand Down
6 changes: 3 additions & 3 deletions textkernel/_NAME_GRAMMAR.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Combine,
Literal,
nums,
oneOf,
one_of,
OneOrMore,
Optional,
ParserElement,
Expand Down Expand Up @@ -41,15 +41,15 @@
GENERAL_NAME = Combine(CharsNotIn(EXCLUDED_CHARS))
GENERAL_NAME.set_name('GENERAL_NAME')

INDEXED_NAME = (oneOf(['BODY', 'OBJECT', 'FRAME', 'TKFRAME', 'INS', 'CK'])
INDEXED_NAME = (one_of(['BODY', 'OBJECT', 'FRAME', 'TKFRAME', 'INS', 'CK'])
+ Suppress(Optional(Literal('_')))
+ INTEGER
+ Suppress(Optional(Literal('_')))
+ GENERAL_NAME)
INDEXED_NAME.set_name('INDEXED_NAME')
INDEXED_NAME.set_parse_action(lambda s, loc, toks: tuple(toks))

TKFRAME_SUFFIX = oneOf(['ANGLES', 'AXES', 'BORESIGHT', 'MATRIX', 'Q', 'RELATIVE', 'SPEC',
TKFRAME_SUFFIX = one_of(['ANGLES', 'AXES', 'BORESIGHT', 'MATRIX', 'Q', 'RELATIVE', 'SPEC',
'UNITS'])
_TKFRAME_SUFFIX = Suppress(Literal('_')) + TKFRAME_SUFFIX
TKFRAME_NAME = (Literal('TKFRAME')
Expand Down
Loading