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