Revision c1e9c2e6
Added by Vincent Le Goff over 4 years ago
src/sharp/engine.py | ||
---|---|---|
169 | 169 |
|
170 | 170 |
# If the function_name is not defined, take the first parameter |
171 | 171 |
if not function_name: |
172 |
if remaining.startswith("#"): |
|
172 |
if remaining.startswith("#") and not remaining.startswith( |
|
173 |
"##"): |
|
173 | 174 |
# This is obviously a function name |
174 | 175 |
function_name = remaining.splitlines()[0].split(" ")[0] |
175 | 176 |
arguments = [] |
... | ... | |
178 | 179 |
function_name = "#send" |
179 | 180 |
argument = remaining.splitlines()[0] |
180 | 181 |
i += len(argument) |
182 |
|
|
183 |
if argument.startswith("##"): |
|
184 |
argument = argument[1:] |
|
185 |
|
|
181 | 186 |
arguments = [argument] |
182 | 187 |
elif remaining[0] == "{": |
183 | 188 |
end = self.find_right_brace(remaining) |
184 | 189 |
argument = remaining[:end + 1] |
185 |
arguments.append(argument) |
|
186 | 190 |
i += end + 1 |
191 |
if argument.startswith("##"): |
|
192 |
argument = argument[1:] |
|
193 |
|
|
194 |
arguments.append(argument) |
|
187 | 195 |
else: |
188 | 196 |
argument = remaining.splitlines()[0].split(" ")[0] |
189 | 197 |
i += len(argument) |
198 |
if argument.startswith("##"): |
|
199 |
argument = argument[1:] |
|
200 |
|
|
190 | 201 |
arguments.append(argument) |
191 | 202 |
|
192 | 203 |
return statements |
Also available in: Unified diff
Add the sharp escaping (##) to SharpScript