summaryrefslogtreecommitdiff
path: root/scripts/gen-s-parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gen-s-parser.py')
-rwxr-xr-xscripts/gen-s-parser.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/gen-s-parser.py b/scripts/gen-s-parser.py
index 2f63efe70..a1b3a2701 100755
--- a/scripts/gen-s-parser.py
+++ b/scripts/gen-s-parser.py
@@ -14,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import sys
+
instructions = [
("unreachable", "makeUnreachable()"),
("nop", "makeNop()"),
@@ -541,6 +543,10 @@ def generate_with_guard(generator, guard):
def main():
+ if sys.version_info.major != 3:
+ import datetime
+ print("It's " + str(datetime.datetime.now().year) + "! Use Python 3!")
+ sys.exit(1)
print_header()
generate_with_guard(instruction_parser, "INSTRUCTION_PARSER")