Skip to content

Commit

Permalink
Update ASTTypes to allow comments
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanzwicknagl committed May 1, 2024
1 parent acdd8f3 commit 2e8dbcc
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions backend/src/viasp/asp/ast_types.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
from clingo.ast import ASTType

SUPPORTED_TYPES = {
ASTType.Comparison, ASTType.Aggregate, ASTType.Rule, ASTType.Program, ASTType.ShowSignature, ASTType.Definition,
ASTType.Literal, ASTType.HeadAggregate, ASTType.HeadAggregateElement, ASTType.BodyAggregate, ASTType.Aggregate,
ASTType.ConditionalLiteral, ASTType.Guard, ASTType.Comparison, ASTType.SymbolicAtom, ASTType.Function,
ASTType.BodyAggregateElement, ASTType.BooleanConstant, ASTType.SymbolicAtom, ASTType.Variable, ASTType.SymbolicTerm,
ASTType.Interval, ASTType.UnaryOperation, ASTType.BinaryOperation, ASTType.Defined, ASTType.External, ASTType.ProjectAtom, ASTType.ProjectSignature, ASTType.ShowTerm, ASTType.Minimize, ASTType.Script
ASTType.Comparison, ASTType.Aggregate, ASTType.Rule, ASTType.Program,
ASTType.ShowSignature, ASTType.Definition, ASTType.Literal,
ASTType.HeadAggregate, ASTType.HeadAggregateElement, ASTType.BodyAggregate,
ASTType.Aggregate, ASTType.ConditionalLiteral, ASTType.Guard,
ASTType.Comparison, ASTType.SymbolicAtom, ASTType.Function,
ASTType.BodyAggregateElement, ASTType.BooleanConstant,
ASTType.SymbolicAtom, ASTType.Variable, ASTType.SymbolicTerm,
ASTType.Interval, ASTType.UnaryOperation, ASTType.BinaryOperation,
ASTType.Defined, ASTType.External, ASTType.ProjectAtom,
ASTType.ProjectSignature, ASTType.ShowTerm, ASTType.Minimize,
ASTType.Script, ASTType.Comment
}

UNSUPPORTED_TYPES = {
ASTType.Disjunction,
}


def make_unknown_AST_enum_types():
known = UNSUPPORTED_TYPES.union(SUPPORTED_TYPES)
return set([e for e in ASTType if e not in known])
Expand Down

0 comments on commit 2e8dbcc

Please sign in to comment.