blob: 5a970df784d9184f81340b7208e61af7d8540144 [file] [log] [blame]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -07001#!/usr/bin/env python
2#
3# Copyright 2017 Google Inc.
4#
5# Use of this source code is governed by a BSD-style license that can be
6# found in the LICENSE file.
7
8import os
9import subprocess
10import sys
11
12sksllex = sys.argv[1]
13clangFormat = sys.argv[2]
14src = sys.argv[3]
15try:
16 subprocess.check_output([sksllex, src + "/sksl/lex/sksl.lex", "Lexer",
17 "Token", src + "/sksl/SkSLLexer.h", src +
18 "/sksl/SkSLLexer.cpp"])
19 subprocess.check_call(clangFormat + " -i \"" + src + "/sksl/SkSLLexer.h\"",
20 shell=True)
21 subprocess.check_call(clangFormat + " -i \"" + src +
22 "/sksl/SkSLLexer.cpp\"", shell=True)
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070023except subprocess.CalledProcessError as err:
24 print("### Lexer error:")
25 print(err.output)
26 exit(1)