Skip to content

Commit

Permalink
apply formatting to parser, fix typo in project.toml and format robot…
Browse files Browse the repository at this point in the history
…-coffee domain
  • Loading branch information
francescofuggitti committed Nov 3, 2024
1 parent 821fb14 commit 1e03b75
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 133 deletions.
1 change: 1 addition & 0 deletions fond4ltlf/parser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# along with FOND4LTLf. If not, see <https://www.gnu.org/licenses/>.
#
"""This module contains the implementation of the parsers for the PDDL formalism."""

import inspect
import os

Expand Down
11 changes: 4 additions & 7 deletions fond4ltlf/parser/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@


class PDDLLexer(object):

reserved = {
"define": "DEFINE_KEY",
"domain": "DOMAIN_KEY",
Expand Down Expand Up @@ -53,13 +52,11 @@ class PDDLLexer(object):
}

# List of token names. This is always required
tokens = ("NAME", "VARIABLE", "LPAREN", "RPAREN", "HYPHEN", "EQUALS") + tuple(
reserved.values()
)
tokens = ("NAME", "VARIABLE", "LPAR", "RPAR", "HYPHEN", "EQUALS") + tuple(reserved.values())

# Regular expression rules for simple tokens
t_LPAREN = r"\("
t_RPAREN = r"\)"
t_LPAR = r"\("
t_RPAR = r"\)"
t_HYPHEN = r"\-"
t_EQUALS = r"="

Expand Down Expand Up @@ -113,4 +110,4 @@ def test(self, data):
# Build the lexer and try it out
m = PDDLLexer()
m.build() # Build the lexer
m.test("(and (and) (oneof (ciao) (come) ))") # Test it
m.test("(and (and) (oneof (hello) (world) ))") # Test it
Loading

0 comments on commit 1e03b75

Please sign in to comment.