From 963afa486132ab9117534b1b6ed4410c946a1cd9 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Tue, 13 Aug 2013 07:07:14 -0700 Subject: [PATCH] Add missing files Signed-off-by: Leonardo de Moura --- src/tests/frontend/scanner.cpp | 29 +++++++++++++++++++++++++++++ src/util/sexpr/CMakeLists.txt | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 src/tests/frontend/scanner.cpp create mode 100644 src/util/sexpr/CMakeLists.txt diff --git a/src/tests/frontend/scanner.cpp b/src/tests/frontend/scanner.cpp new file mode 100644 index 000000000..a686f9110 --- /dev/null +++ b/src/tests/frontend/scanner.cpp @@ -0,0 +1,29 @@ +/* +Copyright (c) 2013 Microsoft Corporation. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. + +Author: Leonardo de Moura +*/ +#include +#include "scanner.h" +#include "test.h" +using namespace lean; + +static void tst1() { + char tst[] = "fun(x: pi A : Type, A -> A), (* (* test *) *) x+1 = 2.0 λ"; + std::istringstream in(tst); + scanner s(in); + while (true) { + scanner::token t = s.scan(); + if (t == scanner::token::Eof) + break; + std::cout << t << " "; + } + std::cout << "\n"; +} + +int main() { + continue_on_violation(true); + tst1(); + return has_violations() ? 1 : 0; +} diff --git a/src/util/sexpr/CMakeLists.txt b/src/util/sexpr/CMakeLists.txt new file mode 100644 index 000000000..09fc012fc --- /dev/null +++ b/src/util/sexpr/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(sexpr sexpr.cpp sexpr_funcs.cpp format.cpp options.cpp) +target_link_libraries(sexpr ${LEAN_LIBS})