Mercurial > hg > octave-nkf
changeset 16236:d8c0f46efaf0 classdef
maint: periodic merge of default to classdef
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 09 Mar 2013 17:54:40 -0500 |
parents | d2b268936783 (current diff) c31fd42f9000 (diff) |
children | 90dfd98a915a |
files | libinterp/parse-tree/lex.h libinterp/parse-tree/lex.ll test/classes/classes.tst |
diffstat | 130 files changed, 2608 insertions(+), 1225 deletions(-) [+] |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/Doxyfile @@ -0,0 +1,267 @@ +# -*- mode: conf; -*- + +# Doxyfile for Doxygen 1.7.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for GNU Octave. +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the +# config file that follow. We don't use anything but ASCII, but +# there's no problem using UTF-8 from now on + +DOXYFILE_ENCODING = UTF-8 + +# Who we are. :-) + +PROJECT_NAME = "GNU Octave" + +# The public stable API version (unrelated to the internal API +# version). + +PROJECT_NUMBER = 3.7 + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. + +OUTPUT_DIRECTORY = doc/ + +# Create 4096 sub-directories (in 2 levels) under the output directory +# of each output format and will distribute the generated files over +# these directories. Enabling this option is useful for us, since +# feeding doxygen a huge amount of source files would put all +# generated files in the same directory would otherwise cause +# performance problems for the file system. + +CREATE_SUBDIRS = YES + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. + +OUTPUT_LANGUAGE = English + +# Include brief member descriptions after the members that are listed +# in the file and class documentation (similar to JavaDoc). Set to NO +# to disable this. + +BRIEF_MEMBER_DESC = YES + +# Prepend the brief description of a member or function before the +# detailed description. Note: if both HIDE_UNDOC_MEMBERS and +# BRIEF_MEMBER_DESC are set to NO, the brief descriptions will be +# completely suppressed. + +REPEAT_BRIEF = YES + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# Show inherited members as if they were part of the current class + +INLINE_INHERITED_MEMB = YES + +# Prepend the full path before files name in the file list and in the +# header files. + +FULL_PATH_NAMES = YES + +# Interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description (without needing the @brief +# command). + +JAVADOC_AUTOBRIEF = YES + +# Interpret the first line (until the first dot) of a Qt-style comment +# as the brief descriptio (without needing the \brief command). + +QT_AUTOBRIEF = NO + +# Undocumented member inherits the documentation from any documented +# member that it re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. +# We shouldn't have any tabs in the source code to begin with, however. + +TAB_SIZE = 2 + +# Figure out C++ stdlib classes without needing to parse those files. + +BUILTIN_STL_SUPPORT = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# Assume all entities in documentation are documented, even if no +# documentation was available. + +EXTRACT_ALL = YES + +# Include all private members of a class. + +EXTRACT_PRIVATE = YES + +# Include all static members of a file. + +EXTRACT_STATIC = YES + +# Include classes (and structs) defined locally in source files in the +# documentation. + +EXTRACT_LOCAL_CLASSES = YES + +# We don't use namespaces, but if we did, this would extract the +# anonymous one. + +EXTRACT_ANON_NSPACES = YES + +# Hide internal docs, those with the \internal command. + +INTERNAL_DOCS = NO + +# Case-sensitive filenames + +CASE_SENSE_NAMES = YES + +# List include files with double quotes in the documentation rather +# than with sharp brackets. + +FORCE_LOCAL_INCLUDES = YES + +# Show members alphabetically + +SORT_MEMBER_DOCS = YES + +# Also sort the brief descriptions + +SORT_BRIEF_DOCS = YES + +# Put ctors first. + +SORT_MEMBERS_CTORS_1ST = YES + +# Show which directories the file is in. + +SHOW_DIRECTORIES = YES + +# We don't have namespaces, so don't show them. + +SHOW_NAMESPACES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# Which directories contain Octave source code + +INPUT = src/ liboctave/ libinterp/ + +# Search subdirectories for input. + +RECURSIVE = YES + +# Our examples. + +EXAMPLE_PATH = examples/ + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# There are no extra C++ files in the examples subdir + +EXAMPLE_RECURSIVE = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# Generate a list of source files will be generated. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# For each documented function, list all documented functions +# referencing it. + +REFERENCED_BY_RELATION = YES + +# For each documented function all documented entities called/used by +# that function will be listed. + +REFERENCES_RELATION = YES + +# References link to documenation, not source code. + +REFERENCES_LINK_SOURCE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# Generate HTML + +GENERATE_HTML = YES + +# i.e. doc/doxyhtml + +HTML_OUTPUT = doxyhtml + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# No LaTeX + +GENERATE_LATEX = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# Show undocumented relations + +HIDE_UNDOC_RELATIONS = NO + +# Use dot from graphviz to generate class diagrams. + +HAVE_DOT = YES + +# Remove intermediate dot files. + +DOT_CLEANUP = YES +
--- a/doc/interpreter/io.txi +++ b/doc/interpreter/io.txi @@ -178,10 +178,6 @@ @DOCSTRING(save) -@DOCSTRING(load) - -@DOCSTRING(fileread) - There are three functions that modify the behavior of @code{save}. @DOCSTRING(default_save_options) @@ -190,6 +186,10 @@ @DOCSTRING(save_header_format_string) +@DOCSTRING(load) + +@DOCSTRING(fileread) + @DOCSTRING(native_float_format) It is possible to write data to a file in a similar way to the
--- a/doc/interpreter/testfun.txi +++ b/doc/interpreter/testfun.txi @@ -267,6 +267,45 @@ @end group @end example +@noindent +The following trivial code snippet provides examples for the use of +fail, assert, error and xtest: + +@example +@group +function output = must_be_zero (@var{input}) + if (@var{input} != 0) + error ("Non-zero input!") + endif + output = input; +endfunction + +%!fail ("must_be_zero (1)"); +%!assert (must_be_zero (0), 0); +%!error <Non-zero> must_be_zero (1); +%!xtest error ("This code generates an error"); +@end group +@end example + +@noindent +When putting this a file @file{must_be_zero.m}, and running the test, we see + +@example +@group +test must_be_zero verbose + +@result{} +>>>>> /path/to/must_be_zero.m + ***** fail ("must_be_zero (1)"); + ***** assert (must_be_zero (0), 0); + ***** error <Non-zero> must_be_zero (1); + ***** xtest error ("This code generates an error"); +!!!!! known failure +This code generates an error +PASSES 4 out of 4 tests (1 expected failures) +@end group +@end example + @subsubheading Block type summary: @table @code
--- a/etc/HACKING +++ b/etc/HACKING @@ -21,7 +21,6 @@ - Automake <http://www.gnu.org/software/automake/> - Bison <http://www.gnu.org/software/bison/> - Flex <http://www.gnu.org/software/flex/> - - Git <http://git-scm.com/> - Gnulib <http://www.gnu.org/software/gnulib/> - GNU Make <http://www.gnu.org/software/make/> - Gzip <http://www.gnu.org/software/gzip/>
--- a/libgui/Makefile.am +++ b/libgui/Makefile.am @@ -31,6 +31,7 @@ languages/de_DE.qm \ languages/en_US.qm \ languages/es_ES.qm \ + languages/nl_NL.qm \ languages/pt_BR.qm \ languages/ru_RU.qm \ languages/uk_UA.qm
new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..227c6c5d0d4da9dba6307beddfec61359f373601 GIT binary patch literal 20359 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 B-8}#R
new file mode 100644 --- /dev/null +++ b/libgui/languages/nl_NL.ts @@ -0,0 +1,1074 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="nl_NL"> +<context> + <name>documentation_dock_widget</name> + <message> + <location filename="../src/documentation-dockwidget.cc" line="+34"/> + <source>Documentation</source> + <translation>Documentatie</translation> + </message> +</context> +<context> + <name>file_editor</name> + <message> + <location filename="../src/m-editor/file-editor.cc" line="+146"/> + <location line="+38"/> + <location line="+43"/> + <location line="+26"/> + <source>Octave Editor</source> + <translation></translation> + </message> + <message> + <location line="-106"/> + <source>File %1 is already open in the editor.</source> + <translation>Bestand %1 is al geopend in de editor.</translation> + </message> + <message> + <location line="+38"/> + <source>Could not open file %1 for read: +%2.</source> + <translation>Bestand %1 kon niet geopend worden om te lezen: +%2.</translation> + </message> + <message> + <location line="+43"/> + <source>File not saved! A file with the selected name +%1 +is already open in the editor</source> + <translation>Bestand niet opgeslagen! Een bestand met de naam +%1 +is al geopend in de editor</translation> + </message> + <message> + <location line="+26"/> + <source>The associated file editor tab has disappeared. It was likely closed by some means.</source> + <translation>Het bijbehorende tabblad in de editor is verdwenen. Het is waarschijnlijk op een of andere manier gesloten.</translation> + </message> + <message> + <location line="+141"/> + <source>&%1 %2</source> + <translation></translation> + </message> + <message> + <location line="+130"/> + <source>&New File</source> + <translation>&Nieuw Bestand</translation> + </message> + <message> + <location line="+3"/> + <source>&Open File</source> + <translation>&Openen</translation> + </message> + <message> + <location line="+3"/> + <source>&Save File</source> + <translation>Op&slaan</translation> + </message> + <message> + <location line="+4"/> + <source>Save File &As</source> + <translation>Opslaan &als</translation> + </message> + <message> + <location line="+3"/> + <source>&Undo</source> + <translation>Ongedaan maken</translation> + </message> + <message> + <location line="+3"/> + <source>&Redo</source> + <translation>He&rhalen</translation> + </message> + <message> + <location line="+3"/> + <source>&Copy</source> + <translation>Kopiëren</translation> + </message> + <message> + <location line="+3"/> + <source>Cu&t</source> + <translation>Knippen</translation> + </message> + <message> + <location line="+4"/> + <source>Paste</source> + <translation>Plakken</translation> + </message> + <message> + <location line="+1"/> + <source>&Next Bookmark</source> + <translation>Volge&nde bladwijzer</translation> + </message> + <message> + <location line="+1"/> + <source>Pre&vious Bookmark</source> + <translation>&Vorige bladwijzer</translation> + </message> + <message> + <location line="+1"/> + <source>Toggle &Bookmark</source> + <translation>&Bladwijzer invoegen</translation> + </message> + <message> + <location line="+1"/> + <source>&Remove All Bookmarks</source> + <translation>Alle bladwijzers ve&rwijderen</translation> + </message> + <message> + <location line="+4"/> + <source>&Next breakpoint</source> + <translation>Volge&nd breekpunt</translation> + </message> + <message> + <location line="+3"/> + <source>Pre&vious breakpoint</source> + <translation>&Vorig breekpunt</translation> + </message> + <message> + <location line="+3"/> + <source>Toggle &breakpoint</source> + <translation>&Breekpunt invoegen</translation> + </message> + <message> + <location line="+3"/> + <source>&Remove All breakpoints</source> + <translation>Alle breekpunten ve&rwijderen</translation> + </message> + <message> + <location line="+2"/> + <source>&Comment Selected Text</source> + <translation>Geselecteerde tekst markeren als &commentaar</translation> + </message> + <message> + <location line="+1"/> + <source>&Uncomment Selected Text</source> + <translation>Gelesecteerde tekst niet markeren als commentaar</translation> + </message> + <message> + <location line="+3"/> + <source>&Find and Replace</source> + <translation>Vervangen</translation> + </message> + <message> + <location line="+3"/> + <source>Save File And Run</source> + <translation>Bestand opslaan en uitvoeren</translation> + </message> + <message> + <location line="+51"/> + <source>&File</source> + <translation>Bestand</translation> + </message> + <message> + <location line="+6"/> + <source>Open &Recent</source> + <translation>&Recent bestand openen</translation> + </message> + <message> + <location line="+8"/> + <source>&Edit</source> + <translation>B&ewerken</translation> + </message> + <message> + <location line="+19"/> + <source>&Debug</source> + <translation>&Debuggen</translation> + </message> + <message> + <location line="+9"/> + <source>&Run</source> + <translation>Uitvoe&ren</translation> + </message> +</context> +<context> + <name>file_editor_tab</name> + <message> + <location filename="../src/m-editor/file-editor-tab.cc" line="+687"/> + <location line="+102"/> + <location line="+98"/> + <location line="+63"/> + <location line="+14"/> + <source>Octave Editor</source> + <translation></translation> + </message> + <message> + <location line="-276"/> + <source>The file '%1' has been modified. Do you want to save the changes?</source> + <translation>Het bestand '%1' is aangepast. Wil je de wijzigingen opslaan?</translation> + </message> + <message> + <location line="+102"/> + <source>Could not open file %1 for write: +%2.</source> + <translation>Kon bestand %1 niet openen om te schrijven: +%2.</translation> + </message> + <message> + <location line="+98"/> + <source>File not saved! You've selected a file name + + %1 + +which is the same as the current file name. Use Save to overwrite. (Could allow overwriting, with message, if that is what folks want.)</source> + <translation>Bestand niet opgeslagen! Je hebt een bestandsnaam + + %1 + +gekozen die hetzelfde is als de huidige bestandsnaam. Gebruik Opslaan om te overschrijven.</translation> + </message> + <message> + <location line="+63"/> + <source>It seems that '%1' has been modified by another application. Do you want to reload it?</source> + <translation>Het lijkt erop dat '%1' is aangepast door een ander programma. Wil je het opnieuw laden?</translation> + </message> + <message> + <location line="+14"/> + <source>It seems that '%1' has been deleted or renamed. Do you want to save it now?</source> + <translation>Het lijkt erop dat '%1' verwijderd of hernoemd is. Wil je het nu opslaan?</translation> + </message> +</context> +<context> + <name>files_dock_widget</name> + <message> + <location filename="../src/files-dockwidget.cc" line="+43"/> + <source>Current Directory</source> + <translation>Huidige map</translation> + </message> + <message> + <location line="+11"/> + <source>Move up one directory.</source> + <translation>Een map naar boven gaan.</translation> + </message> + <message> + <location line="+4"/> + <source>Enter the path or filename.</source> + <translation>Voer het pad of de bestandsnaam in.</translation> + </message> + <message> + <location line="+26"/> + <source>Doubleclick a file to open it.</source> + <translation>Dubbelklik op een bestand om te openen.</translation> + </message> +</context> +<context> + <name>find_dialog</name> + <message> + <location filename="../src/m-editor/find-dialog.cc" line="+58"/> + <source>Find &what:</source> + <translation>Zoek naar:</translation> + </message> + <message> + <location line="+3"/> + <source>Re&place with:</source> + <translation>Vervang door:</translation> + </message> + <message> + <location line="+4"/> + <source>Match &case</source> + <translation>Hoofdlettergevoelig</translation> + </message> + <message> + <location line="+1"/> + <source>Search from &start</source> + <translation>Zoek vanaf het begin</translation> + </message> + <message> + <location line="+1"/> + <source>&Wrap while searching</source> + <translation>Bestandseinde negeren</translation> + </message> + <message> + <location line="+2"/> + <source>&Find Next</source> + <translation>Volgende zoeken</translation> + </message> + <message> + <location line="+2"/> + <source>&Replace</source> + <translation>Ve&rvang</translation> + </message> + <message> + <location line="+1"/> + <source>Replace &All</source> + <translation>&Alles vervangen</translation> + </message> + <message> + <location line="+2"/> + <source>&More</source> + <translation>&Meer</translation> + </message> + <message> + <location line="+11"/> + <source>&Whole words</source> + <translation>Hele &woorden</translation> + </message> + <message> + <location line="+1"/> + <source>Regular E&xpressions</source> + <translation>Reguliere e&xpressies</translation> + </message> + <message> + <location line="+1"/> + <source>Search &backward</source> + <translation>Terug zoeken</translation> + </message> + <message> + <location line="+1"/> + <source>Search se&lection</source> + <translation>In se&lectie</translation> + </message> +</context> +<context> + <name>history_dock_widget</name> + <message> + <location filename="../src/history-dockwidget.cc" line="+55"/> + <source>Doubleclick a command to transfer it to the terminal.</source> + <translation>Dubbelklik een commando om het naar de terminal te sturen.</translation> + </message> + <message> + <location line="+6"/> + <source>Enter text to filter the command history.</source> + <translation>Voer text in om de commandogeschiedenis te filteren.</translation> + </message> + <message> + <location line="+4"/> + <source>Command History</source> + <translation>Commandogeschiedenis</translation> + </message> + <message> + <location line="+42"/> + <source>Copy</source> + <translation>Kopiëren</translation> + </message> + <message> + <location line="+1"/> + <source>Evaluate</source> + <translation>Evalueer</translation> + </message> +</context> +<context> + <name>lexer_octave_gui</name> + <message> + <location filename="../src/m-editor/lexer-octave-gui.cc" line="+145"/> + <source>Default</source> + <translation>Standaard</translation> + </message> + <message> + <location line="+2"/> + <source>Comment</source> + <translation>Commentaar</translation> + </message> + <message> + <location line="+2"/> + <source>Command</source> + <translation>Commando</translation> + </message> + <message> + <location line="+2"/> + <source>Number</source> + <translation>Nummer</translation> + </message> + <message> + <location line="+2"/> + <source>Keyword</source> + <translation>Trefwoord</translation> + </message> + <message> + <location line="+2"/> + <source>Single-quoted string</source> + <translation>String met enkele quotes</translation> + </message> + <message> + <location line="+2"/> + <source>Operator</source> + <translation></translation> + </message> + <message> + <location line="+2"/> + <source>Identifier</source> + <translation>Identificator</translation> + </message> + <message> + <location line="+2"/> + <source>Double-quoted string</source> + <translation>String met dubbele quotes</translation> + </message> +</context> +<context> + <name>main_window</name> + <message> + <location filename="../src/main-window.cc" line="+135"/> + <source>Save Workspace</source> + <translation>Werkruimte opslaan</translation> + </message> + <message> + <location line="+11"/> + <source>Load Workspace</source> + <translation>Werkruimte laden</translation> + </message> + <message> + <location line="+155"/> + <source>Set working direcotry</source> + <translation>Werkmap instellen</translation> + </message> + <message> + <location line="+186"/> + <location line="+381"/> + <source>About Octave</source> + <translation>Over Octave</translation> + </message> + <message> + <location line="-290"/> + <source>View the variables in the active workspace.</source> + <translation>Bekijk de variabelen in de huidige werkruimte.</translation> + </message> + <message> + <location line="+2"/> + <source>Browse and search the command history.</source> + <translation>Bladeren en zoeken door de commandogeschiedenis.</translation> + </message> + <message> + <location line="+2"/> + <source>Browse your files.</source> + <translation>Blader door uw bestanden.</translation> + </message> + <message> + <location line="+2"/> + <source>See the documentation for help.</source> + <translation>Zie de documentatie voor hulp.</translation> + </message> + <message> + <location line="+39"/> + <source>&File</source> + <translation>Bestand</translation> + </message> + <message> + <location line="+2"/> + <source>New</source> + <translation>Nieuw</translation> + </message> + <message> + <location line="+3"/> + <source>Script</source> + <translation></translation> + </message> + <message> + <location line="+3"/> + <source>Function</source> + <translation>Functie</translation> + </message> + <message> + <location line="+2"/> + <source>Class</source> + <translation>Klasse</translation> + </message> + <message> + <location line="+2"/> + <source>Enumeration</source> + <translation>Enumeratie</translation> + </message> + <message> + <location line="+2"/> + <source>Figure</source> + <translation>Figuur</translation> + </message> + <message> + <location line="+2"/> + <source>Variable</source> + <translation>Variabele</translation> + </message> + <message> + <location line="+2"/> + <source>Model</source> + <translation></translation> + </message> + <message> + <location line="+2"/> + <source>GUI</source> + <translation></translation> + </message> + <message> + <location line="+4"/> + <source>Open...</source> + <translation></translation> + </message> + <message> + <location line="+4"/> + <source>Close Command Window</source> + <translation>Commandoscherm sluiten</translation> + </message> + <message> + <location line="+6"/> + <source>Import Data...</source> + <translation>Importeer data...</translation> + </message> + <message> + <location line="+4"/> + <source>Save Workspace...</source> + <translation>Werkruimte opslaan...</translation> + </message> + <message> + <location line="+6"/> + <source>Preferences...</source> + <translation>Voorkeuren...</translation> + </message> + <message> + <location line="+3"/> + <source>Page Setup...</source> + <translation>Pagina instellingen...</translation> + </message> + <message> + <location line="+3"/> + <source>Print</source> + <translation></translation> + </message> + <message> + <location line="+4"/> + <source>Print Selection...</source> + <translation>Print selectie...</translation> + </message> + <message> + <location line="+4"/> + <source>Exit</source> + <translation>Sluiten</translation> + </message> + <message> + <location line="+4"/> + <source>&Edit</source> + <translation>B&ewerken</translation> + </message> + <message> + <location line="+2"/> + <source>Undo</source> + <translation>Ongedaan maken</translation> + </message> + <message> + <location line="+4"/> + <source>Redo</source> + <translation>Herhalen</translation> + </message> + <message> + <location line="+5"/> + <source>Cut</source> + <translation>Knippen</translation> + </message> + <message> + <location line="+4"/> + <source>Copy</source> + <translation>Kopiëren</translation> + </message> + <message> + <location line="+4"/> + <source>Paste</source> + <translation>Plakken</translation> + </message> + <message> + <location line="+4"/> + <source>Paste To Workspace...</source> + <translation>Plak naar werkruimte...</translation> + </message> + <message> + <location line="+5"/> + <source>Select All</source> + <translation>Alles selecteren</translation> + </message> + <message> + <location line="+3"/> + <source>Delete</source> + <translation>Verwijderen</translation> + </message> + <message> + <location line="+6"/> + <source>Find...</source> + <translation>Vind...</translation> + </message> + <message> + <location line="+3"/> + <source>Find Files...</source> + <translation>Vind bestanden...</translation> + </message> + <message> + <location line="+7"/> + <source>Clear Command Window</source> + <translation>Wis commandoscherm</translation> + </message> + <message> + <location line="+3"/> + <source>Clear Command History</source> + <translation>Wis commandogeschiedenis</translation> + </message> + <message> + <location line="+2"/> + <source>Clear Workspace</source> + <translation>Wis werkruimte</translation> + </message> + <message> + <location line="+2"/> + <source>De&bug</source> + <translation>De&buggen</translation> + </message> + <message> + <location line="+2"/> + <source>Step</source> + <translation>Stap</translation> + </message> + <message> + <location line="+8"/> + <source>Step in</source> + <translation>Stap in</translation> + </message> + <message> + <location line="+8"/> + <source>Step out</source> + <translation>Stap uit</translation> + </message> + <message> + <location line="+8"/> + <source>Continue</source> + <translation>Doorgaan</translation> + </message> + <message> + <location line="+13"/> + <source>Exit Debug Mode</source> + <translation>Debuggen sluiten</translation> + </message> + <message> + <location line="+10"/> + <source>&Desktop</source> + <translation>Bureaubla&d</translation> + </message> + <message> + <location line="+1"/> + <source>Load workspace</source> + <translation>Werkruimte laden</translation> + </message> + <message> + <location line="+4"/> + <source>&Window</source> + <translation>Scherm</translation> + </message> + <message> + <location line="+2"/> + <source>Show Command Window</source> + <translation>Commandoscherm weergeven</translation> + </message> + <message> + <location line="+6"/> + <source>Show Command History</source> + <translation>Commandogeschiedenis weergeven</translation> + </message> + <message> + <location line="+5"/> + <source>Show Current Directory</source> + <translation>Huidige map weergeven</translation> + </message> + <message> + <location line="+6"/> + <source>Show Workspace</source> + <translation>Werkruimte weergeven</translation> + </message> + <message> + <location line="+5"/> + <source>Show Editor</source> + <translation>Editor weergeven</translation> + </message> + <message> + <location line="+5"/> + <source>Show Documentation</source> + <translation>Documentatie weergeven</translation> + </message> + <message> + <location line="+7"/> + <source>Command Window</source> + <translation>Commandoscherm</translation> + </message> + <message> + <location line="+4"/> + <source>Command History</source> + <translation>Commandogeschiedenis</translation> + </message> + <message> + <location line="+4"/> + <source>Current Directory</source> + <translation>Huidige map</translation> + </message> + <message> + <location line="+4"/> + <source>Workspace</source> + <translation>Werkruimte</translation> + </message> + <message> + <location line="+4"/> + <source>Editor</source> + <translation></translation> + </message> + <message> + <location line="+4"/> + <source>Documentation</source> + <translation>Documentatie</translation> + </message> + <message> + <location line="+5"/> + <source>Reset Windows</source> + <translation>Reset schermen</translation> + </message> + <message> + <location line="+4"/> + <source>&Help</source> + <translation></translation> + </message> + <message> + <location line="+2"/> + <source>Report Bug</source> + <translation>Probleem rapporteren</translation> + </message> + <message> + <location line="+2"/> + <source>Visit Agora</source> + <translation>Bezoek Agora</translation> + </message> + <message> + <location line="+2"/> + <source>Visit Octave Forge</source> + <translation>Bezoek Octave Forge</translation> + </message> + <message> + <location line="+20"/> + <source>Current Directory:</source> + <translation>Huidige map:</translation> + </message> +</context> +<context> + <name>settings_dialog</name> + <message> + <location filename="../src/settings-dialog.ui" line="+29"/> + <location filename="../src/ui-settings-dialog.h" line="+461"/> + <source>Settings</source> + <translation>Instellingen</translation> + </message> + <message> + <location line="+13"/> + <location filename="../src/ui-settings-dialog.h" line="+5"/> + <source>General</source> + <translation>Algemeen</translation> + </message> + <message> + <location line="+18"/> + <location filename="../src/ui-settings-dialog.h" line="-4"/> + <source>Icon set for dock widget</source> + <translation>Icoon ingesteld voor dock widget</translation> + </message> + <message> + <location line="+21"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Octave logo only</source> + <translation>Alleen Octave logo</translation> + </message> + <message> + <location line="+16"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Letter icons</source> + <translation>Letter iconen</translation> + </message> + <message> + <location line="+13"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Graphic icons</source> + <translation>Grafische iconen</translation> + </message> + <message> + <location line="+7"/> + <location filename="../src/ui-settings-dialog.h" line="+11"/> + <source>Editor</source> + <translation></translation> + </message> + <message> + <location line="+10"/> + <location line="+147"/> + <location filename="../src/ui-settings-dialog.h" line="-9"/> + <location line="+10"/> + <source>Font</source> + <translation>Lettertype</translation> + </message> + <message> + <location line="-130"/> + <location line="+147"/> + <location filename="../src/ui-settings-dialog.h" line="-9"/> + <location line="+10"/> + <source>Font Size</source> + <translation>Lettergrootte</translation> + </message> + <message> + <location line="-109"/> + <location filename="../src/ui-settings-dialog.h" line="-9"/> + <source>Show line numbers</source> + <translation>Regelnummers weergeven</translation> + </message> + <message> + <location line="+10"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Highlight current line</source> + <translation>Markeer huidige regel</translation> + </message> + <message> + <location line="+10"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Code completion</source> + <translation>Automatisch aanvullen</translation> + </message> + <message> + <location line="+10"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Show complete path in window title</source> + <translation>Hele pad in schermtitel weergeven</translation> + </message> + <message> + <location line="+7"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Restore tabs from previous session on startup</source> + <translation>Tabbladen van vorige sessie herladen bij opstarten</translation> + </message> + <message> + <location line="+27"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Use custom file editor:</source> + <translation>Gebruik andere bestandeditor:</translation> + </message> + <message> + <location line="+10"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>emacs</source> + <translation></translation> + </message> + <message> + <location line="+10"/> + <location filename="../src/ui-settings-dialog.h" line="+6"/> + <source>Terminal</source> + <translation></translation> + </message> + <message> + <location line="+62"/> + <location filename="../src/ui-settings-dialog.h" line="-2"/> + <source>Cursor type:</source> + <translation></translation> + </message> + <message> + <location line="+27"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Cursor blinking</source> + <translation>Cursor knipperen</translation> + </message> + <message> + <location line="+36"/> + <location filename="../src/ui-settings-dialog.h" line="+8"/> + <source>File Browser</source> + <translation>Bestandsbrowser</translation> + </message> + <message> + <location line="+6"/> + <location filename="../src/ui-settings-dialog.h" line="-6"/> + <source>Show filenames</source> + <translation>Bestandsnamen weergeven</translation> + </message> + <message> + <location line="+7"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Show file size</source> + <translation>Bestandsgrootte weergeven</translation> + </message> + <message> + <location line="+7"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Show file type</source> + <translation>Bestandstype weergeven</translation> + </message> + <message> + <location line="+7"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Show date of last modification</source> + <translation>Datum van laatste aanpassing weergeven</translation> + </message> + <message> + <location line="+7"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Show hidden files</source> + <translation>Verborgen bestanden weergeven</translation> + </message> + <message> + <location line="+7"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Alternating row colors</source> + <translation>Afwisselende regelkleuren</translation> + </message> + <message> + <location line="+21"/> + <location filename="../src/ui-settings-dialog.h" line="+13"/> + <source>Network</source> + <translation>Netwerk</translation> + </message> + <message> + <location line="+6"/> + <location filename="../src/ui-settings-dialog.h" line="-11"/> + <source>Use proxy server</source> + <translation>Gebruik proxyserver</translation> + </message> + <message> + <location line="+12"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Proxy Type:</source> + <translation>Proxy type:</translation> + </message> + <message> + <location line="+11"/> + <location filename="../src/ui-settings-dialog.h" line="+3"/> + <source>HttpProxy</source> + <translation></translation> + </message> + <message> + <location line="+5"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Socks5Proxy</source> + <translation></translation> + </message> + <message> + <location line="+11"/> + <location filename="../src/ui-settings-dialog.h" line="+2"/> + <source>Hostname:</source> + <translation>Hostnaam:</translation> + </message> + <message> + <location line="+17"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Port:</source> + <translation>Poort:</translation> + </message> + <message> + <location line="+17"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Username:</source> + <translation>Gebruikersnaam:</translation> + </message> + <message> + <location line="+17"/> + <location filename="../src/ui-settings-dialog.h" line="+1"/> + <source>Password:</source> + <translation>Wachtwoord:</translation> + </message> +</context> +<context> + <name>terminal_dock_widget</name> + <message> + <location filename="../src/terminal-dockwidget.cc" line="+34"/> + <source>Command Window</source> + <translation>Commandoscherm</translation> + </message> +</context> +<context> + <name>webinfo</name> + <message> + <location filename="../src/qtinfo/webinfo.cc" line="+74"/> + <source>Type here and press 'Return' to search</source> + <translation>Typ hier en druk op 'Enter' om te zoeken</translation> + </message> + <message> + <location line="+4"/> + <source>Global search</source> + <translation>Globaal zoeken</translation> + </message> +</context> +<context> + <name>welcome_wizard</name> + <message> + <location filename="../src/welcome-wizard.ui" line="+26"/> + <location filename="../src/ui-welcome-wizard.h" line="+286"/> + <source>Welcome to GNU Octave</source> + <translation>Welkom bij GNU Octave</translation> + </message> + <message> + <location line="+13"/> + <location filename="../src/ui-welcome-wizard.h" line="+1"/> + <source>It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at '~/.octave-gui'. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file.</source> + <translation>Het lijkt erop dat je de Octave GUI voor de eerste keer opstart op deze computer, omdat er geen configuratiebestand in '~/.octave-gui' gevonden is. Deze wizard zal je begeleiden tijdens het invullen van de belangrijkste instellingen die je zou moeten doen voordat je Octave GUI kan gebruiken. Als je eerder gemaakte instellingen wilt overzetten, sluit dan dit scherm en kopieer het configuratiebestand naar je home map. De aanwezigheid van het bestand zal automatisch gedetecteerd worden en deze wizard overslaan. BELANGRIJK: Deze wizard is nog niet volledig functioneel. Klik door tot het einde voor standaardinstellingen.</translation> + </message> + <message> + <location line="+41"/> + <location line="+50"/> + <location line="+52"/> + <location line="+52"/> + <location filename="../src/ui-welcome-wizard.h" line="+1"/> + <location line="+2"/> + <location line="+2"/> + <location line="+2"/> + <source>Next</source> + <translation>Volgende</translation> + </message> + <message> + <location line="-124"/> + <location line="+52"/> + <location line="+52"/> + <location line="+87"/> + <location filename="../src/ui-welcome-wizard.h" line="-5"/> + <location line="+2"/> + <location line="+2"/> + <location line="+5"/> + <source>Previous</source> + <translation>Vorige</translation> + </message> + <message> + <location line="-45"/> + <location filename="../src/ui-welcome-wizard.h" line="-3"/> + <source>Welcome to Octave!</source> + <translation>Welkom bij Octave!</translation> + </message> + <message> + <location line="+7"/> + <location filename="../src/ui-welcome-wizard.h" line="+1"/> + <source>This is the development version of Octave with the first official GUI.</source> + <translation>Dit is de ontwikkelvariant van Octave met de eerste officiële GUI.</translation> + </message> + <message> + <location line="+10"/> + <location filename="../src/ui-welcome-wizard.h" line="+1"/> + <source>You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click 'Finish' to write a configuration file and launch Octave GUI.</source> + <translation>Het lijkt erop dat je de Octave GUI voor de eerste keer uitvoert op deze computer. Deze assistent zal je helpen het programma te configureren. Klik 'Voltooien' om een configuratiebestand te maken en de Octave GUI te starten.</translation> + </message> + <message> + <location line="+48"/> + <location filename="../src/ui-welcome-wizard.h" line="+2"/> + <source>Finish</source> + <translation>Voltooien</translation> + </message> +</context> +<context> + <name>workspace_model</name> + <message> + <location filename="../src/workspace-model.cc" line="+42"/> + <source>Name</source> + <translation>Naam</translation> + </message> + <message> + <location line="+0"/> + <source>Class</source> + <translation>Klasse</translation> + </message> + <message> + <location line="+0"/> + <source>Dimension</source> + <translation>Dimensie</translation> + </message> + <message> + <location line="+0"/> + <source>Value</source> + <translation>Waarde</translation> + </message> +</context> +<context> + <name>workspace_view</name> + <message> + <location filename="../src/workspace-view.cc" line="+39"/> + <source>Workspace</source> + <translation>Werkruimte</translation> + </message> +</context> +</TS>
--- a/libgui/languages/translators +++ b/libgui/languages/translators @@ -9,3 +9,4 @@ pt_BE Júlio Hoffimann Mendes <julio.hoffimann@gmail.com> ru_RU Andriy Shinkarchuck <adriano32.gnu@gmail.com> uk_UA Andriy Shinkarchuck <adriano32.gnu@gmail.com> +nl_NL Sander van Rijn <svr003@gmail.com>
--- a/libgui/src/octave-adapter/octave-main-thread.cc +++ b/libgui/src/octave-adapter/octave-main-thread.cc @@ -39,7 +39,6 @@ void octave_main_thread::run () { - setlocale (LC_ALL, "en_US.UTF-8"); // Matlab uses "C" locale for LC_NUMERIC class regardless of local setting setlocale (LC_NUMERIC, "C");
--- a/libinterp/interp-core/comment-list.h +++ b/libinterp/interp-core/comment-list.h @@ -42,6 +42,7 @@ { unknown, block, + full_line, end_of_line, doc_string, copyright
--- a/libinterp/interp-core/ls-mat5.cc +++ b/libinterp/interp-core/ls-mat5.cc @@ -514,9 +514,9 @@ if (read_mat5_tag (is, swap, type, element_length)) return retval; // EOF -#ifdef HAVE_ZLIB if (type == miCOMPRESSED) { +#ifdef HAVE_ZLIB // If C++ allowed us direct access to the file descriptor of an // ifstream in a uniform way, the code below could be vastly // simplified, and additional copies of the data in memory @@ -598,8 +598,10 @@ error ("load: error probing size of compressed data element"); return retval; +#else // HAVE_ZLIB + error ("load: zlib unavailable, cannot read compressed data element"); +#endif } -#endif std::streampos pos;
--- a/libinterp/interp-core/mex.cc +++ b/libinterp/interp-core/mex.cc @@ -2950,7 +2950,7 @@ mex context (curr_mex_fcn); - frame.add (mex::cleanup, static_cast<void *> (&context)); + frame.add_fcn (mex::cleanup, static_cast<void *> (&context)); for (int i = 0; i < nargin; i++) argin[i] = context.make_value (args(i));
--- a/libinterp/parse-tree/lex.h +++ b/libinterp/parse-tree/lex.h @@ -23,11 +23,15 @@ #if !defined (octave_lex_h) #define octave_lex_h 1 +#include <deque> +#include <limits> #include <list> #include <set> #include <stack> +#include "comment-list.h" #include "input.h" +#include "token.h" extern OCTINTERP_API void cleanup_parser (void); @@ -52,9 +56,6 @@ stream_reader& operator = (const stream_reader&); }; -// Forward decl for octave_lexer::token_stack. -class token; - // For communication between the lexer and parser. class @@ -159,6 +160,67 @@ std::stack<int> context; }; + + class token_cache + { + public: + + // Store an "unlimited" number of tokens. + token_cache (size_t sz_arg = std::numeric_limits<size_t>::max ()) + : buffer (), sz (sz_arg) + { } + + void push (token *tok) + { + if (buffer.size () == sz) + pop (); + + buffer.push_front (tok); + } + + void pop (void) + { + if (! empty ()) + { + delete buffer.back (); + buffer.pop_back (); + } + } + + // Direct access. + token *at (size_t n) { return buffer.at (n); } + const token *at (size_t n) const { return buffer.at (n); } + + // Most recently pushed. + token *front (void) { return buffer.front (); } + const token *front (void) const { return buffer.front (); } + + token *back (void) { return buffer.back (); } + const token *back (void) const { return buffer.back (); } + + // Number of elements currently in the buffer, max of sz. + size_t size (void) const { return buffer.size (); } + + bool empty (void) const { return buffer.empty (); } + + void clear (void) + { + while (! empty ()) + pop (); + } + + private: + + std::deque<token *> buffer; + + size_t sz; + + // No copying! + + token_cache (const token_cache&); + + token_cache& operator = (const token_cache&); + }; lexical_feedback (void) : end_of_input (false), convert_spaces_to_comma (true), @@ -179,10 +241,10 @@ bracketflag (0), braceflag (0), looping (0), defining_func (0), looking_at_function_handle (0), block_comment_nesting_level (0), token_count (0), - current_input_line (), help_text (), fcn_file_name (), - fcn_file_full_name (), looking_at_object_index (), + current_input_line (), comment_text (), help_text (), + fcn_file_name (), fcn_file_full_name (), looking_at_object_index (), parsed_function_name (), pending_local_variables (), - nesting_level (), token_stack () + nesting_level (), tokens () { init (); } @@ -193,6 +255,8 @@ void reset (void); + int finish_comment (octave_comment_elt::comment_type typ); + // true means that we have encountered eof on the input stream. bool end_of_input; @@ -299,6 +363,9 @@ // The current line of input. std::string current_input_line; + // The current comment text. + std::string comment_text; + // The current help text. std::string help_text; @@ -324,15 +391,11 @@ // a paren? bbp_nesting_level nesting_level; - // Stack to hold tokens so that we can delete them when the parser is - // reset and avoid growing forever just because we are stashing some - // information. - std::stack <token*> token_stack; + // Tokens generated by the lexer. + token_cache tokens; private: - void reset_token_stack (void); - // No copying! lexical_feedback (const lexical_feedback&); @@ -429,13 +492,6 @@ bool is_variable (const std::string& name); - std::string grab_block_comment (stream_reader& reader, bool& eof); - - std::string grab_comment_block (stream_reader& reader, bool at_bol, - bool& eof); - - int process_comment (bool start_in_block, bool& eof); - bool next_token_is_sep_op (void); bool next_token_is_postfix_unary_op (bool spc_prev); @@ -494,7 +550,7 @@ void fatal_error (const char *msg); - void lexer_debug (const char *pattern, const char *text); + void lexer_debug (const char *pattern); // Internal state of the flex-generated lexer. void *scanner; @@ -532,11 +588,41 @@ return input_source () == "eval_string"; } + void push_start_state (int state); + + void pop_start_state (void); + + void clear_start_state (void); + + int start_state (void) const { return start_state_stack.top (); } + + void display_start_state (void) const; + + int handle_op (const char *pattern, int tok, bool convert = false, + bool bos = false, bool qit = false); + + int handle_incompatible_op (const char *pattern, int tok, + bool convert = false, bool bos = false, + bool qit = false); + + int handle_op_internal (const char *pattern, int tok, bool convert, + bool bos, bool qit, bool compat); + + int handle_token (const std::string& name, int tok); + + int handle_token (int tok, token *tok_val = 0); + + int count_token (int tok); + + int show_token (int tok); + // For unwind protect. static void cleanup (octave_lexer *lexer) { delete lexer; } private: + std::stack<int> start_state_stack; + // No copying! octave_lexer (const octave_lexer&);
--- a/libinterp/parse-tree/lex.ll +++ b/libinterp/parse-tree/lex.ll @@ -46,7 +46,10 @@ %s COMMAND_START %s MATRIX_START -%x INPUT_FILE_BEGIN +%x INPUT_FILE_START + +%x BLOCK_COMMENT_START +%x LINE_COMMENT_START %{ @@ -127,100 +130,6 @@ #define YY_FATAL_ERROR(msg) \ (yyget_extra (yyscanner))->fatal_error (msg) -#define DISPLAY_TOK_AND_RETURN(tok) \ - do \ - { \ - int tok_val = tok; \ - if (Vdisplay_tokens) \ - curr_lexer->display_token (tok_val); \ - if (lexer_debug_flag) \ - { \ - std::cerr << "R: "; \ - curr_lexer->display_token (tok_val); \ - std::cerr << std::endl; \ - } \ - return tok_val; \ - } \ - while (0) - -#define COUNT_TOK_AND_RETURN(tok) \ - do \ - { \ - if (tok != '\n') \ - { \ - Vtoken_count++; \ - curr_lexer->token_count++; \ - } \ - DISPLAY_TOK_AND_RETURN (tok); \ - } \ - while (0) - -#define TOK_RETURN(tok) \ - do \ - { \ - curr_lexer->current_input_column += yyleng; \ - curr_lexer->quote_is_transpose = false; \ - curr_lexer->convert_spaces_to_comma = true; \ - COUNT_TOK_AND_RETURN (tok); \ - } \ - while (0) - -#define TOK_PUSH_AND_RETURN(name, tok) \ - do \ - { \ - curr_lexer->push_token \ - (new token (name, curr_lexer->input_line_number, \ - curr_lexer->current_input_column)); \ - TOK_RETURN (tok); \ - } \ - while (0) - -#define BIN_OP_RETURN_INTERNAL(tok, convert, bos, qit) \ - do \ - { \ - curr_lexer->push_token \ - (new token (curr_lexer->input_line_number, \ - curr_lexer->current_input_column)); \ - curr_lexer->current_input_column += yyleng; \ - curr_lexer->quote_is_transpose = qit; \ - curr_lexer->convert_spaces_to_comma = convert; \ - curr_lexer->looking_for_object_index = false; \ - curr_lexer->at_beginning_of_statement = bos; \ - COUNT_TOK_AND_RETURN (tok); \ - } \ - while (0) - -#define XBIN_OP_RETURN_INTERNAL(tok, convert, bos, qit) \ - do \ - { \ - curr_lexer->gripe_matlab_incompatible_operator (yytext); \ - BIN_OP_RETURN_INTERNAL (tok, convert, bos, qit); \ - } \ - while (0) - -#define BIN_OP_RETURN(tok, convert, bos) \ - do \ - { \ - BIN_OP_RETURN_INTERNAL (tok, convert, bos, false); \ - } \ - while (0) - -#define XBIN_OP_RETURN(tok, convert, bos) \ - do \ - { \ - curr_lexer->gripe_matlab_incompatible_operator (yytext); \ - BIN_OP_RETURN (tok, convert, bos); \ - } \ - while (0) - -#define LEXER_DEBUG(pattern) \ - do \ - { \ - if (lexer_debug_flag) \ - curr_lexer->lexer_debug (pattern, yytext); \ - } \ - while (0) - static bool Vdisplay_tokens = false; static unsigned int Vtoken_count = 0; @@ -246,12 +155,12 @@ CCHAR [#%] COMMENT ({CCHAR}.*{NL}) SNLCMT ({SNL}|{COMMENT}) -NOT ((\~)|(\!)) -POW ((\*\*)|(\^)) -EPOW (\.{POW}) IDENT ([_$a-zA-Z][_$a-zA-Z0-9]*) EXPON ([DdEe][+-]?{D}+) NUMBER (({D}+\.?{D}*{EXPON}?)|(\.{D}+{EXPON}?)|(0[xX][0-9a-fA-F]+)) + +ANY_INCLUDING_NL (.|{NL}) + %% %{ @@ -259,17 +168,18 @@ // the parser go down a special path. %} -<INPUT_FILE_BEGIN>. { - LEXER_DEBUG ("<INPUT_FILE_BEGIN>."); - - BEGIN (INITIAL); +<INPUT_FILE_START>{ANY_INCLUDING_NL} { + curr_lexer->lexer_debug ("<INPUT_FILE_START>{ANY_INCLUDING_NL}"); + curr_lexer->xunput (yytext[0]); // May be reset later if we see "function" or "classdef" appears // as the first token. curr_lexer->reading_script_file = true; - DISPLAY_TOK_AND_RETURN (INPUT_FILE); + curr_lexer->pop_start_state (); + + return curr_lexer->show_token (INPUT_FILE); } %{ @@ -277,9 +187,8 @@ %} <COMMAND_START>{NL} { - LEXER_DEBUG ("<COMMAND_START>{NL}"); - - BEGIN (INITIAL); + curr_lexer->lexer_debug ("<COMMAND_START>{NL}"); + curr_lexer->input_line_number++; curr_lexer->current_input_column = 1; @@ -288,43 +197,45 @@ curr_lexer->looking_for_object_index = false; curr_lexer->at_beginning_of_statement = true; - COUNT_TOK_AND_RETURN ('\n'); + curr_lexer->pop_start_state (); + + return curr_lexer->count_token ('\n'); } <COMMAND_START>[\;\,] { - LEXER_DEBUG ("<COMMAND_START>[\\;\\,]"); + curr_lexer->lexer_debug ("<COMMAND_START>[\\;\\,]"); curr_lexer->looking_for_object_index = false; curr_lexer->at_beginning_of_statement = true; - BEGIN (INITIAL); + curr_lexer->pop_start_state (); if (strcmp (yytext, ",") == 0) - TOK_RETURN (','); + return curr_lexer->handle_token (','); else - TOK_RETURN (';'); + return curr_lexer->handle_token (';'); } <COMMAND_START>[\"\'] { - LEXER_DEBUG ("<COMMAND_START>[\\\"\\']"); + curr_lexer->lexer_debug ("<COMMAND_START>[\\\"\\']"); curr_lexer->at_beginning_of_statement = false; curr_lexer->current_input_column++; int tok = curr_lexer->handle_string (yytext[0]); - COUNT_TOK_AND_RETURN (tok); + return curr_lexer->count_token (tok); } <COMMAND_START>[^#% \t\r\n\;\,\"\'][^ \t\r\n\;\,]*{S}* { - LEXER_DEBUG ("<COMMAND_START>[^#% \\t\\r\\n\\;\\,\\\"\\'][^ \\t\\r\\n\\;\\,]*{S}*"); + curr_lexer->lexer_debug ("<COMMAND_START>[^#% \\t\\r\\n\\;\\,\\\"\\'][^ \\t\\r\\n\\;\\,]*{S}*"); std::string tok = strip_trailing_whitespace (yytext); curr_lexer->looking_for_object_index = false; curr_lexer->at_beginning_of_statement = false; - TOK_PUSH_AND_RETURN (tok, SQ_STRING); + return curr_lexer->handle_token (tok, SQ_STRING); } %{ @@ -342,7 +253,7 @@ %} <MATRIX_START>{SNLCMT}*\]{S}* { - LEXER_DEBUG ("<MATRIX_START>{SNLCMT}*\\]{S}*"); + curr_lexer->lexer_debug ("<MATRIX_START>{SNLCMT}*\\]{S}*"); curr_lexer->scan_for_comments (yytext); curr_lexer->fixup_column_count (yytext); @@ -360,7 +271,7 @@ if (spc_gobbled) curr_lexer->xunput (' '); - COUNT_TOK_AND_RETURN (tok_to_return); + return curr_lexer->count_token (tok_to_return); } %{ @@ -368,7 +279,7 @@ %} <MATRIX_START>{SNLCMT}*\}{S}* { - LEXER_DEBUG ("<MATRIX_START>{SNLCMT}*\\}{S}*"); + curr_lexer->lexer_debug ("<MATRIX_START>{SNLCMT}*\\}{S}*"); curr_lexer->scan_for_comments (yytext); curr_lexer->fixup_column_count (yytext); @@ -386,7 +297,7 @@ if (spc_gobbled) curr_lexer->xunput (' '); - COUNT_TOK_AND_RETURN (tok_to_return); + return curr_lexer->count_token (tok_to_return); } %{ @@ -396,7 +307,7 @@ %} <MATRIX_START>{S}*\,{S}* { - LEXER_DEBUG ("<MATRIX_START>{S}*\\,{S}*"); + curr_lexer->lexer_debug ("<MATRIX_START>{S}*\\,{S}*"); curr_lexer->current_input_column += yyleng; @@ -417,7 +328,7 @@ } } - COUNT_TOK_AND_RETURN (','); + return curr_lexer->count_token (','); } %{ @@ -428,7 +339,7 @@ %} <MATRIX_START>{S}+ { - LEXER_DEBUG ("<MATRIX_START>{S}+"); + curr_lexer->lexer_debug ("<MATRIX_START>{S}+"); curr_lexer->current_input_column += yyleng; @@ -459,7 +370,7 @@ curr_lexer->maybe_warn_separator_insert (','); - COUNT_TOK_AND_RETURN (','); + return curr_lexer->count_token (','); } } } @@ -473,7 +384,7 @@ %} <MATRIX_START>{SNLCMT}*;{SNLCMT}* { - LEXER_DEBUG ("<MATRIX_START>{SNLCMT}*;{SNLCMT}*"); + curr_lexer->lexer_debug ("<MATRIX_START>{SNLCMT}*;{SNLCMT}*"); curr_lexer->scan_for_comments (yytext); curr_lexer->fixup_column_count (yytext); @@ -484,7 +395,7 @@ curr_lexer->looking_for_object_index = false; curr_lexer->at_beginning_of_statement = false; - COUNT_TOK_AND_RETURN (';'); + return curr_lexer->count_token (';'); } %{ @@ -497,7 +408,7 @@ <MATRIX_START>{S}*{COMMENT}{SNLCMT}* | <MATRIX_START>{S}*{NL}{SNLCMT}* { - LEXER_DEBUG ("<MATRIX_START>{S}*{COMMENT}{SNLCMT}*|<MATRIX_START>{S}*{NL}{SNLCMT}*"); + curr_lexer->lexer_debug ("<MATRIX_START>{S}*{COMMENT}{SNLCMT}*|<MATRIX_START>{S}*{NL}{SNLCMT}*"); curr_lexer->scan_for_comments (yytext); curr_lexer->fixup_column_count (yytext); @@ -515,12 +426,12 @@ { curr_lexer->maybe_warn_separator_insert (';'); - COUNT_TOK_AND_RETURN (';'); + return curr_lexer->count_token (';'); } } \[{S}* { - LEXER_DEBUG ("\\[{S}*"); + curr_lexer->lexer_debug ("\\[{S}*"); curr_lexer->nesting_level.bracket (); @@ -542,12 +453,14 @@ curr_lexer->eat_whitespace (); curr_lexer->bracketflag++; - BEGIN (MATRIX_START); - COUNT_TOK_AND_RETURN ('['); + + curr_lexer->push_start_state (MATRIX_START); + + return curr_lexer->count_token ('['); } \] { - LEXER_DEBUG ("\\]"); + curr_lexer->lexer_debug ("\\]"); curr_lexer->nesting_level.remove (); @@ -556,7 +469,158 @@ curr_lexer->looking_for_object_index = true; curr_lexer->at_beginning_of_statement = false; - TOK_RETURN (']'); + return curr_lexer->handle_token (']'); + } + +%{ +// Gobble comments. +%} + +%{ +// Start of a block comment. If the comment marker appears immediately +// after a block of full-line comments, finish the full line comment +// block. +%} + +^{S}*{CCHAR}\{{S}*{NL} { + curr_lexer->lexer_debug ("^{S}*{CCHAR}\{{S}*{NL}"); + + int tok = 0; + + if (curr_lexer->start_state () == LINE_COMMENT_START) + { + if (! curr_lexer->comment_text.empty ()) + tok = curr_lexer->finish_comment (octave_comment_elt::full_line); + + curr_lexer->pop_start_state (); + } + + curr_lexer->push_start_state (BLOCK_COMMENT_START); + + yyless (0); + + if (tok > 0) + return curr_lexer->count_token (tok); + } + +<BLOCK_COMMENT_START>^{S}*{CCHAR}\{{S}*{NL} { + curr_lexer->lexer_debug ("<BLOCK_COMMENT_START>^{S}*{CCHAR}\{{S}*{NL}"); + + curr_lexer->input_line_number++; + curr_lexer->current_input_column = 1; + + if (curr_lexer->block_comment_nesting_level) + curr_lexer->comment_text = "\n"; + + curr_lexer->block_comment_nesting_level++; + } + +%{ +// End of a block comment. If this block comment is nested inside +// another, wait for the outermost block comment block to be closed +// before storing the comment. +%} + +<BLOCK_COMMENT_START>^{S}*{CCHAR}\}{S}*{NL} { + curr_lexer->lexer_debug ("<BLOCK_COMMENT_START>^{S}*{CCHAR}\\}{S}*{NL}"); + + curr_lexer->input_line_number++; + curr_lexer->current_input_column = 1; + + int tok = 0; + + if (curr_lexer->block_comment_nesting_level > 1) + curr_lexer->comment_text = "\n"; + else + tok = curr_lexer->finish_comment (octave_comment_elt::block); + + curr_lexer->block_comment_nesting_level--; + curr_lexer->pop_start_state (); + + if (tok > 0) + return curr_lexer->count_token (tok); + } + +%{ +// Body of a block comment. +%} + +<BLOCK_COMMENT_START>.*{NL} { + curr_lexer->lexer_debug ("<BLOCK_COMMENT_START>.*{NL}"); + + curr_lexer->input_line_number++; + curr_lexer->current_input_column = 1; + curr_lexer->comment_text += yytext; + } + +%{ +// Full-line or end-of-line comment. +%} + +{S}*{CCHAR}.*{NL} { + curr_lexer->lexer_debug ("{S}*{CCHAR}.*{NL}"); + + curr_lexer->push_start_state (LINE_COMMENT_START); + yyless (0); + } + +<LINE_COMMENT_START>{S}*{CCHAR}.*{NL} { + curr_lexer->lexer_debug ("<LINE_COMMENT_START>{S}*{CCHAR}.*{NL}"); + + bool full_line_comment = curr_lexer->current_input_column == 1; + curr_lexer->input_line_number++; + curr_lexer->current_input_column = 1; + + size_t len = yyleng; + size_t i = 0; + while (i < len) + { + char c = yytext[i]; + if (c == '#' || c == '%' || c == ' ' || c == '\t') + i++; + else + break; + } + + curr_lexer->comment_text += &yytext[i]; + + int tok = 0; + + if (! full_line_comment) + { + tok = curr_lexer->finish_comment (octave_comment_elt::end_of_line); + + curr_lexer->pop_start_state (); + + if (curr_lexer->start_state () == COMMAND_START) + { + // Allow the actions for the end of a COMMAND line to be + // executed next. + + tok = 0; + curr_lexer->xunput ('\n'); + } + } + + if (tok > 0) + return curr_lexer->count_token (tok); + } + +%{ +// End of a block of full-line comments. +%} + +<LINE_COMMENT_START>{ANY_INCLUDING_NL} { + curr_lexer->lexer_debug ("<LINE_COMMENT_START>{ANY_INCLUDING_NL}"); + + curr_lexer->xunput (yytext[0]); + + int tok = curr_lexer->finish_comment (octave_comment_elt::full_line); + + curr_lexer->pop_start_state (); + + if (tok > 0) + return curr_lexer->count_token (tok); } %{ @@ -564,10 +628,10 @@ %} {NUMBER}{Im} { - LEXER_DEBUG ("{NUMBER}{Im}"); + curr_lexer->lexer_debug ("{NUMBER}{Im}"); curr_lexer->handle_number (); - COUNT_TOK_AND_RETURN (IMAG_NUM); + return curr_lexer->count_token (IMAG_NUM); } %{ @@ -577,9 +641,9 @@ {D}+/\.[\*/\\^\'] | {NUMBER} { - LEXER_DEBUG ("{D}+/\\.[\\*/\\^\\']|{NUMBER}"); + curr_lexer->lexer_debug ("{D}+/\\.[\\*/\\^\\']|{NUMBER}"); curr_lexer->handle_number (); - COUNT_TOK_AND_RETURN (NUM); + return curr_lexer->count_token (NUM); } %{ @@ -597,7 +661,7 @@ {CONT}{S}*{NL} | {CONT}{S}*{COMMENT} { - LEXER_DEBUG ("{CONT}{S}*{NL}|{CONT}{S}*{COMMENT}"); + curr_lexer->lexer_debug ("{CONT}{S}*{NL}|{CONT}{S}*{COMMENT}"); if (yytext[0] == '\\') curr_lexer->gripe_matlab_incompatible_continuation (); @@ -621,12 +685,12 @@ %} {IDENT}{S}* { - LEXER_DEBUG ("{IDENT}{S}*"); + curr_lexer->lexer_debug ("{IDENT}{S}*"); int id_tok = curr_lexer->handle_identifier (); if (id_tok >= 0) - COUNT_TOK_AND_RETURN (id_tok); + return curr_lexer->count_token (id_tok); } %{ @@ -635,7 +699,7 @@ {IDENT}@{IDENT}{S}* | {IDENT}@{IDENT}.{IDENT}{S}* { - LEXER_DEBUG ("{IDENT}@{IDENT}{S}*|{IDENT}@{IDENT}.{IDENT}{S}*"); + curr_lexer->lexer_debug ("{IDENT}@{IDENT}{S}*|{IDENT}@{IDENT}.{IDENT}{S}*"); int id_tok = curr_lexer->handle_superclass_identifier (); @@ -643,7 +707,7 @@ { curr_lexer->looking_for_object_index = true; - COUNT_TOK_AND_RETURN (id_tok); + return curr_lexer->count_token (id_tok); } } @@ -653,7 +717,7 @@ \?{IDENT}{S}* | \?{IDENT}\.{IDENT}{S}* { - LEXER_DEBUG ("\\?{IDENT}{S}*|\\?{IDENT}\\.{IDENT}{S}*"); + curr_lexer->lexer_debug ("\\?{IDENT}{S}*|\\?{IDENT}\\.{IDENT}{S}*"); int id_tok = curr_lexer->handle_meta_identifier (); @@ -661,7 +725,7 @@ { curr_lexer->looking_for_object_index = true; - COUNT_TOK_AND_RETURN (id_tok); + return curr_lexer->count_token (id_tok); } } @@ -670,7 +734,7 @@ %} "@" { - LEXER_DEBUG ("@"); + curr_lexer->lexer_debug ("@"); curr_lexer->current_input_column++; @@ -680,7 +744,7 @@ curr_lexer->looking_for_object_index = false; curr_lexer->at_beginning_of_statement = false; - COUNT_TOK_AND_RETURN ('@'); + return curr_lexer->count_token ('@'); } @@ -691,7 +755,7 @@ %} {NL} { - LEXER_DEBUG ("{NL}"); + curr_lexer->lexer_debug ("{NL}"); curr_lexer->input_line_number++; curr_lexer->current_input_column = 1; @@ -702,7 +766,7 @@ if (curr_lexer->nesting_level.none ()) { curr_lexer->at_beginning_of_statement = true; - COUNT_TOK_AND_RETURN ('\n'); + return curr_lexer->count_token ('\n'); } else if (curr_lexer->nesting_level.is_paren ()) { @@ -719,7 +783,7 @@ %} "'" { - LEXER_DEBUG ("'"); + curr_lexer->lexer_debug ("'"); curr_lexer->current_input_column++; curr_lexer->convert_spaces_to_comma = true; @@ -727,12 +791,12 @@ if (curr_lexer->quote_is_transpose) { curr_lexer->do_comma_insert_check (); - COUNT_TOK_AND_RETURN (QUOTE); + return curr_lexer->count_token (QUOTE); } else { int tok = curr_lexer->handle_string ('\''); - COUNT_TOK_AND_RETURN (tok); + return curr_lexer->count_token (tok); } } @@ -741,103 +805,76 @@ %} \" { - LEXER_DEBUG ("\""); + curr_lexer->lexer_debug ("\""); curr_lexer->current_input_column++; int tok = curr_lexer->handle_string ('"'); - COUNT_TOK_AND_RETURN (tok); + return curr_lexer->count_token (tok); } %{ -// Gobble comments. -%} - -{CCHAR} { - LEXER_DEBUG ("{CCHAR}"); - - curr_lexer->looking_for_object_index = false; - - curr_lexer->xunput (yytext[0]); - - bool eof = false; - int tok = curr_lexer->process_comment (false, eof); - - if (eof) - return curr_lexer->handle_end_of_input (); - else if (tok > 0) - COUNT_TOK_AND_RETURN (tok); - } - -%{ -// Block comments. -%} - -^{S}*{CCHAR}\{{S}*{NL} { - LEXER_DEBUG ("^{S}*{CCHAR}\\{{S}*{NL}"); - - curr_lexer->looking_for_object_index = false; - - curr_lexer->input_line_number++; - curr_lexer->current_input_column = 1; - curr_lexer->block_comment_nesting_level++; - curr_lexer->decrement_promptflag (); - - bool eof = false; - curr_lexer->process_comment (true, eof); - } - -%{ // Other operators. %} -":" { LEXER_DEBUG (":"); BIN_OP_RETURN (':', false, false); } - -".+" { LEXER_DEBUG (".+"); XBIN_OP_RETURN (EPLUS, false, false); } -".-" { LEXER_DEBUG (".-"); XBIN_OP_RETURN (EMINUS, false, false); } -".*" { LEXER_DEBUG (".*"); BIN_OP_RETURN (EMUL, false, false); } -"./" { LEXER_DEBUG ("./"); BIN_OP_RETURN (EDIV, false, false); } -".\\" { LEXER_DEBUG (".\\"); BIN_OP_RETURN (ELEFTDIV, false, false); } -".^" { LEXER_DEBUG (".^"); BIN_OP_RETURN (EPOW, false, false); } -".**" { LEXER_DEBUG (".**"); XBIN_OP_RETURN (EPOW, false, false); } -".'" { LEXER_DEBUG (".'"); curr_lexer->do_comma_insert_check (); BIN_OP_RETURN (TRANSPOSE, true, false); } -"++" { LEXER_DEBUG ("++"); curr_lexer->do_comma_insert_check (); XBIN_OP_RETURN_INTERNAL (PLUS_PLUS, true, false, true); } -"--" { LEXER_DEBUG ("--"); curr_lexer->do_comma_insert_check (); XBIN_OP_RETURN_INTERNAL (MINUS_MINUS, true, false, true); } -"<=" { LEXER_DEBUG ("<="); BIN_OP_RETURN (EXPR_LE, false, false); } -"==" { LEXER_DEBUG ("=="); BIN_OP_RETURN (EXPR_EQ, false, false); } -"~=" { LEXER_DEBUG ("~="); BIN_OP_RETURN (EXPR_NE, false, false); } -"!=" { LEXER_DEBUG ("!="); XBIN_OP_RETURN (EXPR_NE, false, false); } -">=" { LEXER_DEBUG (">="); BIN_OP_RETURN (EXPR_GE, false, false); } -"&" { LEXER_DEBUG ("&"); BIN_OP_RETURN (EXPR_AND, false, false); } -"|" { LEXER_DEBUG ("|"); BIN_OP_RETURN (EXPR_OR, false, false); } -"<" { LEXER_DEBUG ("<"); BIN_OP_RETURN (EXPR_LT, false, false); } -">" { LEXER_DEBUG (">"); BIN_OP_RETURN (EXPR_GT, false, false); } -"+" { LEXER_DEBUG ("+"); BIN_OP_RETURN ('+', false, false); } -"-" { LEXER_DEBUG ("-"); BIN_OP_RETURN ('-', false, false); } -"*" { LEXER_DEBUG ("*"); BIN_OP_RETURN ('*', false, false); } -"/" { LEXER_DEBUG ("/"); BIN_OP_RETURN ('/', false, false); } -"\\" { LEXER_DEBUG ("\\"); BIN_OP_RETURN (LEFTDIV, false, false); } -";" { LEXER_DEBUG (";"); BIN_OP_RETURN (';', true, true); } -"," { LEXER_DEBUG (","); BIN_OP_RETURN (',', true, ! curr_lexer->looking_at_object_index.front ()); } -"^" { LEXER_DEBUG ("^"); BIN_OP_RETURN (POW, false, false); } -"**" { LEXER_DEBUG ("**"); XBIN_OP_RETURN (POW, false, false); } -"=" { LEXER_DEBUG ("="); BIN_OP_RETURN ('=', true, false); } -"&&" { LEXER_DEBUG ("&&"); BIN_OP_RETURN (EXPR_AND_AND, false, false); } -"||" { LEXER_DEBUG ("||"); BIN_OP_RETURN (EXPR_OR_OR, false, false); } -"<<" { LEXER_DEBUG ("<<"); XBIN_OP_RETURN (LSHIFT, false, false); } -">>" { LEXER_DEBUG (">>"); XBIN_OP_RETURN (RSHIFT, false, false); } - -{NOT} { - LEXER_DEBUG ("{NOT}"); - - if (yytext[0] == '~') - BIN_OP_RETURN (EXPR_NOT, false, false); - else - XBIN_OP_RETURN (EXPR_NOT, false, false); +":" { return curr_lexer->handle_op (":", ':'); } +".+" { return curr_lexer->handle_incompatible_op (".+", EPLUS); } +".-" { return curr_lexer->handle_incompatible_op (".-", EMINUS); } +".*" { return curr_lexer->handle_op (".*", EMUL); } +"./" { return curr_lexer->handle_op ("./", EDIV); } +".\\" { return curr_lexer->handle_op (".\\", ELEFTDIV); } +".^" { return curr_lexer->handle_op (".^", EPOW); } +".**" { return curr_lexer->handle_incompatible_op (".**", EPOW); } +"<=" { return curr_lexer->handle_op ("<=", EXPR_LE); } +"==" { return curr_lexer->handle_op ("==", EXPR_EQ); } +"~=" { return curr_lexer->handle_op ("~=", EXPR_NE); } +"!=" { return curr_lexer->handle_incompatible_op ("!=", EXPR_NE); } +">=" { return curr_lexer->handle_op (">=", EXPR_GE); } +"&" { return curr_lexer->handle_op ("&", EXPR_AND); } +"|" { return curr_lexer->handle_op ("|", EXPR_OR); } +"<" { return curr_lexer->handle_op ("<", EXPR_LT); } +">" { return curr_lexer->handle_op (">", EXPR_GT); } +"+" { return curr_lexer->handle_op ("+", '+'); } +"-" { return curr_lexer->handle_op ("-", '-'); } +"*" { return curr_lexer->handle_op ("*", '*'); } +"/" { return curr_lexer->handle_op ("/", '/'); } +"\\" { return curr_lexer->handle_op ("\\", LEFTDIV); } +"^" { return curr_lexer->handle_op ("^", POW); } +"**" { return curr_lexer->handle_incompatible_op ("**", POW); } +"=" { return curr_lexer->handle_op ("=", '=', true, false); } +"&&" { return curr_lexer->handle_op ("&&", EXPR_AND_AND); } +"||" { return curr_lexer->handle_op ("||", EXPR_OR_OR); } +"<<" { return curr_lexer->handle_incompatible_op ("<<", LSHIFT); } +">>" { return curr_lexer->handle_incompatible_op (">>", RSHIFT); } +"~" { return curr_lexer->handle_op ("~", EXPR_NOT); } +"!" { return curr_lexer->handle_incompatible_op ("!", EXPR_NOT); } +";" { return curr_lexer->handle_op (";", ';', true, true); } + +"," { + return curr_lexer->handle_op + (",", ',', true, ! curr_lexer->looking_at_object_index.front ()); + } + +".'" { + curr_lexer->do_comma_insert_check (); + return curr_lexer->handle_op (".'", TRANSPOSE, true, false); + } + +"++" { + curr_lexer->do_comma_insert_check (); + return curr_lexer->handle_incompatible_op + ("++", PLUS_PLUS, true, false, true); + } + +"--" { + ; + curr_lexer->do_comma_insert_check (); + return curr_lexer->handle_incompatible_op + ("--", MINUS_MINUS, true, false, true); } "(" { - LEXER_DEBUG ("("); + curr_lexer->lexer_debug ("("); // If we are looking for an object index, then push TRUE for // looking_at_object_index. Otherwise, just push whatever state @@ -854,11 +891,11 @@ curr_lexer->nesting_level.paren (); curr_lexer->decrement_promptflag (); - TOK_RETURN ('('); + return curr_lexer->handle_token ('('); } ")" { - LEXER_DEBUG (")"); + curr_lexer->lexer_debug (")"); curr_lexer->nesting_level.remove (); curr_lexer->current_input_column++; @@ -877,37 +914,43 @@ curr_lexer->do_comma_insert_check (); - COUNT_TOK_AND_RETURN (')'); + return curr_lexer->count_token (')'); } "." { - LEXER_DEBUG ("."); + curr_lexer->lexer_debug ("."); curr_lexer->looking_for_object_index = false; curr_lexer->at_beginning_of_statement = false; - TOK_RETURN ('.'); + return curr_lexer->handle_token ('.'); } -"+=" { LEXER_DEBUG ("+="); XBIN_OP_RETURN (ADD_EQ, false, false); } -"-=" { LEXER_DEBUG ("-="); XBIN_OP_RETURN (SUB_EQ, false, false); } -"*=" { LEXER_DEBUG ("*="); XBIN_OP_RETURN (MUL_EQ, false, false); } -"/=" { LEXER_DEBUG ("/="); XBIN_OP_RETURN (DIV_EQ, false, false); } -"\\=" { LEXER_DEBUG ("\\="); XBIN_OP_RETURN (LEFTDIV_EQ, false, false); } -".+=" { LEXER_DEBUG (".+="); XBIN_OP_RETURN (ADD_EQ, false, false); } -".-=" { LEXER_DEBUG (".-="); XBIN_OP_RETURN (SUB_EQ, false, false); } -".*=" { LEXER_DEBUG (".*="); XBIN_OP_RETURN (EMUL_EQ, false, false); } -"./=" { LEXER_DEBUG ("./="); XBIN_OP_RETURN (EDIV_EQ, false, false); } -".\\=" { LEXER_DEBUG (".\\="); XBIN_OP_RETURN (ELEFTDIV_EQ, false, false); } -{POW}= { LEXER_DEBUG ("{POW}="); XBIN_OP_RETURN (POW_EQ, false, false); } -{EPOW}= { LEXER_DEBUG ("{EPOW}="); XBIN_OP_RETURN (EPOW_EQ, false, false); } -"&=" { LEXER_DEBUG ("&="); XBIN_OP_RETURN (AND_EQ, false, false); } -"|=" { LEXER_DEBUG ("|="); XBIN_OP_RETURN (OR_EQ, false, false); } -"<<=" { LEXER_DEBUG ("<<="); XBIN_OP_RETURN (LSHIFT_EQ, false, false); } -">>=" { LEXER_DEBUG (">>="); XBIN_OP_RETURN (RSHIFT_EQ, false, false); } +%{ +// op= operators. +%} + +"+=" { return curr_lexer->handle_incompatible_op ("+=", ADD_EQ); } +"-=" { return curr_lexer->handle_incompatible_op ("-=", SUB_EQ); } +"*=" { return curr_lexer->handle_incompatible_op ("*=", MUL_EQ); } +"/=" { return curr_lexer->handle_incompatible_op ("/=", DIV_EQ); } +"\\=" { return curr_lexer->handle_incompatible_op ("\\=", LEFTDIV_EQ); } +".+=" { return curr_lexer->handle_incompatible_op (".+=", ADD_EQ); } +".-=" { return curr_lexer->handle_incompatible_op (".-=", SUB_EQ); } +".*=" { return curr_lexer->handle_incompatible_op (".*=", EMUL_EQ); } +"./=" { return curr_lexer->handle_incompatible_op ("./=", EDIV_EQ); } +".\\=" { return curr_lexer->handle_incompatible_op (".\\=", ELEFTDIV_EQ); } +"^=" { return curr_lexer->handle_incompatible_op ("^=", POW_EQ); } +"**=" { return curr_lexer->handle_incompatible_op ("^=", POW_EQ); } +".^=" { return curr_lexer->handle_incompatible_op (".^=", EPOW_EQ); } +".**=" { return curr_lexer->handle_incompatible_op (".^=", EPOW_EQ); } +"&=" { return curr_lexer->handle_incompatible_op ("&=", AND_EQ); } +"|=" { return curr_lexer->handle_incompatible_op ("|=", OR_EQ); } +"<<=" { return curr_lexer->handle_incompatible_op ("<<=", LSHIFT_EQ); } +">>=" { return curr_lexer->handle_incompatible_op (">>=", RSHIFT_EQ); } \{{S}* { - LEXER_DEBUG ("\\{{S}*"); + curr_lexer->lexer_debug ("\\{{S}*"); curr_lexer->nesting_level.brace (); @@ -924,12 +967,14 @@ curr_lexer->eat_whitespace (); curr_lexer->braceflag++; - BEGIN (MATRIX_START); - COUNT_TOK_AND_RETURN ('{'); + + curr_lexer->push_start_state (MATRIX_START); + + return curr_lexer->count_token ('{'); } "}" { - LEXER_DEBUG ("}"); + curr_lexer->lexer_debug ("}"); curr_lexer->looking_at_object_index.pop_front (); @@ -938,7 +983,7 @@ curr_lexer->nesting_level.remove (); - TOK_RETURN ('}'); + return curr_lexer->handle_token ('}'); } %{ @@ -946,7 +991,7 @@ %} . { - LEXER_DEBUG ("."); + curr_lexer->lexer_debug ("."); curr_lexer->xunput (yytext[0]); @@ -1294,7 +1339,7 @@ lexical_feedback::~lexical_feedback (void) { - reset_token_stack (); + tokens.clear (); } void @@ -1340,6 +1385,7 @@ block_comment_nesting_level = 0; token_count = 0; current_input_line = ""; + comment_text = ""; help_text = ""; fcn_file_name = ""; fcn_file_full_name = ""; @@ -1353,20 +1399,52 @@ nesting_level.reset (); - reset_token_stack (); + tokens.clear (); } -void -lexical_feedback::reset_token_stack (void) +static bool +looks_like_copyright (const std::string& s) +{ + bool retval = false; + + if (! s.empty ()) + { + size_t offset = s.find_first_not_of (" \t"); + + retval = (s.substr (offset, 9) == "Copyright" || s.substr (offset, 6) == "Author"); + } + + return retval; +} + +int +lexical_feedback::finish_comment (octave_comment_elt::comment_type typ) { - // Clear out the stack of token info used to track line and - // column numbers. - - while (! token_stack.empty ()) - { - delete token_stack.top (); - token_stack.pop (); - } + bool copyright = looks_like_copyright (comment_text); + + if (nesting_level.none () && help_text.empty () + && ! comment_text.empty () && ! copyright) + help_text = comment_text; + + if (copyright) + typ = octave_comment_elt::copyright; + + octave_comment_buffer::append (comment_text, typ); + + comment_text = ""; + + quote_is_transpose = false; + convert_spaces_to_comma = true; + at_beginning_of_statement = true; + + if (nesting_level.none ()) + return '\n'; + else if (nesting_level.is_bracket_or_brace ()) + // FIXME -- this result will be different if the comment follows a + // continuation token. + return ';'; + else + return 0; } void @@ -1426,13 +1504,15 @@ // Make octave_lexer object available through yyextra in // flex-generated lexer. yyset_extra (this, scanner); + + clear_start_state (); } // Inside Flex-generated functions, yyg is the scanner cast to its real -// type. The BEGIN macro uses yyg and we want to use that in -// octave_lexer member functions. If we could set the start state -// by calling a function instead of using the BEGIN macro, we could -// eliminate the OCTAVE_YYG macro. +// type. Some flex macros that we use in octave_lexer member functions +// (for example, BEGIN) use yyg. If we could perform the actions of +// these macros with functions instead, we could eliminate the +// OCTAVE_YYG macro. #define OCTAVE_YYG \ struct yyguts_t *yyg = static_cast<struct yyguts_t*> (scanner) @@ -1440,10 +1520,8 @@ void octave_lexer::reset (void) { - OCTAVE_YYG; - // Start off on the right foot. - BEGIN (INITIAL); + clear_start_state (); parser_symtab_context.clear (); @@ -1469,9 +1547,9 @@ void octave_lexer::prep_for_file (void) { - OCTAVE_YYG; - - BEGIN (INPUT_FILE_BEGIN); + reading_script_file = true; + + push_start_state (INPUT_FILE_START); } int @@ -1502,11 +1580,7 @@ int octave_lexer::handle_end_of_input (void) { - // FIXME -- we need this because of the way TOK_RETURN is defined. DO - // something better than that... - OCTAVE_YYG; - - LEXER_DEBUG ("<<EOF>>"); + lexer_debug ("<<EOF>>"); if (block_comment_nesting_level != 0) { @@ -1518,7 +1592,7 @@ input_line_number, fcn_file_name.c_str ()); } - TOK_RETURN (END_OF_INPUT); + return handle_token (END_OF_INPUT); } char * @@ -1893,309 +1967,6 @@ != pending_local_variables.end ())); } -std::string -octave_lexer::grab_block_comment (stream_reader& reader, bool& eof) -{ - std::string buf; - - bool at_bol = true; - bool look_for_marker = false; - - bool warned_incompatible = false; - - int c = 0; - - while ((c = reader.getc ()) != EOF) - { - current_input_column++; - - if (look_for_marker) - { - at_bol = false; - look_for_marker = false; - - if (c == '{' || c == '}') - { - std::string tmp_buf (1, static_cast<char> (c)); - - int type = c; - - bool done = false; - - while ((c = reader.getc ()) != EOF && ! done) - { - current_input_column++; - - switch (c) - { - case ' ': - case '\t': - tmp_buf += static_cast<char> (c); - break; - - case '\n': - { - current_input_column = 0; - at_bol = true; - done = true; - - if (type == '{') - { - block_comment_nesting_level++; - decrement_promptflag (); - } - else - { - block_comment_nesting_level--; - increment_promptflag (); - - if (block_comment_nesting_level == 0) - { - buf += grab_comment_block (reader, true, eof); - - return buf; - } - } - } - break; - - default: - at_bol = false; - tmp_buf += static_cast<char> (c); - buf += tmp_buf; - done = true; - break; - } - } - } - } - - if (at_bol && (c == '%' || c == '#')) - { - if (c == '#' && ! warned_incompatible) - { - warned_incompatible = true; - maybe_gripe_matlab_incompatible_comment (c); - } - - at_bol = false; - look_for_marker = true; - } - else - { - buf += static_cast<char> (c); - - if (c == '\n') - { - current_input_column = 0; - at_bol = true; - } - } - } - - if (c == EOF) - eof = true; - - return buf; -} - -std::string -octave_lexer::grab_comment_block (stream_reader& reader, bool at_bol, - bool& eof) -{ - std::string buf; - - // TRUE means we are at the beginning of a comment block. - bool begin_comment = false; - - // TRUE means we are currently reading a comment block. - bool in_comment = false; - - bool warned_incompatible = false; - - int c = 0; - - while ((c = reader.getc ()) != EOF) - { - current_input_column++; - - if (begin_comment) - { - if (c == '%' || c == '#') - { - at_bol = false; - continue; - } - else if (at_bol && c == '{') - { - std::string tmp_buf (1, static_cast<char> (c)); - - bool done = false; - - while ((c = reader.getc ()) != EOF && ! done) - { - current_input_column++; - - switch (c) - { - case ' ': - case '\t': - tmp_buf += static_cast<char> (c); - break; - - case '\n': - { - current_input_column = 0; - at_bol = true; - done = true; - - block_comment_nesting_level++; - decrement_promptflag (); - - buf += grab_block_comment (reader, eof); - - in_comment = false; - - if (eof) - goto done; - } - break; - - default: - at_bol = false; - tmp_buf += static_cast<char> (c); - buf += tmp_buf; - done = true; - break; - } - } - } - else - { - at_bol = false; - begin_comment = false; - } - } - - if (in_comment) - { - buf += static_cast<char> (c); - - if (c == '\n') - { - at_bol = true; - current_input_column = 0; - in_comment = false; - - // FIXME -- bailing out here prevents things like - // - // octave> # comment - // octave> x = 1 - // - // from failing at the command line, while still - // allowing blocks of comments to be grabbed properly - // for function doc strings. But only the first line of - // a mult-line doc string will be picked up for - // functions defined on the command line. We need a - // better way of collecting these comments... - if (! (reading_fcn_file || reading_script_file)) - goto done; - } - } - else - { - switch (c) - { - case ' ': - case '\t': - break; - - case '#': - if (! warned_incompatible) - { - warned_incompatible = true; - maybe_gripe_matlab_incompatible_comment (c); - } - // fall through... - - case '%': - in_comment = true; - begin_comment = true; - break; - - default: - current_input_column--; - reader.ungetc (c); - goto done; - } - } - } - - done: - - if (c == EOF) - eof = true; - - return buf; -} - -static bool -looks_like_copyright (const std::string& s) -{ - bool retval = false; - - if (! s.empty ()) - { - size_t offset = s.find_first_not_of (" \t"); - - retval = (s.substr (offset, 9) == "Copyright" || s.substr (offset, 6) == "Author"); - } - - return retval; -} - -int -octave_lexer::process_comment (bool start_in_block, bool& eof) -{ - OCTAVE_YYG; - - eof = false; - - char *yytxt = flex_yytext (); - flex_stream_reader flex_reader (this, yytxt); - - // process_comment is only supposed to be called when we are not - // initially looking at a block comment. - - std::string txt = start_in_block - ? grab_block_comment (flex_reader, eof) - : grab_comment_block (flex_reader, false, eof); - - if (lexer_debug_flag) - std::cerr << "C: " << txt << std::endl; - - if (nesting_level.none () && help_text.empty () && ! txt.empty () - && ! looks_like_copyright (txt)) - help_text = txt; - - octave_comment_buffer::append (txt); - - current_input_column = 1; - quote_is_transpose = false; - convert_spaces_to_comma = true; - at_beginning_of_statement = true; - - if (YY_START == COMMAND_START) - BEGIN (INITIAL); - - if (nesting_level.none ()) - return '\n'; - else if (nesting_level.is_bracket_or_brace ()) - return ';'; - else - return 0; -} - // Recognize separators. If the separator is a CRLF pair, it is // replaced by a single LF. @@ -2912,8 +2683,6 @@ int octave_lexer::handle_close_bracket (bool spc_gobbled, int bracket_type) { - OCTAVE_YYG; - int retval = bracket_type; if (! nesting_level.none ()) @@ -2928,8 +2697,7 @@ panic_impossible (); } - if (bracketflag == 0 && braceflag == 0) - BEGIN (INITIAL); + pop_start_state (); if (bracket_type == ']' && next_token_is_assign_op () @@ -3366,8 +3134,6 @@ int octave_lexer::handle_identifier (void) { - OCTAVE_YYG; - bool at_bos = at_beginning_of_statement; char *yytxt = flex_yytext (); @@ -3485,7 +3251,7 @@ if (at_bos && spc_gobbled && can_be_command (tok) && looks_like_command_arg ()) { - BEGIN (COMMAND_START); + push_start_state (COMMAND_START); } else if (next_tok_is_eq || looking_at_decl_list @@ -3515,7 +3281,7 @@ convert_spaces_to_comma = true; - if (! (next_tok_is_eq || YY_START == COMMAND_START)) + if (! (next_tok_is_eq || start_state () == COMMAND_START)) { quote_is_transpose = true; @@ -3605,7 +3371,7 @@ { YYSTYPE *lval = yyget_lval (scanner); lval->tok_val = tok; - token_stack.push (tok); + tokens.push (tok); } token * @@ -3752,12 +3518,65 @@ } } -static void -display_state (int state) +void +octave_lexer::fatal_error (const char *msg) +{ + error (msg); + + OCTAVE_QUIT; + + yy_fatal_error (msg, scanner); +} + +void +octave_lexer::lexer_debug (const char *pattern) +{ + if (lexer_debug_flag) + { + std::cerr << std::endl; + + display_start_state (); + + std::cerr << "P: " << pattern << std::endl; + std::cerr << "T: " << flex_yytext () << std::endl; + } +} + +void +octave_lexer::push_start_state (int state) +{ + OCTAVE_YYG; + + start_state_stack.push (state); + + BEGIN (start_state ()); +} + +void +octave_lexer::pop_start_state (void) +{ + OCTAVE_YYG; + + start_state_stack.pop (); + + BEGIN (start_state ()); +} + +void +octave_lexer::clear_start_state (void) +{ + while (! start_state_stack.empty ()) + start_state_stack.pop (); + + push_start_state (INITIAL); +} + +void +octave_lexer::display_start_state (void) const { std::cerr << "S: "; - switch (state) + switch (start_state ()) { case INITIAL: std::cerr << "INITIAL" << std::endl; @@ -3771,35 +3590,105 @@ std::cerr << "MATRIX_START" << std::endl; break; - case INPUT_FILE_BEGIN: + case INPUT_FILE_START: std::cerr << "INPUT_FILE_BEGIN" << std::endl; break; + case BLOCK_COMMENT_START: + std::cerr << "BLOCK_COMMENT_START" << std::endl; + break; + + case LINE_COMMENT_START: + std::cerr << "LINE_COMMENT_START" << std::endl; + break; + default: std::cerr << "UNKNOWN START STATE!" << std::endl; break; } } -void -octave_lexer::fatal_error (const char *msg) +int +octave_lexer::handle_op (const char *pattern, int tok, bool convert, + bool bos, bool qit) +{ + return handle_op_internal (pattern, tok, convert, bos, qit, true); +} + +int +octave_lexer::handle_incompatible_op (const char *pattern, int tok, + bool convert, bool bos, bool qit) +{ + return handle_op_internal (pattern, tok, convert, bos, qit, false); +} + +int +octave_lexer::handle_op_internal (const char *pattern, int tok, bool convert, + bool bos, bool qit, bool compat) { - error (msg); - - OCTAVE_QUIT; - - yy_fatal_error (msg, scanner); + lexer_debug (pattern); + + if (! compat) + gripe_matlab_incompatible_operator (flex_yytext ()); + + push_token (new token (input_line_number, current_input_column)); + + current_input_column += flex_yyleng (); + quote_is_transpose = qit; + convert_spaces_to_comma = convert; + looking_for_object_index = false; + at_beginning_of_statement = bos; + + return count_token (tok); +} + +int +octave_lexer::handle_token (const std::string& name, int tok) +{ + token *tok_val = new token (name, input_line_number, current_input_column); + + return handle_token (tok, tok_val); } -void -octave_lexer::lexer_debug (const char *pattern, const char *text) +int +octave_lexer::handle_token (int tok, token *tok_val) +{ + if (! tok_val) + tok_val = new token (input_line_number, current_input_column); + + push_token (tok_val); + + current_input_column += flex_yyleng (); + quote_is_transpose = false; + convert_spaces_to_comma = true; + + return count_token (tok); +} + +int +octave_lexer::count_token (int tok) { - OCTAVE_YYG; - - std::cerr << std::endl; - - display_state (YY_START); - - std::cerr << "P: " << pattern << std::endl; - std::cerr << "T: " << text << std::endl; + if (tok != '\n') + { + Vtoken_count++; + token_count++; + } + + return show_token (tok); } + +int +octave_lexer::show_token (int tok) +{ + if (Vdisplay_tokens) + display_token (tok); + + if (lexer_debug_flag) + { + std::cerr << "R: "; + display_token (tok); + std::cerr << std::endl; + } + + return tok; +}
--- a/scripts/set/unique.m +++ b/scripts/set/unique.m @@ -51,14 +51,17 @@ if (nargin > 1) ## parse options if (iscellstr (varargin)) - varargin = unique (varargin); - optfirst = strmatch ("first", varargin, "exact") > 0; - optlast = strmatch ("last", varargin, "exact") > 0; - optrows = strmatch ("rows", varargin, "exact") > 0; + optfirst = strcmp ("first", varargin); + optlast = strcmp ("last", varargin); + optrows = strcmp ("rows", varargin); + if (! all (optfirst | optlast | optrows)) + error ("unique: invalid option"); + endif + optfirst = any (optfirst); + optlast = any (optlast); + optrows = any (optrows); if (optfirst && optlast) error ('unique: cannot specify both "last" and "first"'); - elseif (optfirst + optlast + optrows != nargin-1) - error ("unique: invalid option"); endif else error ("unique: options must be strings"); @@ -214,3 +217,7 @@ %! assert (A(i,:), a); %! assert (a(j,:), A); +%!error unique({"a", "b", "c"}, "UnknownOption") +%!error unique({"a", "b", "c"}, "UnknownOption1", "UnknownOption2") +%!error unique({"a", "b", "c"}, "rows", "UnknownOption2") +%!error unique({"a", "b", "c"}, "UnknownOption1", "last")
--- a/scripts/testfun/fail.m +++ b/scripts/testfun/fail.m @@ -29,10 +29,19 @@ ## is a string and if @var{code} runs successfully, the error produced is: ## ## @example -## expected error but got none +## expected error <.> but got none ## @end example ## -## If the code fails with a different error, the message produced is: +## +## Code must be in the form of a string that may be passed by +## @code{fail} to the Octave interpreter via the @code{evalin} function, +## that is, a (quoted) string constant or a string variable. +## +## If called with two arguments, the behavior is similar to +## @code{fail (@var{code})}, except the return value will only be true if +## code fails with an error message containing pattern (case sensitive). +## If the code fails with a different error to that given in pattern, +## the message produced is: ## ## @example ## @group
--- a/test/bug-31371.tst +++ b/test/bug-31371.tst @@ -4,38 +4,38 @@ %! %! C = @(fcn,x) fcn(x); %! C2 = @(fcn,x,y) fcn(x,y); -%! +%! %! % Church Booleans %! T = @(t,f) t; %! F = @(t,f) f; -%! +%! %! % Church Numerals %! Zero = @(fcn,x) x; %! One = @(fcn,x) fcn(x); %! Two = @(fcn,x) fcn(fcn(x)); %! Three = @(fcn,x) fcn(fcn(fcn(x))); %! Four = @(fcn,x) fcn(fcn(fcn(fcn(x)))); -%! +%! %! % Arithmetic Operations %! Inc = @(a) @(f,x) f(a(f,x)); % Increment %! Add = @(a,b) @(f,x) a(f,b(f,x)); %! Mult = @(a,b) @(f,x) a(@(x) b(f,x),x); %! Dec = @(a) @(f,x) C(a(@(g) @(h) h(g(f)), @(u) x), @(u) u); % Decrement %! Sub = @(a,b) b(Dec, a); -%! +%! %! % Renderer - Convert church numeral to "real" number %! Render = @(n) n(@(n) n+1,0); -%! +%! %! % Predicates %! Iszero = @(n) n(@(x) F, T); -%! +%! %! % Y combinator implements recursion %! Ycomb = @(f) C(@(g) f(@(x) C(g(g), x)), ... %! @(g) f(@(x) C(g(g), x))); %! %! Factorial = Ycomb(@(f) @(n) C(C2(Iszero(n), ... %! @(d) One, @(d) Mult(n, f(Dec(n)))),0)); -%! +%! %! assert (Render (Factorial (Two)), 2) %! assert (Render (Factorial (Three)), 6) %! assert (Render (Factorial (Four)), 24)
--- a/test/bug-36025/@testclass/one.m +++ b/test/bug-36025/@testclass/one.m @@ -1,4 +1,5 @@ % function ONE return item "X" -function a=one(m) - a=m.x; +function a = one (m) + a = m.x; +endfunction
--- a/test/bug-36025/@testclass/testclass.m +++ b/test/bug-36025/@testclass/testclass.m @@ -1,3 +1,4 @@ -function m=testclass(x,y) -m=struct('x',x,'y',y); -m=class(m,"testclass"); +function m = testclass (x,y) + m = struct ('x',x,'y',y); + m = class (m,"testclass"); +endfunction
--- a/test/bug-36025/@testclass/two.m +++ b/test/bug-36025/@testclass/two.m @@ -1,4 +1,5 @@ % function TWO returns item "Y" -function a=one(m) - a=m.y; +function a = one (m) + a = m.y; +endfunction
--- a/test/build-bc-overload-tests.sh +++ b/test/build-bc-overload-tests.sh @@ -94,7 +94,7 @@ %!shared ex %! ex.double = 1; -%! ex.single = single(1); +%! ex.single = single (1); %! ex.logical = true; %! ex.char = 'char'; %! ex.int8 = int8 (1);
--- a/test/build-sparse-tests.sh +++ b/test/build-sparse-tests.sh @@ -19,7 +19,7 @@ # <http://www.gnu.org/licenses/>. # Some tests are commented out because they are known to be broken! -# Search for "# fails" +# Search for "# fails" # ./build_sparse_tests.sh preset # creates sparse.tst with preset tests. @@ -36,13 +36,13 @@ # uses randomly generated matrices. # # The tests are mostly identical for each case but the code is different, -# so it is important that the tests be run on all cases. Because our test +# so it is important that the tests be run on all cases. Because our test # harness doesn't have support for looping or macros (it is only needed # for new data types), but sh does, we use sh to generate inline versions of # the tests for each case. # # Our 'macros' use shared variables as parameters. This allows us to -# for example define A complex and include all the unary ops tests, +# for example define A complex and include all the unary ops tests, # then set A=real(A) and include all the unary ops tests. Thus the # same tests work for real and complex. For binary tests it is even # more complicated because we want full X sparse, sparse X full and @@ -59,7 +59,7 @@ # helper gen_eat_zeros # make sure sparse-scalar ops which generate 0 work # gen_specific_tests -# specific and eat zeros tests +# specific and eat zeros tests # helper gen_ordering_tests # ordered comparison operators for real valued tests # helper gen_sparsesparse_ordering_tests @@ -71,12 +71,12 @@ # element-wise matrix binary operators, for sparse-sparse ops. # horizontal/vertical concatenation are here as well. # helper gen_divop_tests -# left and right matrix division operators of rectangular matrices. +# left and right matrix division operators of rectangular matrices. # Needs QR solvers # helper gen_square_divop_tests -# left and right matrix division operators of square matrices. +# left and right matrix division operators of square matrices. # helper gen_matrixop_tests -# rectangular matrix binary operators: * +# rectangular matrix binary operators: * # helper gen_matrixdiag_tests # Tests extract of diag and creation of diagonal matrices using # diag and spdiags functions @@ -146,7 +146,7 @@ # Specific preset tests # ======================================================= -# If a sparse operation yields zeros, then those elements +# If a sparse operation yields zeros, then those elements # of the returned sparse matrix should be eaten. gen_eat_zeros() { cat >>$TESTS <<EOF @@ -175,14 +175,14 @@ %!test # segfault test from edd@debian.org %! n = 510; -%! sparse (kron ((1:n)', ones(n,1)), kron (ones(n,1), (1:n)'), ones (n)); +%! sparse (kron ((1:n)', ones (n,1)), kron (ones (n,1), (1:n)'), ones (n)); %% segfault tests from Fabian@isas-berlin.de %% Note that the last four do not fail, but rather give a warning %% of a singular matrix, which is consistent with the full matrix %% behaviour. They are therefore disabled. %!testif HAVE_UMFPACK -%! assert (inv (sparse ([1,1;1,1+i])), sparse([1-1i,1i;1i,-1i]), 10*eps); +%! assert (inv (sparse ([1,1;1,1+i])), sparse ([1-1i,1i;1i,-1i]), 10*eps); %#!error inv ( sparse ([1,1;1,1] ) ); %#!error inv ( sparse ([0,0;0,1] ) ); %#!error inv ( sparse ([0,0;0,1+i]) ); @@ -259,13 +259,13 @@ disp ("appending test output to sprandomtest.log"); fid = fopen ("sprandomtest.log", "at"); test ("sprandom.tst", "normal", fid); - ##[passes, total] = test("sprandomtest","normal",fid); + ##[passes, total] = test ("sprandomtest", "normal", fid); fclose (fid); endfunction EOF fi - + } @@ -405,7 +405,7 @@ %!assert (diag (as(:)',-1), sparse (diag (af(:)',-1))) %!assert (spdiags (as,[0,1]), [diag(af,0), diag(af,1)]) %!test -%! [tb,tc]=spdiags(as); +%! [tb,tc] = spdiags (as); %! assert (spdiags (tb,tc,sparse (zeros (size (as)))), as); %! assert (spdiags (tb,tc,size (as,1),size (as,2)), as); @@ -416,12 +416,12 @@ gen_matrixreshape_tests() { cat >>$TESTS <<EOF %% Matrix diagonal tests (uses af,as,bf,bs) -%!assert(reshape(as,1,prod(size(as))),sparse(reshape(af,1,prod(size(af))))) -%!assert(reshape(as,prod(size(as)),1),sparse(reshape(af,prod(size(af)),1))) -%!assert(reshape(as,fliplr(size(as))),sparse(reshape(af,fliplr(size(af))))) -%!assert(reshape(bs,1,prod(size(as))),sparse(reshape(bf,1,prod(size(af))))) -%!assert(reshape(bs,prod(size(as)),1),sparse(reshape(bf,prod(size(af)),1))) -%!assert(reshape(bs,fliplr(size(as))),sparse(reshape(bf,fliplr(size(af))))) +%!assert (reshape (as,1,prod(size(as))), sparse (reshape (af,1,prod(size(af))))) +%!assert (reshape (as,prod(size(as)),1), sparse (reshape (af,prod(size(af)),1))) +%!assert (reshape (as,fliplr(size(as))), sparse (reshape (af,fliplr(size(af))))) +%!assert (reshape (bs,1,prod(size(as))), sparse (reshape (bf,1,prod(size(af))))) +%!assert (reshape (bs,prod(size(as)),1), sparse (reshape (bf,prod(size(af)),1))) +%!assert (reshape (bs,fliplr(size(as))), sparse (reshape (bf,fliplr(size(af))))) EOF } @@ -552,7 +552,7 @@ %!assert (cumprod (as,2), sparse (cumprod (af,2))) %!assert (min (as), sparse (min (af))) -%!assert (full (min (as(:))),min (af(:))) +%!assert (full (min (as(:))), min (af(:))) %!assert (min (as,[],1), sparse (min (af,[],1))) %!assert (min (as,[],2), sparse (min (af,[],2))) %!assert (min (as,[],1), sparse (min (af,[],1))) @@ -582,8 +582,8 @@ %!assert (as', sparse (af')); %!assert (-as, sparse (-af)); %!assert (~as, sparse (~af)); -%!error [i,j]=size (af);as(i-1,j+1); -%!error [i,j]=size (af);as(i+1,j-1); +%!error [i,j] = size (af);as(i-1,j+1); +%!error [i,j] = size (af);as(i+1,j-1); %!test %! [Is,Js,Vs] = find (as); %! [If,Jf,Vf] = find (af); @@ -635,9 +635,9 @@ cat >>$TESTS <<EOF %!testif HAVE_UMFPACK -%! assert(det(bs+speye(size(bs))),det(bf+eye(size(bf))),100*eps*abs(det(bf+eye(size(bf))))) +%! assert(det(bs+speye(size(bs))), det(bf+eye(size(bf))), 100*eps*abs(det(bf+eye(size(bf))))) -%!testif HAVE_UMFPACK +%!testif HAVE_UMFPACK %! [l,u] = lu (sparse ([1,1;1,1])); %! assert (l*u, [1,1;1,1], 10*eps); @@ -701,7 +701,7 @@ cat >>$TESTS <<EOF %!testif HAVE_CHOLMOD %! assert (chol (bs)'*chol (bs), bs, 1e-10); -%!testif HAVE_CHOLMOD +%!testif HAVE_CHOLMOD %! assert (chol (bs,'lower')*chol (bs,'lower')', bs, 1e-10); %!testif HAVE_CHOLMOD %! assert (chol (bs,'lower'), chol (bs)', 1e-10); @@ -727,19 +727,19 @@ # test scalar operations: uses af and real scalar bf; modifies as,bf,bs gen_scalar_tests() { - echo '%!test as=sparse(af);' >> $TESTS - echo '%!test bs=bf;' >> $TESTS + echo '%!test as = sparse (af);' >> $TESTS + echo '%!test bs = bf;' >> $TESTS gen_elementop_tests gen_ordering_tests - echo '%!test bf=bf+1i;' >>$TESTS - echo '%!test bs=bf;' >> $TESTS + echo '%!test bf = bf+1i;' >>$TESTS + echo '%!test bs = bf;' >> $TESTS gen_elementop_tests } # test matrix operations: uses af and bf; modifies as,bs gen_rectangular_tests() { - echo '%!test as=sparse(af);' >> $TESTS - echo '%!test bs=sparse(bf);' >>$TESTS + echo '%!test as = sparse(af);' >> $TESTS + echo '%!test bs = sparse(bf);' >>$TESTS gen_mapper_tests gen_real_mapper_tests gen_unaryop_tests @@ -806,7 +806,7 @@ %! funiq = fsum = zeros (m,n); %! funiq(r(:) + m*(c(:)-1) ) = ones (size (r(:))); %! funiq = sparse (funiq); -%! for k=1:length(r) +%! for k=1:length (r) %! fsum(r(k),c(k)) += 1; %! endfor %! fsum = sparse (fsum); @@ -847,7 +847,7 @@ gen_select_tests() { cat >>$TESTS <<EOF -%!test as=sparse(af); +%!test as = sparse (af); %% Point tests %!test idx = ridx(:) + rows (as) * (cidx (:)-1); @@ -875,16 +875,16 @@ %% Assignment test %!test -%! ts=as; ts(:,:) = ts(fliplr (1:size (as,1)),:); -%! tf=af; tf(:,:) = tf(fliplr (1:size (af,1)),:); +%! ts = as; ts(:,:) = ts(fliplr (1:size (as,1)),:); +%! tf = af; tf(:,:) = tf(fliplr (1:size (af,1)),:); %! assert (ts, sparse (tf)); %!test -%! ts=as; ts(fliplr (1:size (as,1)),:) = ts; -%! tf=af; tf(fliplr (1:size (af,1)),:) = tf; +%! ts = as; ts(fliplr (1:size (as,1)),:) = ts; +%! tf = af; tf(fliplr (1:size (af,1)),:) = tf; %! assert (ts, sparse (tf)); %!test -%! ts=as; ts(:,fliplr (1:size (as,2))) = ts; -%! tf=af; tf(:,fliplr (1:size (af,2))) = tf; +%! ts = as; ts(:,fliplr (1:size (as,2))) = ts; +%! tf = af; tf(:,fliplr (1:size (af,2))) = tf; %! assert (ts, sparse (tf)); %!test %! ts(fliplr (1:size (as,1))) = as(:,1); @@ -893,10 +893,10 @@ %% Deletion tests %!test -%! ts=as; ts(1,:)=[]; tf=af; tf(1,:)=[]; +%! ts = as; ts(1,:) = []; tf = af; tf(1,:) = []; %! assert (ts, sparse (tf)); %!test -%! ts=as; ts(:,1)=[]; tf=af; tf(:,1)=[]; +%! ts = as; ts(:,1) = []; tf = af; tf(:,1) = []; %! assert (ts, sparse (tf)); %% Test "end" keyword @@ -921,7 +921,7 @@ %! clear as_save; %! load (savefile, "as_save"); %! unlink (savefile); -%! assert (as_save, sparse(af)); +%! assert (as_save, sparse (af)); %!test # save binary %! savefile = tmpnam (); %! as_save = as; @@ -929,7 +929,7 @@ %! clear as_save; %! load (savefile, "as_save"); %! unlink (savefile); -%! assert (as_save, sparse(af)); +%! assert (as_save, sparse (af)); %!testif HAVE_HDF5 # save hdf5 %! savefile = tmpnam (); %! as_save = as; @@ -937,7 +937,7 @@ %! clear as_save; %! load (savefile, "as_save"); %! unlink (savefile); -%! assert (as_save, sparse(af)); +%! assert (as_save, sparse (af)); ## FIXME: We should skip (or mark as an expected failure) the test for ## saving sparse matrices to MAT files when using 64-bit indexing since ## that is not implemented yet. @@ -948,7 +948,7 @@ %! clear as_save; %! load (savefile, "as_save"); %! unlink (savefile); -%! assert (as_save, sparse(af)); +%! assert (as_save, sparse (af)); EOF } @@ -975,11 +975,11 @@ cat >>$TESTS <<EOF %! df = diag (1:n).* alpha; ds = sparse (df); -%! pdf = df(randperm (n),randperm (n)); +%! pdf = df(randperm (n), randperm (n)); %! pds = sparse (pdf); -%! plf = lf(randperm (n),randperm (n)); +%! plf = lf(randperm (n), randperm (n)); %! pls = sparse (plf); -%! puf = uf(randperm (n),randperm (n)); +%! puf = uf(randperm (n), randperm (n)); %! pus = sparse (puf); %! bs = spdiags (repmat ([1:n]',1,4),-2:1,n,n).*alpha; %! bf = full (bs); @@ -1024,28 +1024,28 @@ cat >>$TESTS <<EOF %% QR solver tests -%!function f(a, sz, feps) +%!function f (a, sz, feps) %! b = randn (sz); -%! x = a \ b; +%! x = a \ b; %! assert (a * x, b, feps); %! b = randn (sz) + 1i*randn (sz); -%! x = a \ b; +%! x = a \ b; %! assert (a * x, b, feps); %! b = sprandn (sz(1),sz(2),0.2); %! x = a \ b; %! assert (sparse (a * x), b, feps); %! b = sprandn (sz(1),sz(2),0.2) + 1i*sprandn (sz(1),sz(2),0.2); -%! x = a \ b; +%! x = a \ b; %! assert (sparse (a * x), b, feps); %!endfunction %!testif HAVE_UMFPACK %! a = alpha*sprandn (10,11,0.2) + speye (10,11); -%! f(a,[10,2],1e-10); -%! ## Test this by forcing matrix_type, as can't get a certain +%! f (a,[10,2],1e-10); +%! ## Test this by forcing matrix_type, as can't get a certain %! ## result for over-determined systems. -%! a = alpha*sprandn(10,10,0.2) + speye(10,10); +%! a = alpha*sprandn (10,10,0.2) + speye (10,10); %! matrix_type (a, "Singular"); -%! f(a,[10,2],1e-10); +%! f (a,[10,2],1e-10); %% Rectanguar solver tests that don't use QR @@ -1149,7 +1149,7 @@ gen_section # specific tests -if $preset; then +if $preset; then gen_specific_tests gen_section fi @@ -1194,25 +1194,25 @@ gen_section gen_save_tests gen_section -echo '%!test bf=real(bf);' >> $TESTS +echo '%!test bf = real (bf);' >> $TESTS gen_rectangular_tests gen_section gen_sparsesparse_ordering_tests gen_section -echo '%!test af=real(af);' >> $TESTS +echo '%!test af = real (af);' >> $TESTS gen_rectangular_tests gen_section gen_save_tests gen_section -echo '%!test bf=bf+1i*(bf~=0);' >> $TESTS +echo '%!test bf = bf+1i*(bf~=0);' >> $TESTS gen_rectangular_tests gen_section # square operations if $preset; then - echo '%!test af=[1+1i,2-1i,0,0;0,0,0,3+2i;0,0,0,4];' >> $TESTS - echo '%! as=sparse(af);' >> $TESTS - echo '%!test bf=[0,1-1i,0,0;2+1i,0,0,0;3-1i,2+3i,0,0];' >> $TESTS + echo '%!test af = [1+1i,2-1i,0,0;0,0,0,3+2i;0,0,0,4];' >> $TESTS + echo '%! as = sparse (af);' >> $TESTS + echo '%!test bf = [0,1-1i,0,0;2+1i,0,0,0;3-1i,2+3i,0,0];' >> $TESTS else cat >>$TESTS <<EOF %!test @@ -1234,34 +1234,34 @@ gen_square_tests gen_section -echo '%!test bf=real(bf);' >> $TESTS -echo '%! bs=sparse(bf);' >> $TESTS +echo '%!test bf = real (bf);' >> $TESTS +echo '%! bs = sparse (bf);' >> $TESTS gen_square_tests gen_section -echo '%!test af=real(af);' >> $TESTS -echo '%! as=sparse(af);' >> $TESTS +echo '%!test af = real (af);' >> $TESTS +echo '%! as = sparse (af);' >> $TESTS gen_square_tests gen_section -echo '%!test bf=bf+1i*(bf~=0);' >> $TESTS -echo '%! bs=sparse(bf);' >> $TESTS +echo '%!test bf = bf+1i*(bf~=0);' >> $TESTS +echo '%! bs = sparse (bf);' >> $TESTS gen_square_tests gen_section # cholesky tests if $preset; then - echo '%!test bf=[5,0,1+1i,0;0,5,0,1-2i;1-1i,0,5,0;0,1+2i,0,5];' >> $TESTS - echo '%! bs=sparse(bf);' >> $TESTS + echo '%!test bf = [5,0,1+1i,0;0,5,0,1-2i;1-1i,0,5,0;0,1+2i,0,5];' >> $TESTS + echo '%! bs = sparse (bf);' >> $TESTS else echo '# This has a small chance of failing to create a positive definite matrix' >> $TESTS - echo '%!test n=floor (lognrnd (8,2)+1)' >> $TESTS + echo '%!test n = floor (lognrnd (8,2)+1)' >> $TESTS echo '%! bs = n*speye (n,n) + sprandn (n,n,0.3);' >> $TESTS echo '%! bf = full (bs);' >> $TESTS fi gen_cholesky_tests gen_section -echo '%!test bf=real(bf);' >> $TESTS -echo '%! bs=sparse(bf);' >> $TESTS +echo '%!test bf = real (bf);' >> $TESTS +echo '%! bs = sparse (bf);' >> $TESTS gen_cholesky_tests gen_section @@ -1311,16 +1311,16 @@ fi gen_scalar_select_tests gen_select_tests -echo '%!test af=real(af);' >> $TESTS +echo '%!test af = real (af);' >> $TESTS gen_select_tests gen_section echo '%!shared alpha,beta,df,pdf,lf,plf,uf,puf,bf,cf,bcf,tf,tcf,xf,ds,pds,ls,pls,us,pus,bs,cs,bcs,ts,tcs,xs' >>$TESTS -echo '%!test alpha=1;beta=1;' >> $TESTS +echo '%!test alpha=1; beta=1;' >> $TESTS gen_solver_tests -echo '%!test alpha=1;beta=1i;' >> $TESTS +echo '%!test alpha=1; beta=1i;' >> $TESTS gen_solver_tests -echo '%!test alpha=1i;beta=1;' >> $TESTS +echo '%!test alpha=1i; beta=1;' >> $TESTS gen_solver_tests -echo '%!test alpha=1i;beta=1i;' >> $TESTS +echo '%!test alpha=1i; beta=1i;' >> $TESTS gen_solver_tests gen_section
--- a/test/build_bc_overloads_expected.m +++ b/test/build_bc_overloads_expected.m @@ -6,7 +6,7 @@ % to generate the overloaded functions. % ex.double = 1; -ex.single = single(1); +ex.single = single (1); ex.logical = true; ex.char = 'char'; ex.int8 = int8 (1);
--- a/test/classes/@Blork/Blork.m +++ b/test/classes/@Blork/Blork.m @@ -1,16 +1,15 @@ -function [ s ] = Blork( bleek ) +function s = Blork (bleek) % Test class. - if (nargin==1) && isa(bleek, 'Blork') - s = bleek; + if (nargin == 1 && isa (bleek, 'Blork')) + s = bleek; + else + if (nargin == 0) + s.bleek = 1; else - if nargin==0 - s.bleek = 1; - else - s.bleek = bleek; - end - s = class(s, 'Blork'); + s.bleek = bleek; + end + s = class (s, 'Blork'); + end - end - end
--- a/test/classes/@Blork/bleek.m +++ b/test/classes/@Blork/bleek.m @@ -1,10 +1,10 @@ -function [ out ] = bleek( in, val ) +function out = bleek (in, val) - if (nargin==1) + if (nargin == 1) out = in.bleek; else in.bleek = val; out = in; end - + end
--- a/test/classes/@Blork/display.m +++ b/test/classes/@Blork/display.m @@ -1,7 +1,7 @@ -function display( s ) +function display (s) - disp([inputname(1),'.bleek = ']) - disp(' '); - disp(s.bleek); + disp ([inputname(1),'.bleek = ']); + disp (' '); + disp (s.bleek); -end \ No newline at end of file +end
--- a/test/classes/@Blork/get.m +++ b/test/classes/@Blork/get.m @@ -1,10 +1,10 @@ -function [ v ] = get( s, propName ) +function v = get (s, propName) - switch propName - case 'bleek' - v = s.bleek; - otherwise - error([propName, ' is not a valid Blork property']); - end + switch propName + case 'bleek' + v = s.bleek; + otherwise + error ([propName, ' is not a valid Blork property']); + end end
--- a/test/classes/@Blork/set.m +++ b/test/classes/@Blork/set.m @@ -1,7 +1,7 @@ -function [ s ] = set( s, varargin ) +function s = set (s, varargin) propArgs = varargin; - while (length(propArgs) >= 2) + while (length (propArgs) >= 2) propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); @@ -9,7 +9,7 @@ case 'bleek' s.bleek = propValue; otherwise - error([propName, ' is not a valid Blork property']); + error ([propName, ' is not a valid Blork property']); end end
--- a/test/classes/@CPrecedenceTester1/CPrecedenceTester1.m +++ b/test/classes/@CPrecedenceTester1/CPrecedenceTester1.m @@ -1,7 +1,7 @@ -function x = CPrecedenceTester1() +function x = CPrecedenceTester1 () - x = struct('useless_data', pi); - x = class(x, 'CPrecedenceTester1'); + x = struct ('useless_data', pi); + x = class (x, 'CPrecedenceTester1'); % don't change anything as far as precedence is concerned
--- a/test/classes/@CPrecedenceTester1/tattack.m +++ b/test/classes/@CPrecedenceTester1/tattack.m @@ -1,5 +1,5 @@ -function s = tattack(x, y) - +function s = tattack (x, y) + s = 'CPrecedenceTester1'; - + end
--- a/test/classes/@CPrecedenceTester2/CPrecedenceTester2.m +++ b/test/classes/@CPrecedenceTester2/CPrecedenceTester2.m @@ -1,15 +1,15 @@ -function x = CPrecedenceTester2(flag) +function x = CPrecedenceTester2 (flag) - x = struct('useless_data', pi^2); - x = class(x, 'CPrecedenceTester2'); + x = struct ('useless_data', pi^2); + x = class (x, 'CPrecedenceTester2'); - switch flag, - case 1, % CPrecedencetester2 > Snork - superiorto('Snork'); - case 2, % CPrecedencetester2 < Snork - inferiorto('Snork'); - otherwise, - error('Incorrect value for argument flag: %d', flag); + switch flag + case 1 % CPrecedencetester2 > Snork + superiorto ('Snork'); + case 2 % CPrecedencetester2 < Snork + inferiorto ('Snork'); + otherwise + error ('Incorrect value for argument flag: %d', flag); end end
--- a/test/classes/@CPrecedenceTester2/tattack.m +++ b/test/classes/@CPrecedenceTester2/tattack.m @@ -1,5 +1,5 @@ -function s = tattack(x, y) - +function s = tattack (x, y) + s = 'CPrecedenceTester2'; - + end
--- a/test/classes/@CPrecedenceTester3/CPrecedenceTester3.m +++ b/test/classes/@CPrecedenceTester3/CPrecedenceTester3.m @@ -1,15 +1,15 @@ -function x = CPrecedenceTester3(flag) +function x = CPrecedenceTester3 (flag) - x = struct('useless_data', pi^3); - x = class(x, 'CPrecedenceTester3'); + x = struct ('useless_data', pi^3); + x = class (x, 'CPrecedenceTester3'); - switch flag, - case 1, % CPrecedencetester3 > Snork - superiorto('Snork'); - case 2, % CPrecedencetester3 < Snork - inferiorto('Snork'); - otherwise, - error('Incorrect value for argument flag: %d', flag); + switch flag + case 1 % CPrecedencetester3 > Snork + superiorto ('Snork'); + case 2 % CPrecedencetester3 < Snork + inferiorto ('Snork'); + otherwise + error ('Incorrect value for argument flag: %d', flag); end end
--- a/test/classes/@CPrecedenceTester3/tattack.m +++ b/test/classes/@CPrecedenceTester3/tattack.m @@ -1,5 +1,5 @@ -function s = tattack(x, y) - +function s = tattack (x, y) + s = 'CPrecedenceTester3'; - + end
--- a/test/classes/@Cork/Cork.m +++ b/test/classes/@Cork/Cork.m @@ -1,16 +1,16 @@ -function [ s ] = Cork( click ) +function s = Cork (click) % Test class. - if ( (nargin==1) && (isa(click, 'Cork')) ) + if (nargin == 1 && isa (click, 'Cork')) s = click; return; end - if( nargin<1 ) + if (nargin < 1) s.click = 1; else s.click = click; end - s = class(s, 'Cork'); + s = class (s, 'Cork'); end
--- a/test/classes/@Cork/click.m +++ b/test/classes/@Cork/click.m @@ -1,10 +1,10 @@ -function [ out ] = click( in, val ) +function out = click (in, val) - if (nargin==1) + if (nargin == 1) out = in.click; else in.click = val; out = in; end - + end
--- a/test/classes/@Cork/display.m +++ b/test/classes/@Cork/display.m @@ -1,7 +1,7 @@ -function display( s ) +function display (s) - disp([inputname(1),'.click = ']); - disp(' '); - disp(s.click); + disp ([inputname(1),'.click = ']); + disp (' '); + disp (s.click); -end \ No newline at end of file +end
--- a/test/classes/@Cork/get.m +++ b/test/classes/@Cork/get.m @@ -1,10 +1,10 @@ -function [ v ] = get( s, propName ) +function v = get (s, propName) - switch propName - case 'click' - v = s.click; - otherwise - error([propName, ' is not a valid Cork property']); - end + switch propName + case 'click' + v = s.click; + otherwise + error ([propName, ' is not a valid Cork property']); + end end
--- a/test/classes/@Cork/set.m +++ b/test/classes/@Cork/set.m @@ -1,7 +1,7 @@ -function [ s ] = set( s, varargin ) +function s = set (s, varargin) propArgs = varargin; - while (length(propArgs) >= 2) + while (length (propArgs) >= 2) propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); @@ -9,7 +9,7 @@ case 'click' s.click = propValue; otherwise - error([propName, ' is not a valid Cork property']); + error ([propName, ' is not a valid Cork property']); end end
--- a/test/classes/@Dork/Dork.m +++ b/test/classes/@Dork/Dork.m @@ -1,18 +1,18 @@ -function [ s ] = Dork( gick, gack ) +function s = Dork (gick, gack) - if (nargin==1) && isa(gick,'Dork') + if (nargin == 1 && isa (gick, 'Dork')) s = gick; else s.gack = 0; - if nargin == 0 + if (nargin == 0) s0 = Snork (); - elseif nargin==1 - s0 = Snork(gick); + elseif (nargin == 1) + s0 = Snork (gick); else - s0 = Snork(gick); + s0 = Snork (gick); s.gack = gack; end - s = class(s,'Dork',s0); - end - + s = class (s, 'Dork', s0); + end + end
--- a/test/classes/@Dork/bling.m +++ b/test/classes/@Dork/bling.m @@ -1,5 +1,5 @@ -function [ out ] = bling( m1, m2 ) +function out = bling (m1, m2) out = 1; - + end
--- a/test/classes/@Dork/display.m +++ b/test/classes/@Dork/display.m @@ -1,13 +1,13 @@ -function display( s ) +function display (s) % Display the critical info for an amplifier - gick = get(s,'gick'); - disp([inputname(1),'.gick = ']) - disp(' '); - disp(gick); - disp(' '); - disp([inputname(1),'.gack = ']) - disp(' '); - disp(s.gack); + gick = get (s, 'gick'); + disp ([inputname(1),'.gick = ']); + disp (' '); + disp (gick); + disp (' '); + disp ([inputname(1),'.gack = ']); + disp (' '); + disp (s.gack); end
--- a/test/classes/@Dork/gack.m +++ b/test/classes/@Dork/gack.m @@ -1,10 +1,10 @@ -function [ out ] = gack( in, val ) +function out = gack (in, val) - if (nargin==1) + if (nargin == 1) out = in.gack; else in.gack = val; out = in; end - + end
--- a/test/classes/@Dork/get.m +++ b/test/classes/@Dork/get.m @@ -1,10 +1,10 @@ -function [ v ] = get( s, propName ) +function v = get (s, propName) switch propName case 'gack' v = s.gack; otherwise - v = get(s.Snork,propName); + v = get (s.Snork,propName); end end
--- a/test/classes/@Dork/getStash.m +++ b/test/classes/@Dork/getStash.m @@ -1,5 +1,5 @@ -function [ out ] = getStash(cls) +function out = getStash (cls) out = myStash (); - + end
--- a/test/classes/@Dork/private/myStash.m +++ b/test/classes/@Dork/private/myStash.m @@ -1,4 +1,4 @@ -function [ out ] = myStash () +function out = myStash () out = 2;
--- a/test/classes/@Dork/set.m +++ b/test/classes/@Dork/set.m @@ -1,7 +1,7 @@ -function [ s ] = set( s, varargin ) +function s = set (s, varargin) propArgs = varargin; - while (length(propArgs) >= 2) + while (length (propArgs) >= 2) propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); @@ -9,7 +9,7 @@ case 'gack' s.gack = propValue; otherwise - s.Snork = set(s.Snork, propName, propValue); + s.Snork = set (s.Snork, propName, propValue); end end
--- a/test/classes/@Gork/Gork.m +++ b/test/classes/@Gork/Gork.m @@ -1,5 +1,6 @@ -function [ s ] = Gork( g ) - if (nargin==1) && isa(g,'Gork') +function s = Gork (g) + + if (nargin == 1 && isa (g, 'Gork')) s = sprk; return; end @@ -7,9 +8,9 @@ drk = Dork (); prk = Pork (); blrk = Blork (); - s.Cork = Cork(17); % Aggregation. + s.Cork = Cork (17); % Aggregation. s.gark = -2; s.gyrk = -3; - s = class(s,'Gork',drk,prk,blrk); - + s = class (s,'Gork',drk,prk,blrk); + end
--- a/test/classes/@Gork/cork.m +++ b/test/classes/@Gork/cork.m @@ -1,10 +1,10 @@ -function [ out ] = cork( in, val ) +function out = cork (in, val) - if (nargin==1) + if (nargin == 1) out = in.Cork; else in.Cork = val; out = in; end - + end
--- a/test/classes/@Gork/display.m +++ b/test/classes/@Gork/display.m @@ -1,16 +1,15 @@ -function display( s ) +function display (s) % Display the critical info for a Gork. dork_base = s.Dork %pork_base = s.Pork %sprk = s.sprk; - gark = get(s,'gark'); - disp([inputname(1),'.gark = ']) - disp(' '); - disp(gark); - disp([inputname(1),'.Cork= ']) - disp(' '); - disp(click(s.Cork)); - + gark = get (s, 'gark'); + disp ([inputname(1),'.gark = ']); + disp (' '); + disp (gark); + disp ([inputname(1),'.Cork= ']); + disp (' '); + disp (click(s.Cork)); end
--- a/test/classes/@Gork/gark.m +++ b/test/classes/@Gork/gark.m @@ -1,10 +1,10 @@ -function [ out ] = gark( in, val ) +function out = gark (in, val) - if (nargin==1) + if (nargin == 1) out = in.gark; else in.gark = val; out = in; end - + end
--- a/test/classes/@Gork/get.m +++ b/test/classes/@Gork/get.m @@ -1,4 +1,4 @@ -function [ v ] = get( s, propName ) +function v = get (s, propName) switch propName case 'cork' @@ -8,7 +8,7 @@ otherwise % Note that get/set for multiple parents is hard. We only do one % branch of the parent tree just to test this stuff out. - v = get(s.Dork,propName); + v = get (s.Dork,propName); end end
--- a/test/classes/@Gork/set.m +++ b/test/classes/@Gork/set.m @@ -1,23 +1,23 @@ -function [ s ] = set( s, varargin ) +function s = set (s, varargin) propArgs = varargin; - while (length(propArgs) >= 2) + while (length (propArgs) >= 2) propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); switch propName case 'cork' - if(isa(propValue,'Cork')) + if (isa (propValue, 'Cork')) s.Cork = propValue; else - s.Cork = set(s.Cork, 'click',propValue); + s.Cork = set (s.Cork, 'click', propValue); end case 'gark' s.gark = propValue; otherwise % Note that get/set for multiple parents is hard. We only do one % branch of the parent tree just to test this stuff out. - s.Dork = set(s.Dork, propName, propValue); + s.Dork = set (s.Dork, propName, propValue); end end
--- a/test/classes/@Gork/subsasgn.m +++ b/test/classes/@Gork/subsasgn.m @@ -1,9 +1,10 @@ -function g = subsasgn(g, s, x) +function g = subsasgn (g, s, x) switch s.type case '.' switch s.subs case 'gyrk' - g.gyrk = x; + g.gyrk = x; end + end
--- a/test/classes/@Gork/subsref.m +++ b/test/classes/@Gork/subsref.m @@ -1,4 +1,4 @@ -function x = subsref(g, s) +function x = subsref (g, s) switch s.type case '.' @@ -6,4 +6,5 @@ case 'gyrk' x = g.gyrk; end + end
--- a/test/classes/@Pork/Pork.m +++ b/test/classes/@Pork/Pork.m @@ -1,19 +1,19 @@ -function [ s ] = Pork( geek, gurk ) +function s = Pork (geek, gurk) - if (nargin==1) && isa(geek,'Pork') + if (nargin == 1 && isa (geek, 'Pork')) s = geek; else s.gurk = 0; - if nargin == 0 + if (nargin == 0) s0 = Spork (); - elseif nargin==1 - s0 = Spork(geek); + elseif (nargin == 1) + s0 = Spork (geek); else - s0 = Spork(geek); + s0 = Spork (geek); s.gurk = gurk; end - s = class(s,'Pork',s0); - end - superiorto('Dork'); + s = class (s, 'Pork', s0); + end + superiorto ('Dork'); end
--- a/test/classes/@Pork/bling.m +++ b/test/classes/@Pork/bling.m @@ -1,5 +1,5 @@ -function [ out ] = bling( m1, m2 ) +function out = bling (m1, m2) out = 2; - + end
--- a/test/classes/@Pork/display.m +++ b/test/classes/@Pork/display.m @@ -1,13 +1,13 @@ -function display( s ) +function display (s) % Display the critical info for an amplifier - geek = get(s,'geek'); - disp([inputname(1),'.geek = ']) - disp(' '); - disp(geek); - disp(' '); - disp([inputname(1),'.gurk = ']) - disp(' '); - disp(s.gurk); + geek = get (s, 'geek'); + disp ([inputname(1),'.geek = ']); + disp (' '); + disp (geek); + disp (' '); + disp ([inputname(1),'.gurk = ']); + disp (' '); + disp (s.gurk); end
--- a/test/classes/@Pork/get.m +++ b/test/classes/@Pork/get.m @@ -1,10 +1,10 @@ -function [ v ] = get( s, propName ) +function v = get (s, propName) switch propName case 'gurk' v = s.gurk; otherwise - v = get(s.Spork,propName); + v = get (s.Spork, propName); end end
--- a/test/classes/@Pork/gurk.m +++ b/test/classes/@Pork/gurk.m @@ -1,10 +1,10 @@ -function [ out ] = gurk( in, val ) +function out = gurk (in, val) - if (nargin==1) + if (nargin == 1) out = in.gurk; else in.gurk = val; out = in; end - + end
--- a/test/classes/@Pork/private/myStash.m +++ b/test/classes/@Pork/private/myStash.m @@ -1,4 +1,4 @@ -function [ out ] = myStash () +function out = myStash () out = 4;
--- a/test/classes/@Pork/set.m +++ b/test/classes/@Pork/set.m @@ -1,7 +1,7 @@ -function [ s ] = set( s, varargin ) +function s = set (s, varargin) propArgs = varargin; - while (length(propArgs) >= 2) + while (length (propArgs) >= 2) propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); @@ -9,7 +9,7 @@ case 'gurk' s.gurk = propValue; otherwise - s.Spork = set(s.Spork, propName, propValue); + s.Spork = set (s.Spork, propName, propValue); end end
--- a/test/classes/@Sneetch/Sneetch.m +++ b/test/classes/@Sneetch/Sneetch.m @@ -1,16 +1,16 @@ -function [ s ] = Sneetch( mcbean ) +function s = Sneetch (mcbean) % Test class: should produce error. - if (nargin==1) && isa(mcbean, 'Sneetch') + if (nargin == 1 && isa (mcbean, 'Sneetch')) s = mcbean; else - if nargin==0 + if (nargin == 0) s.mcbean = 1; else s.mcbean = mcbean; end - s = class(s, 'Sneetch'); + s = class (s, 'Sneetch'); s.sylvester = 1; end - + end
--- a/test/classes/@Sneetch/display.m +++ b/test/classes/@Sneetch/display.m @@ -1,10 +1,10 @@ -function display( s ) +function display ( s ) - disp([inputname(1),'.mcbean = ']) - disp(' '); - disp(s.mcbean); - disp([inputname(1),'.sylvester = ']) - disp(' '); - disp(s.sylvester); + disp ([inputname(1),'.mcbean = ']); + disp (' '); + disp (s.mcbean); + disp ([inputname(1),'.sylvester = ']); + disp (' '); + disp (s.sylvester); -end \ No newline at end of file +end
--- a/test/classes/@Snork/Snork.m +++ b/test/classes/@Snork/Snork.m @@ -1,17 +1,16 @@ -function [ s ] = Snork( gick ) +function s = Snork (gick) % Test class. - if ( (nargin==1) && (isa(gick, 'Snork')) ) + if (nargin == 1 && isa (gick, 'Snork')) s = gick; else s.cack = [0 1 2 3]; - if nargin==0 + if (nargin == 0) s.gick = 1; else s.gick = gick; end - s = class(s, 'Snork'); - + s = class (s, 'Snork'); end - + end
--- a/test/classes/@Snork/cack.m +++ b/test/classes/@Snork/cack.m @@ -1,5 +1,5 @@ -function [ out ] = cack( in ) +function out = cack (in) out = in.cack; - + end
--- a/test/classes/@Snork/display.m +++ b/test/classes/@Snork/display.m @@ -1,7 +1,7 @@ -function display( s ) +function display (s) - disp([inputname(1),'.gick = ']); - disp(' '); - disp(s.gick); + disp ([inputname(1),'.gick = ']); + disp (' '); + disp (s.gick); -end \ No newline at end of file +end
--- a/test/classes/@Snork/double.m +++ b/test/classes/@Snork/double.m @@ -1,4 +1,4 @@ -function x = double(snk) +function x = double (snk) x = snk.gick;
--- a/test/classes/@Snork/end.m +++ b/test/classes/@Snork/end.m @@ -3,7 +3,7 @@ if (num_indices ~= 1) error ('Snork object may only have one index') end - + r = length (snk.cack); end
--- a/test/classes/@Snork/eq.m +++ b/test/classes/@Snork/eq.m @@ -1,8 +1,8 @@ -function b = eq(s1, s2) +function b = eq (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - b = isequal(x1, x2); + b = isequal (x1, x2); -end \ No newline at end of file +end
--- a/test/classes/@Snork/ge.m +++ b/test/classes/@Snork/ge.m @@ -1,7 +1,7 @@ -function b = ge(s1, s2) +function b = ge (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); b = (x1(1) >= x2(1));
--- a/test/classes/@Snork/get.m +++ b/test/classes/@Snork/get.m @@ -1,10 +1,10 @@ -function [ v ] = get( s, propName ) +function v = get (s, propName) - switch propName - case 'gick' - v = s.gick; - otherwise - error([propName, ' is not a valid Snork property']); - end + switch propName + case 'gick' + v = s.gick; + otherwise + error ([propName, ' is not a valid Snork property']); + end end
--- a/test/classes/@Snork/getStash.m +++ b/test/classes/@Snork/getStash.m @@ -1,5 +1,5 @@ -function [ out ] = getStash(cls) +function out = getStash (l) out = myStash (); - + end
--- a/test/classes/@Snork/gick.m +++ b/test/classes/@Snork/gick.m @@ -1,10 +1,10 @@ -function [ out ] = gick( in, val ) +function out = gick (in, val) - if (nargin==1) + if (nargin == 1) out = in.gick; else in.gick = val; out = in; end - + end
--- a/test/classes/@Snork/gt.m +++ b/test/classes/@Snork/gt.m @@ -1,7 +1,7 @@ -function b = gt(s1, s2) +function b = gt (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); b = (x1(1) > x2(1));
--- a/test/classes/@Snork/horzcat.m +++ b/test/classes/@Snork/horzcat.m @@ -1,8 +1,8 @@ -function s = horzcat(s1, s2) +function s = horzcat (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork([x1 x2]); + s = Snork ([x1 x2]); end
--- a/test/classes/@Snork/ldivide.m +++ b/test/classes/@Snork/ldivide.m @@ -1,7 +1,7 @@ -function s = ldivide(s1, s2) +function s = ldivide (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); s = Snork(x1 .\ x2);
--- a/test/classes/@Snork/le.m +++ b/test/classes/@Snork/le.m @@ -1,7 +1,7 @@ -function b = le(s1, s2) +function b = le (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); b = (x1(1) <= x2(1));
--- a/test/classes/@Snork/loadobj.m +++ b/test/classes/@Snork/loadobj.m @@ -1,6 +1,6 @@ -function [ out ] = loadobj( in ) +function out = loadobj (in) out = in; out.cack = [-1 -2 -3 -4]; - + end
--- a/test/classes/@Snork/lt.m +++ b/test/classes/@Snork/lt.m @@ -1,7 +1,7 @@ -function b = lt(s1, s2) +function b = lt (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); b = (x1(1) < x2(1));
--- a/test/classes/@Snork/minus.m +++ b/test/classes/@Snork/minus.m @@ -1,8 +1,8 @@ -function s = minus(s1, s2) +function s = minus (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork(x1 - x2); + s = Snork (x1 - x2); end
--- a/test/classes/@Snork/mldivide.m +++ b/test/classes/@Snork/mldivide.m @@ -1,8 +1,8 @@ -function s = mldivide(s1, s2) +function s = mldivide (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork(x1 \ x2); + s = Snork (x1 \ x2); end
--- a/test/classes/@Snork/mpower.m +++ b/test/classes/@Snork/mpower.m @@ -1,7 +1,7 @@ -function s = mpower(s1, x) +function s = mpower (s1, x) - if ~isa(s1, 'Snork') || isa(x, 'Snork') - error('mpower Snork!!!'); + if (~isa (s1, 'Snork') || isa (x, 'Snork')) + error ('mpower Snork!!!'); end s = s1;
--- a/test/classes/@Snork/mrdivide.m +++ b/test/classes/@Snork/mrdivide.m @@ -1,8 +1,8 @@ -function s = mrdivide(s1, s2) +function s = mrdivide (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork(x1 / x2); + s = Snork (x1 / x2); end
--- a/test/classes/@Snork/mtimes.m +++ b/test/classes/@Snork/mtimes.m @@ -1,8 +1,8 @@ -function s = mtimes(s1, s2) +function s = mtimes (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork(x1 * x2); + s = Snork (x1 * x2); end
--- a/test/classes/@Snork/ne.m +++ b/test/classes/@Snork/ne.m @@ -1,4 +1,4 @@ -function b = ne(s1, s2) +function b = ne (s1, s2) b = ~(s1 == s2);
--- a/test/classes/@Snork/plus.m +++ b/test/classes/@Snork/plus.m @@ -1,8 +1,8 @@ -function s = plus(s1, s2) +function s = plus (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork(x1 + x2); + s = Snork (x1 + x2); -end \ No newline at end of file +end
--- a/test/classes/@Snork/power.m +++ b/test/classes/@Snork/power.m @@ -1,7 +1,7 @@ -function s = power(s1, x) +function s = power (s1, x) - if ~isa(s1, 'Snork') || isa(x, 'Snork') - error('power Snork!!!'); + if (~isa (s1, 'Snork') || isa (x, 'Snork')) + error ('power Snork!!!'); end s = s1;
--- a/test/classes/@Snork/private/myStash.m +++ b/test/classes/@Snork/private/myStash.m @@ -1,5 +1,5 @@ -function [ out ] = myStash () +function out = myStash () out = 1; - + end
--- a/test/classes/@Snork/rdivide.m +++ b/test/classes/@Snork/rdivide.m @@ -1,7 +1,7 @@ -function s = rdivide(s1, s2) +function s = rdivide (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); s = Snork(x1 ./ x2);
--- a/test/classes/@Snork/saveobj.m +++ b/test/classes/@Snork/saveobj.m @@ -1,6 +1,6 @@ -function [ out ] = saveobj( in ) +function out = saveobj (in) out = in; out.cack = []; - + end
--- a/test/classes/@Snork/set.m +++ b/test/classes/@Snork/set.m @@ -1,7 +1,7 @@ -function [ s ] = set( s, varargin ) +function s = set (s, varargin) propArgs = varargin; - while (length(propArgs) >= 2) + while (length (propArgs) >= 2) propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); @@ -9,7 +9,7 @@ case 'gick' s.gick = propValue; otherwise - error([propName, ' is not a valid Snork property']); + error ([propName, ' is not a valid Snork property']); end end
--- a/test/classes/@Snork/subsasgn.m +++ b/test/classes/@Snork/subsasgn.m @@ -1,4 +1,5 @@ function snk = subsasgn (snk, s, val) + if (length (s) < 1) error ('Snork: needs index'); end @@ -35,4 +36,5 @@ otherwise error ('invalid subscript type'); end + end
--- a/test/classes/@Snork/subsindex.m +++ b/test/classes/@Snork/subsindex.m @@ -1,5 +1,5 @@ -function [ out ] = subsindex( obj ) +function out = subsindex (obj) out = 0; - + end
--- a/test/classes/@Snork/subsref.m +++ b/test/classes/@Snork/subsref.m @@ -1,4 +1,5 @@ function b = subsref (snk, s) + if (isempty (s)) error ('Snork: missing index'); end @@ -27,4 +28,5 @@ otherwise error ('invalid subscript type'); end + end
--- a/test/classes/@Snork/tattack.m +++ b/test/classes/@Snork/tattack.m @@ -1,5 +1,5 @@ -function s = tattack(x, y) - +function s = tattack (x, y) + s = 'Snork'; - + end
--- a/test/classes/@Snork/times.m +++ b/test/classes/@Snork/times.m @@ -1,8 +1,8 @@ -function s = times(s1, s2, s3) +function s = times (s1, s2, s3) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork(x1 .* x2); + s = Snork (x1 .* x2); end
--- a/test/classes/@Snork/uminus.m +++ b/test/classes/@Snork/uminus.m @@ -1,6 +1,6 @@ -function s = uminus(s1) +function s = uminus (s1) s = s1; s.gick = - s.gick; -end \ No newline at end of file +end
--- a/test/classes/@Snork/uplus.m +++ b/test/classes/@Snork/uplus.m @@ -1,4 +1,4 @@ -function s = uplus(s1) +function s = uplus (s1) s = s1;
--- a/test/classes/@Snork/vertcat.m +++ b/test/classes/@Snork/vertcat.m @@ -1,8 +1,8 @@ -function s = vertcat(s1, s2) +function s = vertcat (s1, s2) - x1 = double(s1); - x2 = double(s2); + x1 = double (s1); + x2 = double (s2); - s = Snork([x1; x2]); + s = Snork ([x1; x2]); end
--- a/test/classes/@Spork/Spork.m +++ b/test/classes/@Spork/Spork.m @@ -1,17 +1,16 @@ -function [ s ] = Spork( geek ) +function s = Spork (geek) % Test class. - if (nargin==1) && isa(geek, 'Spork') - s = geek; + if (nargin == 1 && isa (geek, 'Spork')) + s = geek; else s.cack = [-1 -2 -3 -4]; - if nargin==0 + if (nargin == 0) s.geek = 1; else s.geek = geek; end - s = class(s, 'Spork'); - + s = class (s, 'Spork'); end - + end
--- a/test/classes/@Spork/cack.m +++ b/test/classes/@Spork/cack.m @@ -1,5 +1,5 @@ -function [ out ] = cack( in ) +function out = cack (in) out = in.cack; - + end
--- a/test/classes/@Spork/display.m +++ b/test/classes/@Spork/display.m @@ -1,7 +1,7 @@ -function display( s ) +function display (s) - disp([inputname(1),'.geek = ']) - disp(' '); - disp(s.geek); + disp ([inputname(1),'.geek = ']); + disp (' '); + disp (s.geek); -end \ No newline at end of file +end
--- a/test/classes/@Spork/geek.m +++ b/test/classes/@Spork/geek.m @@ -1,10 +1,10 @@ -function [ out ] = geek( in, val ) +function out = geek (in, val) - if (nargin==1) + if (nargin == 1) out = in.geek; else in.geek = val; out = in; end - + end
--- a/test/classes/@Spork/get.m +++ b/test/classes/@Spork/get.m @@ -1,10 +1,10 @@ -function [ v ] = get( s, propName ) +function v = get (s, propName) - switch propName - case 'geek' - v = s.geek; - otherwise - error([propName, ' is not a valid Spork property']); - end + switch propName + case 'geek' + v = s.geek; + otherwise + error ([propName, ' is not a valid Spork property']); + end end
--- a/test/classes/@Spork/getStash.m +++ b/test/classes/@Spork/getStash.m @@ -1,5 +1,5 @@ -function [ out ] = getStash(cls) +function out = getStash (cls) out = myStash (); - + end
--- a/test/classes/@Spork/loadobj.m +++ b/test/classes/@Spork/loadobj.m @@ -1,8 +1,8 @@ -function [ out ] = loadobj( in ) +function out = loadobj (in) out = in; - if (~isa(in,'Spork')) - out.cack=[]; + if (~isa (in, 'Spork')) + out.cack = []; end - + end
--- a/test/classes/@Spork/private/myStash.m +++ b/test/classes/@Spork/private/myStash.m @@ -1,5 +1,5 @@ -function [ out ] = myStash () +function out = myStash () out = 3; - + end
--- a/test/classes/@Spork/saveobj.m +++ b/test/classes/@Spork/saveobj.m @@ -1,6 +1,6 @@ -function [ out ] = saveobj( in ) +function out = saveobj (in) out = in; - %rmfield(out,'cack'); - + %rmfield (out,'cack'); + end
--- a/test/classes/@Spork/set.m +++ b/test/classes/@Spork/set.m @@ -1,7 +1,7 @@ -function [ s ] = set( s, varargin ) +function s = set (s, varargin) propArgs = varargin; - while (length(propArgs) >= 2) + while (length (propArgs) >= 2) propName = propArgs{1}; propValue = propArgs{2}; propArgs = propArgs(3:end); @@ -9,7 +9,7 @@ case 'geek' s.geek = propValue; otherwise - error([propName, ' is not a valid Spork property']); + error ([propName, ' is not a valid Spork property']); end end
--- a/test/classes/classes.tst +++ b/test/classes/classes.tst @@ -41,7 +41,7 @@ %% methods that the others don't so we can test indexing and other %% features. %!shared snk, snk1, snk2 -%!test snk = Snork(); +%!test snk = Snork (); %! assert (isequal (gick (snk), 1)); %! assert (isequal (snk.gick, 1)); %! assert (isequal (snk(2), 1)); @@ -64,10 +64,10 @@ %! assert (~ismethod (snk, 'bletch')); %! assert (exist ('snk') == 1); %! assert (exist ('blink') == 0); -%!test snk1 = Snork(snk); +%!test snk1 = Snork (snk); %! assert (isequal (class (snk1), 'Snork')); %! assert (isequal (gick (snk1), 4)); -%!test snk2 = Snork(-3); +%!test snk2 = Snork (-3); %! assert (isequal (class (snk2), 'Snork')); %! assert (isequal (gick (snk2), -3)); %!test x = [1 2 3 4]; @@ -83,7 +83,7 @@ %% sure that we haven't bollixed up the Spork class if we should make %% changes. We use Spork in the class hierarchy. %!shared sprk -%!test sprk = Spork(); +%!test sprk = Spork (); %! assert (isequal (geek (sprk), 1)); %!test sprk = geek (sprk, 3); %! assert (isequal (geek (sprk), 3)); @@ -97,7 +97,7 @@ %% sure that we haven't bollixed up the Blork class if we should make %% changes. We use Blork in the class hierarchy. %!shared blrk -%!test blrk = Blork(); +%!test blrk = Blork (); %! assert (isequal (bleek(blrk), 1)); %!test blrk = bleek (blrk, 3); %! assert (isequal (bleek (blrk), 3)); @@ -111,7 +111,7 @@ %% sure that we haven't bollixed up the Cork class if we should make %% changes. We use Cork in the class hierarchy. %!shared crk -%!test crk = Cork(23); +%!test crk = Cork (23); %! assert (isequal (click(crk), 23)); %!test crk = click(crk,3); %! assert (isequal (click(crk), 3)); @@ -122,7 +122,7 @@ %% The Dork class tests single inheritance. %!shared drk -%!test drk = Dork(); +%!test drk = Dork (); %! assert (isequal (gack (drk),0)); %!test drk = gack (drk,-2); %! assert (isequal (gack (drk),-2)); @@ -135,12 +135,12 @@ %! assert (isa (drk, 'Dork')); %! assert (isa (drk, 'Snork')); %! assert (isequal (getStash (drk), 2)); -%!test drk1 = Dork(drk); +%!test drk1 = Dork (drk); %! assert (isequal (class (drk1), 'Dork')); %! assert (isa (drk1, 'Snork')); %! assert (isequal (gick (drk1), 3)); %! assert (isequal (gack (drk1), -3)); -%!test drk2 = Dork(-4, 4); +%!test drk2 = Dork (-4, 4); %! assert (isequal (class (drk2), 'Dork')); %! assert (isa (drk2, 'Snork')); %! assert (isequal (gick (drk2), -4)); @@ -149,7 +149,7 @@ %% The Pork class is essentially a clone of Dork. It is used as part %% of the multiple inheritance test. %!shared prk, drk -%!test prk = Pork(); +%!test prk = Pork (); %! assert (isequal (geek (prk), 1)); %! assert (isequal (gurk (prk), 0)); %!test prk = gurk (prk,-3); @@ -159,13 +159,13 @@ %! assert (isequal (class (prk), 'Pork')); %! assert (isa (prk, 'Pork')); %! assert (isa (prk, 'Spork')); -%!test drk = Dork(); % Precedence. +%!test drk = Dork (); % Precedence. %! assert (isequal (bling (drk, prk), 2)); %! assert (isequal (bling (prk, drk), 2)); %% The Gork class tests aggregation and multiple inheritance. %!shared grk -%!test grk = Gork(); +%!test grk = Gork (); %! assert (isequal (gick (grk), 1)); %! assert (isequal (geek (grk), 1)); %! assert (isequal (gack (grk), 0)); @@ -189,7 +189,7 @@ %! assert (isequal (gark (grk), -6)); %! assert (isequal (click (cork (grk)), 23)); %!test -%! cork1 = Cork(13); +%! cork1 = Cork (13); %! grk = set (grk, 'gick', -5, 'gack', -6, 'gark', -7, 'cork', cork1); %! assert (isequal (get (grk, 'gick'), -5)); %! assert (isequal (get (grk, 'gack'), -6)); @@ -212,9 +212,9 @@ %% Common variables for testing overloaded operators %!shared x1, x2, x3, s1, s2, s3 -%! x1 = 1 + rand(3); s1 = Snork(x1); -%! x2 = 1 + rand(3); s2 = Snork(x2); -%! x3 = diag([1 2 3]); s3 = Snork(x3); +%! x1 = 1 + rand (3); s1 = Snork (x1); +%! x2 = 1 + rand (3); s2 = Snork (x2); +%! x3 = diag ([1 2 3]); s3 = Snork (x3); %% Test overloaded plus (+) and uplus (unitary +) for the Snork class %!test s = s1 + s2; assert (isa (s, 'Snork') && isequal (s.gick, x1 + x2)); @@ -226,7 +226,7 @@ %!test s = s1 - s2; assert (isa (s, 'Snork') && isequal (s.gick, x1 - x2)); %!test s = s1 - x2; assert (isa (s, 'Snork') && isequal (s.gick, x1 - x2)); %!test s = x1 - s2; assert (isa (s, 'Snork') && isequal (s.gick, x1 - x2)); -%!test s = -s1; assert (isequal (s, Snork(-x1))); +%!test s = -s1; assert (isequal (s, Snork (-x1))); %% Test overloaded mtimes (*) for the Snork class %!test s = s1 * s2; assert (isa (s, 'Snork') && isequal (s.gick, x1 * x2)); @@ -322,7 +322,7 @@ %% Test with the Blork class, where neither vertcat() nor horzcat() is overloaded %!shared x1, x2, x3 -%!test x1 = Blork(); +%!test x1 = Blork (); %!test x2 = [x1 x1]; %!assert (isa (x2, 'Blork') && isequal (size (x2), [1 2])); %!test x2 = [x1 51]; @@ -340,23 +340,24 @@ %% default: leftmost object wins %!shared A, B -%!test A = Snork(rand(2)); -%!test B = CPrecedenceTester1(); % no call to inferiorto/superiorto +%!test A = Snork (rand (2)); +%!test B = CPrecedenceTester1 (); % no call to inferiorto/superiorto %!assert (isequal (tattack (A, B), 'Snork')) %!assert (isequal (tattack (B, A), 'CPrecedenceTester1')) % idem %!shared A, B -%!test A = Snork(rand(2)); -%!test B = CPrecedenceTester2(1); % CPrecedenceTester2 > Snork +%!test A = Snork (rand (2)); +%!test B = CPrecedenceTester2 (1); % CPrecedenceTester2 > Snork %!assert (isequal (tattack (A, B), 'CPrecedenceTester2')) %!assert (isequal (tattack (B, A), 'CPrecedenceTester2')) %% Trying to change to CPrecendenceTester < Snork -%!error D = CPrecedenceTester2(2); +%!error D = CPrecedenceTester2 (2); %!shared A, B -%!test A = Snork(rand(2)); -%!test B = CPrecedenceTester3(2); % CPrecedenceTester3 < Snork +%!test A = Snork (rand (2)); +%!test B = CPrecedenceTester3 (2); % CPrecedenceTester3 < Snork %!assert (isequal (tattack (A, B), 'Snork')) %!assert (isequal (tattack (B, A), 'Snork')) %% Trying to change to CPrecendenceTester3 > Snork -%!error D = CPrecedenceTester3(1); +%!error D = CPrecedenceTester3 (1); +
--- a/test/ctor-vs-method/__trace__.m +++ b/test/ctor-vs-method/__trace__.m @@ -1,5 +1,6 @@ function r = __trace__ (t) persistent history + if (isempty (history)) history = {}; end @@ -14,5 +15,5 @@ else error ('incorrect call to __trace__'); end + end - \ No newline at end of file
--- a/test/error.tst +++ b/test/error.tst @@ -19,20 +19,20 @@ ## Test %!error usage %% test/octave.test/error/error-1.m -%!function g () +%!function g () %! error ("foo"); %!endfunction -%!function f () -%! g (); +%!function f () +%! g (); %!endfunction %!error <foo> f () %% test/octave.test/error/error-2.m -%!function g () +%!function g () %! error ("foo\n"); %!endfunction -%!function f () -%! g +%!function f () +%! g %!endfunction %!error <foo> f () @@ -59,29 +59,29 @@ %! ws = warning ("query", "backtrace"); %! warning ("on", "backtrace"); %! st.state = "on"; -%! assert(warning ("query", "backtrace"), st); +%! assert (warning ("query", "backtrace"), st); %! warning ("off", "backtrace"); %! st.state = "off"; -%! assert(warning ("query", "backtrace"), st); +%! assert (warning ("query", "backtrace"), st); %! warning (ws.state, "backtrace"); ## Test usage() function %% test/octave.test/error/usage-1.m -%!function g () +%!function g () %! usage ("foo"); %!endfunction -%!function f () -%! g (); +%!function f () +%! g (); %!endfunction %!error <foo> f () %% test/octave.test/error/usage-2.m -%!function g () +%!function g () %! usage ("foo"); %!endfunction -%!function f () -%! g +%!function f () +%! g %!endfunction %!error <foo> f ()
--- a/test/eval-catch.tst +++ b/test/eval-catch.tst @@ -48,7 +48,7 @@ %!endfunction %!test %! eval ("clear a; a; str='';", "str = mangle (lasterr);"); -%! assert (mangle(lasterr)(1:14), "<'a' undefined"); +%! assert (mangle (lasterr)(1:14), "<'a' undefined"); %! assert (str(1:14), "<'a' undefined"); %% test/octave.test/eval-catch/eval-catch-8.m
--- a/test/fcn-handle-derived-resolution/@other/getsize_arrayfun.m +++ b/test/fcn-handle-derived-resolution/@other/getsize_arrayfun.m @@ -1,3 +1,3 @@ function r = getsize_arrayfun (x) - r = arrayfun (@(i) numel (x(i).d), 1:numel(x), 'uniformoutput', true); + r = arrayfun (@(i) numel (x(i).d), 1:numel (x), 'uniformoutput', true); end
--- a/test/for.tst +++ b/test/for.tst @@ -106,6 +106,6 @@ %!test %! a = {1,3;2,4}; %! j = 0; -%! for i = cat (3, a, cellfun(@(x) 4 + x, a, "UniformOutput", 0)) +%! for i = cat (3, a, cellfun (@(x) 4 + x, a, "UniformOutput", 0)) %! assert (i, {1 + 2*j; 2 + 2*j++}) %! endfor
--- a/test/func.tst +++ b/test/func.tst @@ -16,8 +16,8 @@ ## along with Octave; see the file COPYING. If not, see ## <http://www.gnu.org/licenses/>. -## This piece of test code ensures that all operations which work on -## dimensions alone (squeeze, triu, etc.) work for all objects and +## This piece of test code ensures that all operations which work on +## dimensions alone (squeeze, triu, etc.) work for all objects and ## preserve type. Even if the object is an empty matrix. This code is ## not to check that the function itself returns teh correct result, ## just that the results are consistent for all types. @@ -93,13 +93,13 @@ %! m3 = []; %!test -%! __fntestfunc__("triu", m1, {"struct"}); +%! __fntestfunc__ ("triu", m1, {"struct"}); %!test %! __fntestfunc__ ("triu", m1, {"struct"}, -1); %!test %! __fntestfunc__ ("triu", m1, {"struct"}, 1); %!test -%! __fntestfunc__("triu", m3, {"struct"}); +%! __fntestfunc__ ("triu", m3, {"struct"}); %!test %! __fntestfunc__ ("tril", m1, {"struct"}); %!test @@ -107,7 +107,7 @@ %!test %! __fntestfunc__ ("tril", m1, {"struct"}, 1); %!test -%! __fntestfunc__("tril", m3, {"struct"}); +%! __fntestfunc__ ("tril", m3, {"struct"}); %!test %! __fntestfunc__ ("squeeze", m2); %!test
--- a/test/global.tst +++ b/test/global.tst @@ -36,7 +36,7 @@ %!endfunction %!test %! global G = 1; -%! f(); +%! f (); %% test/octave.test/global/global-4.m %!function f () @@ -54,7 +54,7 @@ %!function g () %! fail ("H"); %!test -%! g(); +%! g (); %% test/octave.test/global/global-6.m %!function f () @@ -65,8 +65,8 @@ %! assert (H,1); %!endfunction %!test -%! f(); -%! g(); +%! f (); +%! g (); %% test/octave.test/global/global-7.m %!test
--- a/test/index.tst +++ b/test/index.tst @@ -26,7 +26,7 @@ %!assert (a(:), 1) %!assert (a(:,:), 1) %!assert (a(1,:), 1) -%!assert (a(:,1),1) +%!assert (a(:,1), 1) %!assert (isempty (a(logical (0)))) %!error a(-1) %!error a(2) @@ -119,19 +119,19 @@ %!assert (b(:), [1; 3; 2; 4; 5; 7; 6; 8]) %!assert (b(:,:), [1, 2, 5, 6; 3, 4, 7, 8]) %!assert (b(:,1), [1;3]) -%!assert (b(:,:,:), reshape ([1,3,2,4,5,7,6,8],[2,2,2])) +%!assert (b(:,:,:), reshape ([1,3,2,4,5,7,6,8], [2,2,2])) %!assert (b(:,1,1), [1;3]) -%!assert (b(:,1,1,[1,1]),reshape ([1,3,1,3],[2,1,1,2])) +%!assert (b(:,1,1,[1,1]),reshape ([1,3,1,3], [2,1,1,2])) %!assert (b(1,3), 5) %!assert (b(1,[3,4]), [5,6]) %!assert (b(1,1:4), [1,2,5,6]) %!assert (b(1,[],:), zeros (1,0,2)) -%!assert (b(1,[]), zeros(1,0)) +%!assert (b(1,[]), zeros (1,0)) %!assert (b(:,3), [5;7]) %!assert (b([1,2],3), [5;7]) -%!assert (b(true(2,1),3), [5;7]) -%!assert (b(false(2,1),3), zeros(0,1)) -%!assert (b([],3), zeros(0,1)) +%!assert (b(true (2,1), 3), [5;7]) +%!assert (b(false (2,1), 3), zeros (0,1)) +%!assert (b([],3), zeros (0,1)) %!shared x %! # Dummy shared block to clear any previous definitions @@ -160,7 +160,7 @@ %! assert (a, b); %!test -%! a(:,:,:) = 1:4; +%! a(:,:,:) = 1:4; %! assert (a, [1:4]); %!test
--- a/test/io.tst +++ b/test/io.tst @@ -16,7 +16,7 @@ ## along with Octave; see the file COPYING. If not, see ## <http://www.gnu.org/licenses/>. -## FIXME -- we should skip (or mark as an expected failure) the test for +## FIXME: we should skip (or mark as an expected failure) the test for ## saving sparse matrices to MAT files when using 64-bit indexing since ## that is not implemented yet. @@ -35,11 +35,11 @@ %! ## scalar %! a1 = 1; %! ## matrix -%! persistent a2 = hilb(3); +%! persistent a2 = hilb (3); %! ## complex scalar %! persistent a3 = 1 + 1i; %! ## complex matrix -%! persistent a4 = hilb(3) + 1i*hilb(3); +%! persistent a4 = hilb (3) + 1i*hilb (3); %! ## bool %! persistent a5 = (1 == 1); %! ## bool matrix @@ -119,11 +119,11 @@ %! if (! isequal (a8, b8)) %! error ("failed: %s struct", file); %! endif -%! +%! %! if (! isequal (a9, b9)) %! error ("failed: %s cell", file); %! endif -%! +%! %! if (! isequal (a10, b10)) %! error ("failed: %s string", file); %! endif @@ -171,7 +171,7 @@ %! || isglobal ("a13") || isglobal ("a14") || isglobal ("a15") %! || isglobal ("a16") || isglobal ("a17") || isglobal ("a18") %! || isglobal ("a19") || isglobal ("a20")) -%! error ("failed: %s global test", file); +%! error ("failed: %s global test", file); %! endif %! endfor %! endif @@ -180,24 +180,24 @@ %!endfunction %!test -%! +%! %! [save_status, save_files] = testls (0); %! [load_status, load_files] = testls (1); -%! +%! %! for f = [save_files, load_files] %! unlink (f{1}); %! endfor -%! +%! %! assert (save_status && load_status); %!test -%! +%! %! STR.scalar_fld = 1; %! STR.matrix_fld = [1.1,2;3,4]; %! STR.string_fld = "Octave"; %! STR.struct_fld.x = 0; %! STR.struct_fld.y = 1; -%! +%! %! save struct.dat -struct STR; %! STR = load ("struct.dat"); %! @@ -211,7 +211,7 @@ %! save -binary struct.dat -struct STR matrix_fld str*_fld; %! STR = load ("struct.dat"); %! -%! assert (!isfield(STR,"scalar_fld") && ... +%! assert (!isfield (STR,"scalar_fld") && ... %! STR.matrix_fld == [1.1,2;3,4] && ... %! STR.string_fld == "Octave" && ... %! STR.struct_fld.x == 0 && ... @@ -282,7 +282,7 @@ %! [a, b, c] = sscanf ("1.2 3 foo", "%f%d%s", "C"); %! [v1, c1, m1] = sscanf ("1 2 3 4 5 6", "%d"); %! [v2, c2, m2] = sscanf ("1 2 bar 3 4 5 6", "%d"); -%! +%! %! assert ((a == 1.2 && b == 3 && c == "foo" %! && v1 == [1; 2; 3; 4; 5; 6] && c1 == 6 && ischar (m1) %! && v2 == [1; 2] && c2 == 2 && ischar (m2))); @@ -305,13 +305,13 @@ %% test/octave.test/io/printf-1.m %!test %! nm = tmpnam (); -%! fid1 = fopen(nm,"w"); +%! fid1 = fopen (nm,"w"); %! x = fprintf (fid1, "%s: %d\n", "test", 1); -%! fclose(fid1); -%! fid2 = fopen(nm,"r"); -%! str = fscanf(fid2,"%s"); -%! fclose(fid2); -%! unlink(nm); +%! fclose (fid1); +%! fid2 = fopen (nm,"r"); +%! str = fscanf (fid2,"%s"); +%! fclose (fid2); +%! unlink (nm); %! assert (x, 8); %! assert (str, "test:1"); @@ -324,7 +324,7 @@ %% test/octave.test/io/sprintf-1.m %!test %! [s, msg, status] = sprintf ("%s: %d\n", "test", 1); -%! +%! %! assert (s == "test: 1\n" && ischar (msg) && status == 8); %% test/octave.test/io/sprintf-2.m @@ -336,9 +336,9 @@ %% test/octave.test/io/fopen-1.m %!test %! arch_list = ["native"; "ieee-le"; "ieee-be"; "vaxd"; "vaxg"; "cray"]; -%! +%! %! status = 1; -%! +%! %! for i = 1:6 %! arch = deblank (arch_list (i,:)); %! for j = 1:6 @@ -386,7 +386,7 @@ %! break; %! endif %! endfor -%! +%! %! assert (status == 1); %% test/octave.test/io/fopen-2.m @@ -433,7 +433,7 @@ %! "uint"; "unsigned int"; "long"; "ulong"; "unsigned long"; %! "float"; "float32"; "real*4"; "double"; "float64"; %! "real*8"; "int16"; "integer*2"; "int32"; "integer*4"]; -%! +%! %! n = rows (type_list); %! nm = tmpnam (); %! id = fopen (nm, "wb"); @@ -443,20 +443,20 @@ %! endfor %! %! fclose (id); -%! +%! %! id = fopen (nm, "rb"); %! if (id > 0) %! x = zeros (1, n); %! for i = 1:n %! x(i) = fread (id, [1, 1], deblank (type_list(i,:))); %! endfor -%! +%! %! if (x == 1:n) %! __printf_assert__ ("ok\n"); %! endif %! endif %! endif -%! +%! %! unlink (nm); %! assert (__prog_output_assert__ ("ok"));
--- a/test/line-continue.tst +++ b/test/line-continue.tst @@ -30,7 +30,7 @@ %! x = [1;2]; %! y = [a... # comments here ok %! ;\ -%! +%! %! b]; %! assert (y, x); @@ -58,9 +58,9 @@ %!test %! x = [1, ... -%! +%! %! ... -%! +%! %! 2]; %! y = [1;2]; %! assert (y, x);
--- a/test/prefer.tst +++ b/test/prefer.tst @@ -95,14 +95,14 @@ %!test %! wrre = warning ("query", "Octave:resize-on-range-error"); %! warning ("off", "Octave:resize-on-range-error"); -%! clear a; -%! a(2) = 1; a(3) = 2; +%! clear a; +%! a(2) = 1; a(3) = 2; %! assert (all (a == [0,1,2])); %! warning (wrre.state, "Octave:resize-on-range-error"); %% test/octave.test/prefer/prefer-18.m %!test -%! clear a; +%! clear a; %! a(1) = 1; a(2) = 2; %! assert (all (a == [1,2])); @@ -137,7 +137,7 @@ %! save_precision (1); %! x = pi; %! nm = tmpnam (); -%! save("-text", nm, "x"); +%! save ("-text", nm, "x"); %! clear x; %! load (nm); %! unlink (nm); @@ -150,14 +150,14 @@ %! save_precision (5); %! x = pi; %! nm = tmpnam (); -%! save("-text", nm, "x"); +%! save ("-text", nm, "x"); %! clear x; %! load (nm); %! unlink (nm); %! assert (x, 3.1416); %! save_precision (sp); -%% FIXME: How to capture standard output for comparison? +%% FIXME: How to capture standard output for comparison? %% test/octave.test/prefer/prefer-29.m %!function f () %! 1 @@ -169,7 +169,7 @@ %! assert (??); %! silent_functions (sf); -%% FIXME Same problem as above!!! +%% FIXME: Same problem as above!!! %% test/octave.test/prefer/prefer-30.m %!function f () %! 1
--- a/test/range.tst +++ b/test/range.tst @@ -40,14 +40,14 @@ %!assert ([ r ; sparse(z) ], sparse (expect)) %!assert ([ r ; sparse(logical(z)) ], sparse (expect)) -%!assert ([ r ; int8(z) ], int8(expect)) -%!assert ([ r ; int16(z) ], int16(expect)) -%!assert ([ r ; int32(z) ], int32(expect)) -%!assert ([ r ; int64(z) ], int64(expect)) -%!assert ([ r ; uint8(z) ], uint8(expect)) -%!assert ([ r ; uint16(z) ], uint16(expect)) -%!assert ([ r ; uint32(z) ], uint32(expect)) -%!assert ([ r ; uint64(z) ], uint64(expect)) +%!assert ([ r ; int8(z) ], int8 (expect)) +%!assert ([ r ; int16(z) ], int16 (expect)) +%!assert ([ r ; int32(z) ], int32 (expect)) +%!assert ([ r ; int64(z) ], int64 (expect)) +%!assert ([ r ; uint8(z) ], uint8 (expect)) +%!assert ([ r ; uint16(z) ], uint16 (expect)) +%!assert ([ r ; uint32(z) ], uint32 (expect)) +%!assert ([ r ; uint64(z) ], uint64 (expect)) ## Test mixing non-integer range with other types @@ -63,14 +63,14 @@ %!assert ([ r ; sparse(z) ], sparse (expect)) %!assert ([ r ; sparse(logical(z)) ], sparse (expect)) -%!assert ([ r ; int8(z) ], int8(expect)) -%!assert ([ r ; int16(z) ], int16(expect)) -%!assert ([ r ; int32(z) ], int32(expect)) -%!assert ([ r ; int64(z) ], int64(expect)) -%!assert ([ r ; uint8(z) ], uint8(expect)) -%!assert ([ r ; uint16(z) ], uint16(expect)) -%!assert ([ r ; uint32(z) ], uint32(expect)) -%!assert ([ r ; uint64(z) ], uint64(expect)) +%!assert ([ r ; int8(z) ], int8 (expect)) +%!assert ([ r ; int16(z) ], int16 (expect)) +%!assert ([ r ; int32(z) ], int32 (expect)) +%!assert ([ r ; int64(z) ], int64 (expect)) +%!assert ([ r ; uint8(z) ], uint8 (expect)) +%!assert ([ r ; uint16(z) ], uint16 (expect)) +%!assert ([ r ; uint32(z) ], uint32 (expect)) +%!assert ([ r ; uint64(z) ], uint64 (expect)) ## Test corner cases of ranges (base and limit)
--- a/test/recursion.tst +++ b/test/recursion.tst @@ -26,7 +26,7 @@ %! endif %!endfunction %! -%!assert(f (5), 120); +%!assert (f (5), 120) %% test/octave.test/recursion/recursion-2.m %!function y = f (x) @@ -38,6 +38,7 @@ %! endif %!endfunction %! -%!assert(f (5), 120); +%!assert (f (5), 120) %%FIXME: Need test for maximum recursion depth +
--- a/test/return.tst +++ b/test/return.tst @@ -23,7 +23,7 @@ %! y = 2; %!endfunction %! -%!assert(f(), 1) +%!assert (f (), 1) %% test/octave.test/return/return-2.m %!test
--- a/test/slice.tst +++ b/test/slice.tst @@ -32,7 +32,7 @@ %! case 33 %! x(:, :, slice) = 2; %! otherwise -%! error("invalid dim, '%d'", dim); +%! error ("invalid dim, '%d'", dim); %! endswitch %!endfunction
--- a/test/struct.tst +++ b/test/struct.tst @@ -152,8 +152,8 @@ %! c(4, 4, 4, 4).name = "a"; %! c(3, 3, 3, 3).value = 1; %! [c([1, 3], 2, :, [3, 4]).value] = deal (1); -%! assert (length(find([c.value] == 1)), 17); -%! assert (length(find([c.value])), 17); +%! assert (length (find ([c.value] == 1)), 17); +%! assert (length (find ([c.value])), 17); ## swap elements of struct array %!test @@ -166,7 +166,7 @@ %! c(4, 4, 4, 4).value = 3; %! c(1, 2, 3, 4).value = 2; %! c(3, 3, 3, 3).value = 1; -%! d = reshape ({c.value}, size(c)); +%! d = reshape ({c.value}, size (c)); %! assert ([d{4, 4, 4, 4}, d{1, 2, 3, 4}, d{3, 3, 3, 3}], %! [3, 2, 1]);
--- a/test/switch.tst +++ b/test/switch.tst @@ -21,12 +21,12 @@ %! a = 1; %! b = 2; %! c = 3; -%! +%! %! switch 0 case 1 x = a; case 2 x = b; otherwise x = c; endswitch %! switch 1 case 1 y = a; case 2 y = b; otherwise y = c; endswitch %! switch 2 case 1 z = a; case 2 z = b; otherwise z = c; endswitch %! switch 3 case 1 p = a; case 2 p = b; otherwise p = c; endswitch -%! +%! %! assert (x == c && y == a && z == b && p == c); %% test/octave.test/switch/switch-2.m @@ -34,11 +34,11 @@ %! a = 1; %! b = 2; %! c = 3; -%! +%! %! x = zeros (1, 4); -%! +%! %! k = 1; -%! +%! %! for i = 0:3 %! switch (i) %! case a @@ -50,7 +50,7 @@ %! endswitch %! k++; %! endfor -%! +%! %! assert (all (x == [3, 1, 2, 3])); %% test/octave.test/switch/switch-3.m @@ -58,11 +58,11 @@ %! a = 1; %! b = 2; %! c = 3; -%! +%! %! x = zeros (1, 4); -%! +%! %! k = 1; -%! +%! %! for i = 0:3 %! switch (i) %! case a @@ -70,7 +70,7 @@ %! endswitch %! k++; %! endfor -%! +%! %! assert (all (x == [0, 1, 0, 0])); %!test @@ -80,7 +80,7 @@ %! otherwise %! a = 2; %! endswitch -%! +%! %! assert (a == 2);
--- a/test/system.tst +++ b/test/system.tst @@ -155,14 +155,14 @@ %! s1 = stat (nm); %! fclose (id); %! unlink (nm); -%! +%! %! umask (777); %! nm = tmpnam (); %! id = fopen (nm, "wb"); %! s2 = stat (nm); %! fclose (id); %! unlink (nm); -%! +%! %! assert (deblank (s1.modestr), "-rw-rw-rw-"); %! assert (deblank (s2.modestr), "----------"); %! # Restore original umask value @@ -361,7 +361,7 @@ %! else %! assert ("/", d1); %! endif -%! assert (pwd(), xdir); +%! assert (pwd (), xdir); %% test/octave.test/system/cd-2.m %!error cd (1) @@ -372,7 +372,7 @@ %% test/octave.test/system/getpwent-1.m %!testif HAVE_GETPWENT %! s = getpwent (); -%! endpwent (); +%! endpwent (); %! assert ((isstruct (s) %! && isfield (s, "name") %! && isfield (s, "passwd") @@ -389,7 +389,7 @@ %!testif HAVE_GETPWUID %! x = getpwent (); %! y = getpwuid (x.uid); -%! endpwent (); +%! endpwent (); %! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); %% test/octave.test/system/getpwuid-2.m @@ -402,7 +402,7 @@ %!testif HAVE_GETPWNAM %! x = getpwent (); %! y = getpwnam (x.name); -%! endpwent (); +%! endpwent (); %! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); %% test/octave.test/system/getpwnam-2.m @@ -416,7 +416,7 @@ %! x = getpwent (); %! setpwent (); %! y = getpwent (); -%! endpwent (); +%! endpwent (); %! assert (strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); %% test/octave.test/system/setpwent-2.m