Salome HOME
Updated copyright comment
[modules/yacs.git] / src / py2yacs / Test / bad_parsers.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2007-2024  CEA, EDF
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 def p1():
21   return ["a"], ["b"]
22
23 def p2(x):
24   return ["a"], ["b"]
25
26 def p3(x):
27   return 5, 6
28
29 def p4(a):
30   x= a / 0
31   return ["a"], ["b"]
32
33 class FunctionProperties:
34   def __init__(self, function_name):
35     self.name = function_name
36     self.inputs=[]
37     self.outputs=None
38     self.errors=[]
39     self.imports=[]
40     pass
41
42 def p5(f):
43   fp = FunctionProperties("boo")
44   fp.inputs=["a", 5]
45   return [fp], ["a", "b", "c"]
46
47 def p6(f):
48   fp = FunctionProperties("boo")
49   fp.outputs=[7, 5]
50   return [fp], ["a", "b", "c"]
51
52 def p7(f):
53   fp = FunctionProperties("boo")
54   fp.errors=[7, 5]
55   return [fp], ["a", "b", "c"]
56
57 def p8(f):
58   fp = FunctionProperties("boo")
59   fp.name=[5]
60   return [fp], ["a", "b", "c"]
61
62 def p9(f):
63   fp = FunctionProperties("boo")
64   return [fp], "a"
65
66 def p10(f):
67   fp = FunctionProperties("boo")
68   return [fp], ["a", fp, "c"]
69