Browse Source

Switch PEGTL external to latest Git snapshot.

undefined
Sam Hocevar 8 years ago
parent
commit
2f66dcc33f
4 changed files with 14 additions and 14 deletions
  1. +1
    -1
      build/msbuild/lol.vars.props
  2. +1
    -1
      configure.ac
  3. +3
    -3
      src/gpu/shader.cpp
  4. +9
    -9
      tools/lolremez/expression.h

+ 1
- 1
build/msbuild/lol.vars.props View File

@@ -5,7 +5,7 @@
<ExternalDir>$(SolutionDir)\..\external</ExternalDir>

<!-- PEGTL -->
<PegtlDir>$(ExternalDir)\pegtl-1.3.1</PegtlDir>
<PegtlDir>$(ExternalDir)\pegtl-1.3.1-e7752e81</PegtlDir>
<PegtlIncludes>$(PegtlDir)\include</PegtlIncludes>

<!-- imgui -->


+ 1
- 1
configure.ac View File

@@ -296,7 +296,7 @@ fi

dnl Use pegtl? Yes, always
if true; then
LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/pegtl-1.3.1/include"
LOL_CFLAGS="$LOL_CFLAGS -I\$(top_srcdir)/external/pegtl-1.3.1-e7752e81/include"
fi




+ 3
- 3
src/gpu/shader.cpp View File

@@ -168,14 +168,14 @@ public:
lolfx_parser(String const &code)
: m_section("header")
{
pegtl::parse<lolfx, action>(code.C(), "shader", this);
pegtl::parse_string<lolfx, action>(code.C(), "shader", this);
}
};

template<>
struct lolfx_parser::action<lolfx_parser::do_title>
{
static void apply(input const &in, lolfx_parser *that)
static void apply(action_input const &in, lolfx_parser *that)
{
that->m_section = in.string().c_str();
}
@@ -184,7 +184,7 @@ struct lolfx_parser::action<lolfx_parser::do_title>
template<>
struct lolfx_parser::action<lolfx_parser::code_section>
{
static void apply(input const &in, lolfx_parser *that)
static void apply(action_input const &in, lolfx_parser *that)
{
that->m_programs[that->m_section] = in.string().c_str();
}


+ 9
- 9
tools/lolremez/expression.h View File

@@ -235,7 +235,7 @@ private:
template<id OP>
struct generic_action
{
static void apply(input const &in, expression *that)
static void apply(action_input const &in, expression *that)
{
UNUSED(in);
that->m_ops.push(OP, -1);
@@ -251,7 +251,7 @@ public:
m_ops.empty();
m_constants.empty();

pegtl::parse<r_stmt, action>(str, "expression", this);
pegtl::parse_string<r_stmt, action>(str, "expression", this);
}
};

@@ -274,9 +274,9 @@ template<> struct expression::action<expression::r_minus> : generic_action<id::m
template<>
struct expression::action<expression::r_binary_call>
{
static void apply(input const &in, expression *that)
static void apply(action_input const &in, expression *that)
{
struct { id id; char const *name; } lut[] =
struct { id ret; char const *name; } lut[] =
{
{ id::atan2, "atan2" },
{ id::pow, "pow" },
@@ -289,7 +289,7 @@ struct expression::action<expression::r_binary_call>
if (strncmp(in.string().c_str(), pair.name, strlen(pair.name)) != 0)
continue;

that->m_ops.push(pair.id, -1);
that->m_ops.push(pair.ret, -1);
return;
}
}
@@ -298,9 +298,9 @@ struct expression::action<expression::r_binary_call>
template<>
struct expression::action<expression::r_unary_call>
{
static void apply(input const &in, expression *that)
static void apply(action_input const &in, expression *that)
{
struct { id id; char const *name; } lut[] =
struct { id ret; char const *name; } lut[] =
{
{ id::abs, "abs" },
{ id::sqrt, "sqrt" },
@@ -326,7 +326,7 @@ struct expression::action<expression::r_unary_call>
if (strncmp(in.string().c_str(), pair.name, strlen(pair.name)) != 0)
continue;

that->m_ops.push(pair.id, -1);
that->m_ops.push(pair.ret, -1);
return;
}
}
@@ -335,7 +335,7 @@ struct expression::action<expression::r_unary_call>
template<>
struct expression::action<expression::r_constant>
{
static void apply(input const &in, expression *that)
static void apply(action_input const &in, expression *that)
{
/* FIXME: check if the constant is already in the list */
that->m_ops.push(id::constant, that->m_constants.count());


Loading…
Cancel
Save