Recovered from cvs revision 2007-09-25 05:49:00
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: Awk.cpp,v 1.33 2007/09/23 16:48:55 bacon Exp $
|
||||
* $Id: Awk.cpp,v 1.34 2007/09/24 08:21:25 bacon Exp $
|
||||
*/
|
||||
|
||||
#include <ase/awk/StdAwk.hpp>
|
||||
@ -91,7 +91,15 @@ public:
|
||||
const char_t* name, size_t len)
|
||||
{
|
||||
long_t x = args[0].toInt();
|
||||
run.setGlobal (idLastSleep, x);
|
||||
|
||||
/*Argument arg;
|
||||
if (run.getGlobal(idLastSleep, arg) == 0)
|
||||
ase_printf (ASE_T("GOOD: [%d]\n"), (int)arg.toInt());
|
||||
else { ase_printf (ASE_T("BAD:\n")); }
|
||||
*/
|
||||
|
||||
if (run.setGlobal (idLastSleep, x) == -1) return -1;
|
||||
|
||||
#ifdef _WIN32
|
||||
::Sleep (x * 1000);
|
||||
return ret.set ((long_t)0);
|
||||
@ -569,7 +577,7 @@ int awk_main (int argc, ase_char_t* argv[])
|
||||
else if (ase_strcmp(argv[i], ASE_T("-a")) == 0) mode = 5;
|
||||
else if (ase_strcmp(argv[i], ASE_T("-m")) == 0) mode = 6;
|
||||
else if (ase_strcmp(argv[i], ASE_T("-w")) == 0) mode = 7;
|
||||
else if (ase_strcmp(argv[i], ASE_T("-ns")) == 0)
|
||||
else if (ase_strcmp(argv[i], ASE_T("-nostripspaces")) == 0)
|
||||
{
|
||||
awk.setOption (awk.getOption () & ~TestAwk::OPT_STRIPSPACES);
|
||||
}
|
||||
@ -577,6 +585,14 @@ int awk_main (int argc, ase_char_t* argv[])
|
||||
{
|
||||
awk.setOption (awk.getOption () & ~TestAwk::OPT_IMPLICIT);
|
||||
}
|
||||
else if (ase_strcmp(argv[i], ASE_T("-noexplicit")) == 0)
|
||||
{
|
||||
awk.setOption (awk.getOption () & ~TestAwk::OPT_EXPLICIT);
|
||||
}
|
||||
else if (ase_strcmp(argv[i], ASE_T("-noshading")) == 0)
|
||||
{
|
||||
awk.setOption (awk.getOption () & ~TestAwk::OPT_SHADING);
|
||||
}
|
||||
else
|
||||
{
|
||||
print_usage (argv[0]);
|
||||
|
@ -16,8 +16,8 @@
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\..\..\release\bin"
|
||||
IntermediateDirectory=".\release\cpp"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)\bin"
|
||||
IntermediateDirectory="$(ConfigurationName)\cpp"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
@ -104,8 +104,98 @@
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="..\..\debug\bin"
|
||||
IntermediateDirectory="debug\cpp"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)\bin"
|
||||
IntermediateDirectory="$(ConfigurationName)\cpp"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\../../debug/bin/aseawk++.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\.."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\debug\cpp\aseawk++.pch"
|
||||
AssemblerListingLocation=""
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="asecmn.lib aseawk.lib aseawk++.lib aseutl.lib"
|
||||
OutputFile="..\..\debug\bin\aseawk++.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="..\..\debug\lib"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug MD|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
@ -221,6 +311,15 @@
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug MD|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
|
@ -16,8 +16,8 @@
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\..\..\release\bin"
|
||||
IntermediateDirectory=".\release"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)\bin"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
@ -102,8 +102,96 @@
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\..\..\debug\bin"
|
||||
IntermediateDirectory=".\debug"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)\bin"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\../../debug/bin/aseawk.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\.."
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="asecmn.lib aseawk.lib aseutl.lib"
|
||||
OutputFile="$(OutDir)\aseawk.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="..\..\debug\lib"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug MD|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
@ -217,6 +305,15 @@
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug MD|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
|
@ -1,6 +1,6 @@
|
||||
#
|
||||
# Taken from the book "The AWK Programming Language"
|
||||
# aseawk++ -si asm.awk -ns -a asm.s
|
||||
# aseawk++ -si asm.awk -nostripspaces -a asm.s
|
||||
#
|
||||
# ASEAWK should turn on STRIPSPACES & BASEONE to run this program.
|
||||
#
|
||||
|
@ -1 +1 @@
|
||||
PARSE ERROR: CODE [56] LINE [2] built-in function 'substr' redefined
|
||||
PARSE ERROR: CODE [56] LINE [2] intrinsic function 'substr' redefined
|
||||
|
@ -1 +1 @@
|
||||
PARSE ERROR: CODE [56] LINE [3] built-in function 'substr' redefined
|
||||
PARSE ERROR: CODE [56] LINE [3] intrinsic function 'substr' redefined
|
||||
|
5
ase/test/awk/err-022.awk
Normal file
5
ase/test/awk/err-022.awk
Normal file
@ -0,0 +1,5 @@
|
||||
global ARGV;
|
||||
|
||||
BEGIN {
|
||||
print ARGC;
|
||||
}
|
1
ase/test/awk/err-022.out
Normal file
1
ase/test/awk/err-022.out
Normal file
@ -0,0 +1 @@
|
||||
PARSE ERROR: CODE [61] LINE [1] duplicate global variable 'ARGV'
|
Reference in New Issue
Block a user