Format script grammar source files
Some checks failed
Build branch / build-all (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled

This commit is contained in:
smallmodel 2025-04-26 19:22:34 +02:00
parent 816126b13a
commit 08a985d183
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
6 changed files with 427 additions and 383 deletions

View file

@ -1,7 +1,7 @@
%{
/*
* ===========================================================================
* Copyright (C) 2015 the OpenMoHAA team
* Copyright (C) 2025 the OpenMoHAA team
*
* This file is part of OpenMoHAA source code.
*

View file

@ -1,3 +1,28 @@
/*
* ===========================================================================
* Copyright (C) 2025 the OpenMoHAA team
*
* This file is part of OpenMoHAA source code.
*
* OpenMoHAA source code is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* OpenMoHAA source code is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenMoHAA source code; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ===========================================================================
*
*
* lex.yy.cpp: original lex generated file (unimplemented)
*/
#include "scriptcompiler.h"
#include <stdio.h>

View file

@ -1,7 +1,7 @@
%{
/*
* ===========================================================================
* Copyright (C) 2015 the OpenMoHAA team
* Copyright (C) 2025 the OpenMoHAA team
*
* This file is part of OpenMoHAA source code.
*
@ -150,8 +150,7 @@ static bool UseField(void)
int n; \
\
c = '*'; \
for(n = 0; n < max_size; n++) \
{ \
for (n = 0; n < max_size; n++) { \
c = *in_ptr++; \
if (!c || c == '\n') { \
break; \
@ -160,12 +159,9 @@ static bool UseField(void)
buf[n] = c; \
} \
\
if (c == '\n') \
{ \
if (c == '\n') { \
buf[n++] = c; \
} \
else if (!c) \
{ \
} else if (!c) { \
in_ptr--; \
} \
\
@ -223,8 +219,6 @@ varname [a-zA-Z0-9_\"$\\]+
yyreducepos(1);
}
\"{string}\"{nonexpr} {
BEGIN(IDENTIFIER);
yymore();
@ -388,7 +382,8 @@ varname [a-zA-Z0-9_\"$\\]+
//
// Implements yywrap to always append a newline to the source
//
int yywrap(void) {
int yywrap(void)
{
if (parseStage == PS_TYPE) {
parseStage = PS_BODY;
in_ptr = start_ptr;
@ -397,10 +392,8 @@ int yywrap(void) {
return 0;
}
if (parseStage == PS_BODY)
{
if (YY_START == C_COMMENT)
{
if (parseStage == PS_BODY) {
if (YY_START == C_COMMENT) {
Compiler.CompileError(success_pos, "unexpected end of file found in comment");
return 1;
}
@ -413,6 +406,7 @@ int yywrap(void) {
return 1;
}
void yy_init_script() {
void yy_init_script()
{
BEGIN(SCRIPT);
}

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2008 the OpenMoHAA team
Copyright (C) 2025 the OpenMoHAA team
This file is part of OpenMoHAA source code.

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2008 the OpenMoHAA team
Copyright (C) 2025 the OpenMoHAA team
This file is part of OpenMoHAA source code.

View file

@ -1,3 +1,28 @@
/*
* ===========================================================================
* Copyright (C) 2025 the OpenMoHAA team
*
* This file is part of OpenMoHAA source code.
*
* OpenMoHAA source code is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* OpenMoHAA source code is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenMoHAA source code; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ===========================================================================
*
*
* y.tab.cpp: original yacc generated file (unimplemented)
*/
#include "../script/scriptcompiler.h"
typedef int yy_state_type;