Project

Profile

Help

Revision 0713b7fd

Added by Vincent Le Goff over 4 years ago

Add a SharpScript syntax to support flags

View differences:

src/sharp/engine.py
97 97
                argument = "compile(" + argument + ", 'SharpScript', 'exec')"
98 98
            elif argument.startswith("{"):
99 99
                argument = repr(argument[1:-1])
100
            elif argument.endswith("=True") or argument.endswith("=False"):
101
                pass
100 102
            else:
101 103
                argument = repr(argument)
102 104

  
......
153 155
                    argument = remaining.splitlines()[0]
154 156
                    i += len(argument)
155 157
                    arguments = [argument]
158
            elif remaining[0] in "+-":
159
                argument = remaining.splitlines()[0].split(" ")[0]
160
                flag = argument[1:]
161
                if argument.startswith("+"):
162
                    arguments.append(flag + "=True")
163
                else:
164
                    arguments.append(flag + "=False")
165
                i += len(flag) + 1
156 166
            elif remaining[0] == "{":
157 167
                end = self.find_right_brace(remaining)
158 168
                argument = remaining[:end + 1]

Also available in: Unified diff