def p_decl_sort(p: Any) -> None: 'decl : SORT id annotations' start_tok: Token = p.slice[1] name_tok: Token = p[2] name: str = name_tok.value annots: List[syntax.Annotation] = p[3] toks: List[Optional[Location]] = [start_tok, name_tok] span = loc_list(toks + [a.span for a in annots]) p[0] = syntax.SortDecl(name, annots, span=span)
def test_decls_eq(self) -> None: s1 = syntax.SortDecl('foo') s2 = syntax.SortDecl('foo') self.assertEqual(s1, s2)
def p_decl_sort(p: Any) -> None: 'decl : SORT id annotations' p[0] = syntax.SortDecl(p.slice[1], p[2].value, p[3])