From 518ca8e355723eeb8237ffde3b7f4284b35c998f Mon Sep 17 00:00:00 2001 From: tajmone Date: Thu, 14 Nov 2019 08:43:49 +0100 Subject: [PATCH] Hugo v1.1.0 * Hugo Syntax: * Merge `hugo-lang-dev` branch into `master` with new Hugo v1.1.0 syntax, as submitted to Highlight (See: saalen/highlight!122). This should make the Highlight GitLab CI tests for Hugo pass, since the Hugo syntax has changed considerably and the old tests no longer apply. * Repository Settings: * Tweak and optimize Git setting. * Add Hugo patterns to Git and EditorConfig setting. * Polish all Hugo files to pass EClint validation. NOTE: Had to disable `charset = latin1` for Hugo in `.editorconfig` due to a bug reporting acute accents as an invalid Latin1 chars. ( See: https://github.com/jedmao/eclint/issues/169 ) --- .editorconfig | 45 ++- .gitattributes | 96 +++-- .gitignore | 43 ++- hugo/README.adoc | 79 +++- hugo/hugo.lang | 205 ++++++++--- hugo/syntax_test_chars.hug | 12 +- hugo/syntax_test_comments.hug | 4 +- hugo/syntax_test_compiler-directives.hug | 4 +- hugo/syntax_test_digits-&-operators.hug | 4 +- hugo/syntax_test_filepaths-include.hug | 23 ++ hugo/syntax_test_filepaths-resources.hug | 25 ++ hugo/syntax_test_interpolation-ascii.hug | 15 +- hugo/syntax_test_keywords.hug | 11 +- hugo/syntax_test_limit-settings.hug | 30 +- hugo/syntax_test_strings.hug | 62 ++-- hugo/syntax_test_token-list.hug | 445 +++++++++++++++++++++++ hugo/test.sh | 2 +- 17 files changed, 892 insertions(+), 213 deletions(-) create mode 100644 hugo/syntax_test_filepaths-include.hug create mode 100644 hugo/syntax_test_filepaths-resources.hug create mode 100644 hugo/syntax_test_token-list.hug diff --git a/.editorconfig b/.editorconfig index ac1fce1..f8da35c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,11 +1,20 @@ -################################################################################ -# Highlight Languages Test Suite: # -# https://gitlab.com/tajmone/highlight-test-suite # -# https://github.com/tajmone/highlight-test-suite # -################################################################################ +##################################################### +# Highlight Languages Test Suite # +# https://gitlab.com/tajmone/highlight-test-suite # +##################################################### + +; EditoConfig settings to enforce consistent code styles: +; https://editorconfig.org + +; For validating and fixing files against these settings: +; https://www.npmjs.com/package/eclint root = true +# =================== +# REPOSITORY SETTINGS +# =================== +# These settings apply to the whole project. ## Configurations ################# @@ -18,8 +27,8 @@ trim_trailing_whitespace = true insert_final_newline = true -## Lua Scripts -############## +## Highlight (Lua) Scripts +########################## [*.{lua,lang,theme}] indent_style = space indent_size = 2 @@ -38,4 +47,26 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true +# ==================== +# TEST-LANGUAGES FILES +# ==================== +# When a new language is added to the tests, all its associated files extensions +# should be added to this section to ensure correct editor/IDE configurations +# and EditorConfig validation. + + +## Hugo Interactive Fiction +########################### +; Hugo sources are strictly in ISO-8859-1 (aka Latin1). +; https://www.generalcoffee.com/hugo + +[hugo/*.{hug,h,g}] +; charset = latin1 # BUGGY: reports acute accent as invalid char. +; (see: github.com/jedmao/eclint#169) +indent_style = space +indent_size = unset +end_of_line = unset +trim_trailing_whitespace = true +insert_final_newline = true + # EOF # diff --git a/.gitattributes b/.gitattributes index 6501768..8ce26a1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,16 +1,22 @@ -################################################################################ -# Highlight Languages Test Suite: # -# https://gitlab.com/tajmone/highlight-test-suite # -# https://github.com/tajmone/highlight-test-suite # -################################################################################ +##################################################### +# Highlight Languages Test Suite # +# https://gitlab.com/tajmone/highlight-test-suite # +##################################################### + +# =================== +# REPOSITORY SETTINGS +# =================== +# These settings apply to the whole project. + * text=auto -# ============================================================================== -# PROJECT FILES -# ============================================================================== -## ============= -## DOCUMENTATION -## ============= +## Highlight +############ +*.lang text +*.theme text + +## Documentation +################ *.adoc text *.asciidoc text *.markdown text @@ -19,9 +25,8 @@ COPYING text LICENSE text -## =================== -## REPO CONFIGURATIONS -## =================== +## Repository configurations +############################ .editorconfig text eol=lf .gitlab-ci.yml text eol=lf .travis.yml text eol=lf @@ -31,56 +36,37 @@ LICENSE text .gitignore text eol=lf .gitmodules text eol=lf -## ============= -## SHELL SCRIPTS -## ============= -*.bat text eol=crlf -*.com text eol=crlf -*.sh text eol=lf -*.ps1 text eol=crlf +## Shell scripts +################ +*.bat text eol=crlf +*.com text eol=crlf +*.sh text eol=lf +*.ps1 text eol=crlf -# ============================================================================== -# TEST-LANGUAGES FILES -# ============================================================================== +# ==================== +# TEST-LANGUAGES FILES +# ==================== # When a new language is added to the tests, all its associated files extensions # should be added to this section to ensure correct EOL normalization. ## PureBasic -############ -*.pb text -*.pbi text -*.pbp text -*.pbf text -*.cfg text +############### +purebasic/*.pb text +purebasic/*.pbf text +purebasic/*.pbf gitlab-language=PureBasic +purebasic/*.pbf linguist-language=PureBasic +purebasic/*.pbi text ## Nim -###### -*.nim text +######### +nim/*.nim text ## Hugo Interactive Fiction ########################### -*.hug text -hugo/*.lst text -hugo/*.hex binary - -# ============================================================================== -# GitHub Linguist -# ============================================================================== -# -- https://github.com/github/linguist -# -# Manually define/override some extension so that GitHub's Linguist library can -# 1) Correctly gather statistics on source files, and -# 2) Use proper syntax highlighting on GitHub's WebUI. - -## PureBASIC project files -## --------------------------- -*.cfg linguist-generated=true -*.pbf linguist-language=PureBasic -*.pbp linguist-generated=true -*.pbp linguist-language=XML - -## Hugo Interactive Fiction -## --------------------------- -*.hug linguist-language=Hugo +hugo/*.hug text +hugo/*.hug gitlab-language=Hugo +hugo/*.hug linguist-language=Hugo +hugo/*.lst text +hugo/*.hex binary # EOF # diff --git a/.gitignore b/.gitignore index 14daaf3..cbc52ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,32 @@ -################################################################################ -# Highlight Languages Test Suite: # -# https://gitlab.com/tajmone/highlight-test-suite # -# https://github.com/tajmone/highlight-test-suite # -################################################################################ +##################################################### +# Highlight Languages Test Suite # +# https://gitlab.com/tajmone/highlight-test-suite # +##################################################### -# ============================================================================== -# PROJECT FILES -# ============================================================================== +# =================== +# REPOSITORY SETTINGS +# =================== +# These settings apply to the whole project. -# Highlight generated html/css files_ +## Highlight +############ +# Highlight generated html/css files: *.html highlight.css # NOTE: To test HTML syntax use *.htm extension instead! -# TMP Work Files -___*.* - -# Sass +## Sass/SCSS +############ *.css.map -# ============================================================================== -# TEST-LANGUAGES FILES -# ============================================================================== +## TMP Work Files +################# +___ +___*.* + +# ==================== +# TEST-LANGUAGES FILES +# ==================== # When a new language is added to the tests, all its associated temporary files' # patterns (created by an editor/IDE or compiler) should be added to this section # to exclude them from the project. @@ -40,9 +45,9 @@ purebasic/project.cfg hugo/*.lst hugo/*.hex -# ============================================================================== -# GENERAL PURPOSE IGNORE PATTERNS -# ============================================================================== +# =============================== +# GENERAL PURPOSE IGNORE PATTERNS +# =============================== # Log Files # *.log diff --git a/hugo/README.adoc b/hugo/README.adoc index d0c88b4..2673c9a 100644 --- a/hugo/README.adoc +++ b/hugo/README.adoc @@ -1,15 +1,16 @@ = Hugo Tests Tristano Ajmone -2019-05-24: hugo.lang v1.0.0 | Hugo v3.1.03 | Highlight 3.51 +:HL_VER: 3.54 +:HugoLang_VER: 1.1.0 +2019-11-14: hugo.lang v{HugoLang_VER} | Hugo v3.1.03 | Highlight {HL_VER} :version-label: v :lang: en -:sectanchors: // TOC Settings: :toc: left :toclevels: 5 -// Sections Numbering: +// Sections Options: :sectnums!: -:sectnumlevels: 2 +:sectanchors: // Cross References: :xrefstyle: short :section-refsig: Sect. @@ -18,7 +19,6 @@ Tristano Ajmone :icons: font :linkattrs: :reproducible: -:sectanchors: // GitHub Settings for Admonitions Icons: ifdef::env-github[] :caution-caption: :fire: @@ -31,7 +31,8 @@ endif::[] // ===================================== // Custom Attributes for Reference Links // ===================================== -:purebasic_lang: pass:q[link: https://gitlab.com/saalen/highlight/blob/master/langDefs/purebasic.lang[`langDefs/purebasic.lang`^]] +:hugo-book: http://htmlpreview.github.io/?https://github.com/tajmone/hugo-book/blob/draft/docs_src/hugo-book.html +:hugo-src: https://github.com/tajmone/hugo/blob/master/source/ // ***************************************************************************** // * * @@ -51,16 +52,16 @@ To execute tests, launch `test.sh` in Bash. == Source Files Encoding -The test files are in UTF-8 encoding, with the exception of files ending in `-ascii.hug`, which are in ISO-8859-1. +The test files are all in ISO-8859-1, since Hugo doesn't support Unicode and the most common encoding for text adventures is Latin1 (although other single-byte encodings are allowed). +Technically speaking, Hugo sources should be strictly in Ascii, using escape sequences to handle special characters not present in the Ascii character set; but use of Latin1 strings is permissible (without guarantees that they will display properly on all supported OSs and terminal interpreters), -Hugo source files are likely to be in ISO-8859-1 or ASCII encoding, but in documentation projects chances are they'll come as snippets inside UTF-8 documents, or converted to UTF-8 due to toolchain requirements (e.g. Asciidoctor requires included files to be in UTF-8). +Although Hugo source files are likely to be in ISO-8859-1 or ASCII encoding, in documentation projects chances are they'll come as snippets inside UTF-8 documents, or converted to UTF-8 due to toolchain requirements (e.g. Asciidoctor requires included files to be in UTF-8). Some escape sequences characters (defined as `Interpolation`) might differ depending on the encoding of the Hugo source -- e.g. to cover the acute accent in the `\´` escape, the Hugo syntax tries to match it both in ASCII (`´`) and UTF-8 (`\xC2\xB4`). This is an example of how old languages from the pre-Unicode era might need extra care when they might be highlighted in context demanding UTF-8 conversion of the original source, for some edge-cases might be encountered for those characters from the (so called) "`extended ASCII`" charset (in this case, ISO-8859-1) which end up being econded with two bytes in UTF-8. - == About Hugo @@ -95,8 +96,62 @@ This is because prose strings are likely to contain many adjacent escapes of bot Keywords Groups: -1. Hugo keywords. -2. ASCII chars constants. -3. Limit Settings. +. Hugo keywords. +. Built-in global variables, properties and engine variables. +. ASCII chars constants, system words, properties qualifiers, boolean constants (`true`/`false`). +. Limit settings. + + +== Hugo References + +Some useful links to link:{hugo-book}[_The Hugo Book_^,title="Read 'The Hugo Book' online version"] and link:{hugo-src}[Hugo source files^] for understanding the Hugo syntax. + +* link:{hugo-book}[_The Hugo Book_^,title="Read 'The Hugo Book' online version"] -- online HTML version. +* link:https://github.com/tajmone/hugo[Hugo sources^] -- on GitHub. + + +=== Hugo Tokens + + +* link:{hugo-src}htokens.h#L78[Hugo sources: `htokens.h`^] -- array with all Hugo tokens. +* link:{hugo-book}#tokens[_The Hugo Book_: 15.1. Tokens^] -- lists all all Hugo tokens. + + +=== Built-in Engine Globals + +* link:{hugo-book}#before_we_get_to_the_routines[_The Hugo Book_: §8.1^] -- lists the twelve global variables pre-defined by the engine. +* link:{hugo-book}#globals[_The Hugo Book_: Appendix B.2^] -- lists the twelve globals pre-defined by the engine. +* link:{hugo-src}he.c#L18[Hugo sources: `he.c`^] -- predefined engine globals. + + +=== Built-in Engine Properties + +* link:{hugo-book}#before_we_get_to_the_routines[_The Hugo Book_: §8.1^] -- lists the six properties pre-defined by the engine. +* link:{hugo-book}#properties_2[_The Hugo Book_: Appendix B.5^] -- lists the six properties pre-defined by the engine. +* link:{hugo-src}hcmisc.c#L1651[Hugo sources: `hcmisc.c`^] -- predefined engine properties. +* link:{hugo-src}he.c#L32[Hugo sources: `he.c`^] -- predefined engine properties. +* link:{hugo-src}he.c#L39[Hugo sources: `he.c`^] -- predefined "`display`" object properties properties. + + +=== Built-in Engine Functions + +:fn6: pass:a,m,q[link:{hugo-book}++#_footnotedef_6++[The Hugo Book: footnote 6.^]] + +[quote, {fn6}] +____ +Built-in functions are just like other Hugo functions except that they're never defined anywhere in source code or any library file: the compiler and engine always know about them. +To distinguish them, they're generally printed in lowercase, whereas program-defined routines (including library routines) are almost always capitalized. +____ + + +=== Limit Settings + +* link:{hugo-book}#limit_settings_2[_The Hugo Book_: Appendix C: Limit Settings^]. + + +=== Compiler Directives + +* link:{hugo-book}#compiler_directives[_The Hugo Book_: §2.7. Compiler Directives^]. +* link:{hugo-src}hccomp.c#L22[Hugo sources: `hccomp.c`^] -- contains all compiler directives. // EOF // diff --git a/hugo/hugo.lang b/hugo/hugo.lang index a889c8d..3a59a4d 100644 --- a/hugo/hugo.lang +++ b/hugo/hugo.lang @@ -1,8 +1,15 @@ -- ******************************** --- * Hugo Interactive Fiction * v1.0.0 || by Tristano Ajmone: --- * www.generalcoffee.com/hugo * 2019/05/24 || https://github.com/tajmone +-- * Hugo Interactive Fiction * v1.1.0 || by Tristano Ajmone: +-- * www.generalcoffee.com/hugo * 2019/11/14 || https://github.com/tajmone -- ******************************** public domain || http://unlicense.org -------------------------------------------------------------------------------- +Description = "Hugo" Categories = {"source", "interactive fiction"} +-------------------------------------------------------------------------------- +-- file extensions: +-- .hug -- adventure source +-- .h -- library source +-- .g -- grammar source +-------------------------------------------------------------------------------- -- Syntax definition for Hugo language v3.1.03 (2006). -- http://www.generalcoffee.com/hugo/gethugo.html @@ -11,15 +18,28 @@ -- graphics, developed by Kent Tessman for The General Coffee Company Film -- Productions, released under BSD-2-Clause License. -------------------------------------------------------------------------------- --- file extensions: --- .hug -- adventure source --- .h -- library source --- .g -- grammar source +-- Syntax elements: +-- * Comments -- single line (!) and block (!/ .. /!). +-- * Strings -- double quotes (") escapable with (\") +-- * Escape -- various + ASCII escapes. +-- * Interpolation -- special non-ASCII characters. +-- * PreProcessor +-- * Operators +-- * Digits -- decimal integers only. +-- * Keywords 1 -- Hugo reserved keywords. +-- * Keywords 2 -- Predefined Hugo stored values: +-- * Built-in Global Variables. +-- * Built-in Properties. +-- * Built-in Engine Variables. +-- * Keywords 3 -- Various elements that didn't fit elsewhere: +-- * Chars constants. +-- * System Words. +-- * Properties Qualifiers. +-- * Boolean Constants (true/false). +-- * Keywords 4 -- Limit Settings. -------------------------------------------------------------------------------- -Description = "Hugo" Categories = {"source", "interactive fiction"} IgnoreCase = true EnableIndentation = false --------------------------------------------------------------------------------- -Identifiers = [[ [\$]?[a-zA-Z_]\w*[#\$]? ]] +Identifiers = [[ [\$\~]?[a-zA-Z_]\w*\$? ]] Comments = {{ Block = true, Nested = false, @@ -57,7 +77,7 @@ ASCII Escapes: ASCII number (or Latin-1 code). --]] Escape = [=[ (\\(?:["\\_nBbIiPpUu]|#\d{3})) ]=], --[[---------------------------------------------------------------------------- - INTERPOLATIONP + INTERPOLATION -------------------------------------------------------------------------------- We define the special char sequences as Interpolation to allow visual separation between them and the other escape sequences, which will make the code easier to @@ -81,7 +101,7 @@ Special characters formatting sequences (ISO-8859-1): \Y Japanese Yen (Â¥) NOTE: The RegEx below defines twice the acute accent (´) char because depending - on wether the source is in ASCII/ISO-8859-1 or UTF-8 its encoding will + on whether the source is in ASCII/ISO-8859-1 or UTF-8 its encoding will differ (the former is the expected encoding for Hugo sourceS, but the latter might be encountered in documentation projects). --]] Interpolation = [=[ (?x)(\\(?: @@ -93,63 +113,150 @@ NOTE: The RegEx below defines twice the acute accent (´) char because depending [cLY] # Currencies: ¢ £ Â¥. )) ]=] } PreProcessor = { - Prefix = [[ # ]], + Prefix = [=[ \A(?!x)x ]=], -- never matching RegEx! Continuation = "\\" } -Operators = [[ \&|<|>|\||\=|\/|\*|\+|\-|~ ]] +Operators = [[ \&|\#|<|>|\||\=|\/|\*|\+|\-|~ ]] Digits = [[ \d+ ]] Keywords = {{ ------------------------------------------------------------------------------ Id = 1, List = { -- Hugo keywords # 1 ------------------------------------------------------------------------------ - "addcontext", "and", "anything", "array", "arraydata#", "attr#", "break", - "call", "capital", "case", "child", "children", "cls", "color", "colour", - "debugdata#", "dict", "dictentry#", "do", "elder", "eldest", "else", - "elseif", "eol#", "false", "for", "graphics", "held", "hex", "if", "in", - "input", "is", "jump", "label#", "local", "locate", "move", "multi", - "multiheld", "multinotheld", "music", "newline", "not", "notheld", "number", - "object", "objectnum#", "or", "parent", "parse$", "pause", "picture", - "playback", "print", "printchar", "prop#", "quit", "random", "readfile", - "readval", "recordoff", "recordon", "remove", "repeat", "restart", "restore", - "return", "routine#", "run", "runevents", "save", "scriptoff", "scripton", - "select", "serial$", "sibling", "sound", "string", "stringdata#", "system", - "text", "textdata#", "to", "true", "undo", "value#", "var#", "verb", "video", - "while", "window", "word", "writefile", "writeval", "xobject", "xverb", - "younger", "youngest" }},{ + "addcontext", "alias", "and", "anything", "array", "attribute", "break", + "call", "capital", "case", "child", "children", "class", "cls", "color", + "colour", "compound", "constant", "dict", "do", "elder", "eldest", "else", + "elseif", "enumerate", "event", "for", "global", "graphics", "held", "hex", + "if", "in", "input", "is", "jump", "local", "locate", "move", "multi", + "multiheld", "multinotheld", "music", "nearby", "newline", "not", "notheld", + "number", "or", "parent", "pause", "picture", "playback", "print", + "printchar", "property", "punctuation", "quit", "random", "readfile", + "readval", "recordoff", "recordon", "removal", "remove", "repeat", + "replace", "resource", "restart", "restore", "return", "routine", "run", + "runevents", "save", "scriptoff", "scripton", "select", "sibling", "sound", + "start", "step", "string", "synonym", "system", "text", "to", "undo", + "verb", "video", "while", "window", "word", "writefile", "writeval", + "xverb", "younger", "youngest", + }},{ + ------------------------------------------------------------------------------ + Id = 2, List = { -- Predefined Engine Stored Values # 2 ------------------------------------------------------------------------------ - Id = 2, -- ASCII Chars constants # 2 + --| Built-in Global Variables |--------------------------------------------- + ---------------------------------------------------------------------------- + "actor", "endflag", "location", "object", "objects", "player", "prompt", + "self", "system_status", "verbroutine", "words", "xobject", + ---------------------------------------------------------------------------- + --| Built-in Properties |--------------------------------------------------- + ---------------------------------------------------------------------------- + -- NOTE: "adjectives" and "nouns" are aliases defined by Hugo library, and + -- not tokens defined in the Hugo engine and compiler. + ---------------------------------------------------------------------------- + "adjective", "after", "article", "before", "name", "noun", + ---------------------------------------------------------------------------- + --| Built-in Engine Variables |--------------------------------------------- + ---------------------------------------------------------------------------- + "parse$", "serial$", + }},{ ------------------------------------------------------------------------------ - Regex = [=[ '[\x00-\x7F]' ]=] },{ + Id = 3, -- Chars Constants + System Words + Properties Qualifiers # 3 ------------------------------------------------------------------------------ - Id = 3, -- Limit Settings # 3 + --| ASCII Chars constants |------------------------------------------------- + ---------------------------------------------------------------------------- + Regex = [=[ '[\x00-\x7F]' ]=] , },{ + ---------------------------------------------------------------------------- + --| System Words |---------------------------------------------------------- + ---------------------------------------------------------------------------- + Id = 3, List = { + "~all", "~and", "~any", "~except", "~oops", + ---------------------------------------------------------------------------- + --| Properties Qualifiers |------------------------------------------------- + ---------------------------------------------------------------------------- + "$additive", "$complex", + ---------------------------------------------------------------------------- + --| Boolean Constants |----------------------------------------------------- + ---------------------------------------------------------------------------- + "true", "false", + }},{ + ------------------------------------------------------------------------------ + Id = 4, -- Limit Settings # 4 ------------------------------------------------------------------------------ Regex = [=[ (?x-i) - (\$MAX(?: - ATTRIBUTES|GLOBALS|LOCALS|ALIASES|ARRAYS|CONSTANTS|DICTEXTEND|DICT| - DIRECTORIES|EVENTS|FLAGS|LABELS|OBJECTS|PROPERTIES|ROUTINES|SPECIALWORDS - )) ]=], - Group = 0 + (\$MAX (?: ALIASES | ARRAYS | ATTRIBUTES | CONSTANTS | DICTEXTEND | DICT | + DIRECTORIES | EVENTS | FLAGS | GLOBALS | LABELS | LOCALS | OBJECTS | + PROPERTIES | ROUTINES | SPECIALWORDS )) ]=], + Group = 0 + },{ + ------------------------------------------------------------------------------ + Id = 5, -- PreProcessor + ------------------------------------------------------------------------------ + -- These tokens are captured as keywords but then thrown back as PreProcessor + -- via OnStateChange(). This is needed because setting '#' as PreProcessor + -- delimiter would prevent capturing the '#' token for counting properties. + + Regex = [=[ (?x-i) + (\#(?: + if(clear | set | defined | undefined) | if | elseif | else | endif | + clear | set | include | link | message | switches | version + )\b) ]=], + Group = 0 }} -function OnStateChange(oldState, newState, token, kwgroup) --[[ - ============================================================================== - #01 -- Ignore Escape Sequences Outside Strings - ============================================================================== - This function ensures that escape sequences outside strings are ignored: - tokens matching an escape sequence are rejected if the previously parsed token - was not a string, an interpolation or another escape sequence. - Based on André Simon's reply to Issue #23: - https://github.com/andre-simon/highlight/issues/23#issuecomment-332002639 - ----------------------------------------------------------------------------]] - if newState == HL_ESC_SEQ and - oldState ~= HL_STRING and - oldState ~= HL_ESC_SEQ and - oldState ~= HL_INTERPOLATION then +function OnStateChange(oldState, newState, token, kwgroup) + --============================================================================ + -- #01 -- Ignore Escape Sequences Outside Strings + --============================================================================ + if newState == HL_ESC_SEQ and -- An escape seq. must follow either: + oldState ~= HL_STRING and -- * a string + oldState ~= HL_ESC_SEQ and -- * an escape sequence + oldState ~= HL_INTERPOLATION then -- * an interpolation + return HL_REJECT -- otherwise, reject it. + --============================================================================ + -- #02 -- Ignore Interpolations Inside Preprocessor Strings + --============================================================================ + elseif + newState == HL_INTERPOLATION and + oldState == HL_PREPROC_STRING then return HL_REJECT + --============================================================================ + -- #03 -- Throw Back Keywords from Group 5 as PreProcessor + --============================================================================ + elseif + newState == HL_KEYWORD and + kwgroup == 5 then + return HL_PREPROC end return newState end --[[============================================================================ + KNOWN ISSUES +================================================================================ +FilePath Strings: + + Escape sequences and interpolations shouldn't show up inside file path strings + following keywords like `resource`, `picture` and other similar keywords which + expect a file string after them. The syntax should track strings immediately + following these keywords and discard escapes/interpolations accordingly. The + `resource` keyword is going to be trickier because it allows multiple strings + inside a `{..}` block (and strings might be followed by comments). +================================================================================ CHANGELOG ================================================================================ +v1.1.0 (2019/11/14) | Highlight v3.54 + - Polish source. + - List keywords one kwd per line to simplify WIP and tracking changes. + - NEW: + - Added missing keyword tokens. + - Removed keyword "adjectives" and "nouns" (library defined aliases). + - Kwd Group 2 now hosts predefined Engine Values: + - Built-in Global Variables. (moved here from Group 1) + - Built-in Properties. (moved here from Group 1) + - Kwd Groups 3 and 4 are shifted and become 4 and 5. + - Kwd Group 3: (was 2) added also, along with Char Constants: + - System Words. + - Properties Qualifiers. + - Boolean Constants (true/false: moved from Group 1). + - FIXES: + - Identifiers patterns tweaked to include tokens starting with tilde. + - Ignore interpolations inside preprocessor strings. + - PreProcessor: prevent matching the '#' for proprieties count as the + beginning of a preprocessor directive. v1.0.0 (2019/05/24) | Highlight v3.51 - First release. --]] diff --git a/hugo/syntax_test_chars.hug b/hugo/syntax_test_chars.hug index 0c35dee..a5083db 100644 --- a/hugo/syntax_test_chars.hug +++ b/hugo/syntax_test_chars.hug @@ -1,15 +1,15 @@ ! ============================================================================== -! ASCII CHARACTERS +! ASCII CHARACTERS ! ============================================================================== apple_array[0] = 'a' -! ^^^ kwb +! ^^^ kwc apple_array[1] = 'z' -! ^^^ kwb +! ^^^ kwc apple_array[2] = '0' -! ^^^ kwb +! ^^^ kwc apple_array[3] = '9' -! ^^^ kwb +! ^^^ kwc apple_array[4] = '*' -! ^^^ kwb +! ^^^ kwc apple_array[5] = 0 diff --git a/hugo/syntax_test_comments.hug b/hugo/syntax_test_comments.hug index 3a427ca..1220ba5 100644 --- a/hugo/syntax_test_comments.hug +++ b/hugo/syntax_test_comments.hug @@ -1,5 +1,5 @@ ! ============================================================================== -! SINGLE-LINE COMMENTS +! SINGLE-LINE COMMENTS ! ============================================================================== ! I'm a comment line. @@ -10,7 +10,7 @@ ! ^ ws ! ============================================================================== -! BLOCK COMMENTS +! BLOCK COMMENTS ! ============================================================================== diff --git a/hugo/syntax_test_compiler-directives.hug b/hugo/syntax_test_compiler-directives.hug index b4bf62b..6c2f416 100644 --- a/hugo/syntax_test_compiler-directives.hug +++ b/hugo/syntax_test_compiler-directives.hug @@ -1,5 +1,5 @@ ! ============================================================================== -! COMPILER DIRECTIVES +! COMPILER DIRECTIVES ! ============================================================================== #switches -ls !<^^^^^^^^^^^ ppc @@ -40,7 +40,7 @@ !<^^^^ ppc ! ============================================================================== -! PREPROCESSOR STRINGS +! PREPROCESSOR STRINGS ! ============================================================================== #include "verblib.h" diff --git a/hugo/syntax_test_digits-&-operators.hug b/hugo/syntax_test_digits-&-operators.hug index ad98177..5984d35 100644 --- a/hugo/syntax_test_digits-&-operators.hug +++ b/hugo/syntax_test_digits-&-operators.hug @@ -1,5 +1,5 @@ ! ============================================================================== -! DIGITS & OPERATORS +! DIGITS & OPERATORS ! ============================================================================== if ++number_of_items > 10 @@ -19,7 +19,7 @@ enumerate step *2 } ! ------------------------------------------------------------------------------ -! BITWISE OPERATORS +! BITWISE OPERATORS ! ------------------------------------------------------------------------------ 1 & 1 = 1 ! Bitwise and diff --git a/hugo/syntax_test_filepaths-include.hug b/hugo/syntax_test_filepaths-include.hug new file mode 100644 index 0000000..0b15c53 --- /dev/null +++ b/hugo/syntax_test_filepaths-include.hug @@ -0,0 +1,23 @@ +! ****************************************************************************** +! * * +! * Path Stings in Include Directives * +! * * +! ****************************************************************************** +! Test file path strings in #include and #link directives. +! +! Preprocessor strings shouldn't be treated like ordinary text strings, which +! can contain escape sequences and special characters. This potentially affects +! Windows paths, due to the backslash directory separator matching the escapes +! and interpolation delimiter. + +#include "D:\IF\Lib\cars.h" ! \I & \L & \c +! ^^ ^^ ^^ pps +#include ".\inc\new\Yoda.h" ! \i & \n & \Y +! ^^ ^^ ^^ pps + +! The same applies to the #link directive to include precompiled headers: + +#link "D:\IF\Lib\cars.hlb" ! \I & \L & \c +! ^^ ^^ ^^ pps +#link ".\inc\new\Yoda.hlb" ! \i & \n & \Y +! ^^ ^^ ^^ pps diff --git a/hugo/syntax_test_filepaths-resources.hug b/hugo/syntax_test_filepaths-resources.hug new file mode 100644 index 0000000..c5e8ea6 --- /dev/null +++ b/hugo/syntax_test_filepaths-resources.hug @@ -0,0 +1,25 @@ +! ****************************************************************************** +! * * +! * Path Stings in Hugo Resources * +! * * +! ****************************************************************************** +! Test file path strings in Hugo resources. +! +! File path strings shouldn't be treated like ordinary text strings, which can +! contain escape sequences and special characters. This potentially affects +! Windows paths, because of the backslash directory separator matching the +! escapes and interpolation delimiter. + +picture "c:\IF\pics\car.jpg" ! \I & \p & \c + +resource "GAMEPICS" +{ + ".\imgs\aeronaut.jpg" ! \ae -> ligature + ".\imgs\Baptiste.jpg" ! \b -> boldface on + ".\imgs\bicycles.jpg" ! \b -> boldface off + ".\imgs\isotopes.jpg" ! \i -> italics off + ".\imgs\nunchaku.jpg" ! \n -> newline + ".\imgs\protocol.jpg" ! \p -> proportional printing off + ".\imgs\unicorns.jpg" ! \u -> underlining off + ".\imgs\Yoghourt.jpg" ! \Y -> Japanese Yen +} diff --git a/hugo/syntax_test_interpolation-ascii.hug b/hugo/syntax_test_interpolation-ascii.hug index 24f6fd3..d4c4736 100644 --- a/hugo/syntax_test_interpolation-ascii.hug +++ b/hugo/syntax_test_interpolation-ascii.hug @@ -3,15 +3,18 @@ ================================================================================ This document is saved in ISO-8859-1 encoding. -Hugo files will usually be in ASCII/ISO-8859-1, but source files/snippets might -also be in UTF-8 format in documentation projects; so we must ensure that some -tricky characters are caught in both encodings -- e.g. the acute accent ´. +Hugo files are always encoded in ASCII/ISO-8859-1, but code snippets inside +documentation projects could also be in UTF-8 format (e.g. a code block inside +an AsciiDoc document); so we must ensure that some tricky characters are caught +in both encodings. + +This test contains the acute accent character ( ´ ), which is represented by a +single byte in ISO-8859-1 (0xB4) but as two-bytes in UTF-8 (0xC2 0xB4). ------------------------------------------------------------------------------\! !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -! NOTE: The escaped accents below will show up broken in the HTML doc due to the -! test script being set to use UTF-8 encoding. But we only aim at the -! test results here, which are working fine. +! NOTE: Unless you invoke Highlight with the --encoding=ISO-8859-1 option, the +! escaped accents below will show up broken in the HTML doc. !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "..\´a..\´u..\´e..\´E.." ! acute accents diff --git a/hugo/syntax_test_keywords.hug b/hugo/syntax_test_keywords.hug index 496ec56..9ef76a7 100644 --- a/hugo/syntax_test_keywords.hug +++ b/hugo/syntax_test_keywords.hug @@ -1,12 +1,11 @@ ! ============================================================================== -! HUGO KEYWORDS +! HUGO KEYWORDS ! ============================================================================== ! ------------------------------------------------------------------------------ -! KEYWORDS ENDING IN # +! KEYWORDS ENDING IN # ! ------------------------------------------------------------------------------ -print stringdata# "Hello, Sailor!" -!<^^^ ^^^^^^^^^^^ kwa -! ^ ^ ws -! ^^^^^^^^^^^^^^^ str +print "Hello, Sailor!" +!<^^^ kwa +! ^^^^^^^^^^^^^^^ str diff --git a/hugo/syntax_test_limit-settings.hug b/hugo/syntax_test_limit-settings.hug index 138a156..9370403 100644 --- a/hugo/syntax_test_limit-settings.hug +++ b/hugo/syntax_test_limit-settings.hug @@ -1,49 +1,49 @@ ! ============================================================================== -! Limit Settings +! Limit Settings ! ============================================================================== $MAXDICTEXTEND = 512 -!<^^^^^^^^^^^^ kwc +!<^^^^^^^^^^^^ kwd ! ^ ^ ws $MAXALIASES = 0 -!<^^^^^^^^^ kwc +!<^^^^^^^^^ kwd $MAXARRAYS = 0 -!<^^^^^^^^ kwc +!<^^^^^^^^ kwd $MAXCONSTANTS = 0 -!<^^^^^^^^^^^ kwc +!<^^^^^^^^^^^ kwd $MAXDICT = 0 -!<^^^^^^ kwc +!<^^^^^^ kwd $MAXDICTEXTEND = 0 -!<^^^^^^^^^^^^ kwc +!<^^^^^^^^^^^^ kwd $MAXDIRECTORIES = 0 -!<^^^^^^^^^^^^^ kwc +!<^^^^^^^^^^^^^ kwd $MAXEVENTS = 0 -!<^^^^^^^^ kwc +!<^^^^^^^^ kwd $MAXFLAGS = 0 -!<^^^^^^^ kwc +!<^^^^^^^ kwd $MAXLABELS = 0 -!<^^^^^^^^ kwc +!<^^^^^^^^ kwd $MAXOBJECTS = 0 -!<^^^^^^^^^ kwc +!<^^^^^^^^^ kwd $MAXPROPERTIES = 0 -!<^^^^^^^^^^^^ kwc +!<^^^^^^^^^^^^ kwd $MAXROUTINES = 0 -!<^^^^^^^^^^ kwc +!<^^^^^^^^^^ kwd $MAXSPECIALWORDS = 0 -!<^^^^^^^^^^^^^^ kwc +!<^^^^^^^^^^^^^^ kwd ! ========================================== ! Lowercase limit settings should NOT match: diff --git a/hugo/syntax_test_strings.hug b/hugo/syntax_test_strings.hug index 72c90d1..85883b9 100644 --- a/hugo/syntax_test_strings.hug +++ b/hugo/syntax_test_strings.hug @@ -109,61 +109,61 @@ so they can be visually distinguished from other escapes. -------------------------------------------------------------------------------- SPECIAL CHARS ESCAPES -------------------------------------------------------------------------------- -Special characters formatting sequences (ISO-8859-1): - - \` accent grave followed by a letter (e.g. "\`a" -> "à") - \’ accent acute followed by a letter (e.g. "\’E" -> "É") - \~ tilde followed by a letter (e.g. "\~n" -> "ñ") - \^ circumflex followed by a letter (e.g. "\^i" -> "î") - \: umlaut followed by a letter (e.g. "\:u" -> "ü") - \, cedilla followed by c or C (e.g. "\,c" -> "ç") - \< or \> Spanish quotation marks (« ») - \! upside-down exclamation point (¡) - \? upside-down question mark (¿) - \ae ae ligature (æ) - \AE AE ligature (Æ) - \c cents symbol (¢) - \L British pound (£) - \Y Japanese Yen (Â¥) - -------------------------------------------------------------------------------\! - -"..\`a..\`u..\`e..\`E.." ! grave accents -> à ù è È +Special characters formatting sequences (ISO-8859-1): \! + + "\`" ! accent grave followed by a letter -- e.g. \`a + "\´" ! accent acute followed by a letter -- e.g. \´e + "\~" ! tilde followed by a letter -- e.g. \~n + "\^" ! circumflex followed by a letter -- e.g. \^i + "\:" ! umlaut followed by a letter -- e.g. \:u + "\," ! cedilla followed by c or C -- e.g. \,c + "\< or \>" ! Spanish quotation marks + "\!" ! upside-down exclamation point + "\?" ! upside-down question mark + "\ae" ! ae ligature + "\AE" ! AE ligature + "\c" ! cents symbol + "\L" ! British pound + "\Y" ! Japanese Yen + +!------------------------------------------------------------------------------- + +"..\`a..\`u..\`e..\`E.." ! grave accents ! ^^^ ^^^ ^^^ ^^^ ipl -"..\´a..\´u..\´e..\´E.." ! acute accents -> á ú é É -! ^^ ^^ ^ ipl +"..\´a..\´u..\´e..\´E.." ! acute accents +! ^^^ ^^^ ^^^ ^^^ ipl ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! NOTE: It's difficult to test the above due to ´ being represented as $c2 $b4 ! in UTf-8, and breaking up the actual columns count. ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -"El Ni\~no" ! tilde -> "El Niño" +"El Ni\~no" ! tilde ! ^^ ipl -"..\^a..\^A..\^u..\^i.." ! circumflex -> â  û î +"..\^a..\^A..\^u..\^i.." ! circumflex ! ^^^ ^^^ ^^^ ^^^ ipl -"..\:a..\:u..\:U.." ! umlat -> ä ü Ãœ +"..\:a..\:u..\:U.." ! umlat ! ^^^ ^^^ ^^^ ipl -"..\,c..\,C.." ! cedilla -> ç Ç +"..\,c..\,C.." ! cedilla ! ^^^ ^^^ ipl -"..\<..\>.." ! angle brackets -> « » +"..\<..\>.." ! angle brackets ! ^^ ^^ ipl -"..\!..\?.." ! upside-down marks -> ¡ ¿ +"..\!..\?.." ! upside-down marks ! ^^ ^^ ipl -"..\ae..\AE.." ! ligatures -> æ Æ +"..\ae..\AE.." ! ligatures ! ^^^ ^^^ ipl -"..\c..\L..\Y.." ! currency -> ¢ £ Â¥ +"..\c..\L..\Y.." ! currency ! ^^ ^^ ^^ ipl ! ============================================================================== -! MIXED TESTS +! MIXED TESTS ! ============================================================================== diff --git a/hugo/syntax_test_token-list.hug b/hugo/syntax_test_token-list.hug new file mode 100644 index 0000000..55586ac --- /dev/null +++ b/hugo/syntax_test_token-list.hug @@ -0,0 +1,445 @@ +! ****************************************************************************** +! * * +! * All Hugo Tokens * +! * * +! ****************************************************************************** +! This test files contains all the Hugo tokens in one file, to quickly check +! that they are all captured as expected. + +! ============================================================================== +! [opt] Operators +! ============================================================================== + +! Comparison operators +< <= == ~= >= > +!<^^ ^^ ^^ ^^ ^ opt + +! Mathematical operators: +* / - + +!<^ ^ ^ opt + +! Bitwise operators: +& | ~ +!< ^ ^ opt + +! ------------------------------------------------------------------------------ +! Special Tokens +! ------------------------------------------------------------------------------ +! Hash (#) for properties count, and ampersand (&) for addresses: +# & +!< ^ opt + +if obj.#adjectives +! ^ opt +! ^^^^^^^^^^ std + +x = &object.property +! ^ opt +! ^^^^^^ kwb +! ^^^^^^^^ kwa + +! ============================================================================== +! [std] Punctuation +! ============================================================================== + +{ } [ ] ( ) ; . +!<^ ^ ^ ^ ^ ^ ^ std + +! ============================================================================== +! [kwa] Hugo keywords +! ============================================================================== +! The full list of Hugo keywords, currently all captured as Keywords Group 1. + +addcontext +!<^^^^^^^^ kwa +alias +!<^^^ kwa +and +!<^ kwa +anything +!<^^^^^^ kwa +array +!<^^^ kwa +attribute +!<^^^^^^^ kwa +break +!<^^^ kwa +call +!<^^ kwa +capital +!<^^^^^ kwa +case +!<^^ kwa +child +!<^^^ kwa +children +!<^^^^^^ kwa +class +!<^^^ kwa +cls +!<^ kwa +color +!<^^^ kwa +colour +!<^^^^ kwa +compound +!<^^^^^^ kwa +constant +!<^^^^^^ kwa +dict +!<^^ kwa +do +!< kwa +elder +!<^^^ kwa +eldest +!<^^^^ kwa +else +!<^^ kwa +elseif +!<^^^^ kwa +enumerate +!<^^^^^^^ kwa +event +!<^^^ kwa +for +!<^ kwa +global +!<^^^^ kwa +graphics +!<^^^^^^ kwa +held +!<^^ kwa +hex +!<^ kwa +if +!< kwa +in +!< kwa +input +!<^^^ kwa +is +!< kwa +jump +!<^^ kwa +local +!<^^^ kwa +locate +!<^^^^ kwa +move +!<^^ kwa +multi +!<^^^ kwa +multiheld +!<^^^^^^^ kwa +multinotheld +!<^^^^^^^^^^ kwa +music +!<^^^ kwa +nearby +!<^^^^ kwa +newline +!<^^^^^ kwa +not +!<^ kwa +notheld +!<^^^^^ kwa +number +!<^^^^ kwa +or +!<^ kwa +parent +!<^^^^ kwa +pause +!<^^^ kwa +picture +!<^^^^^ kwa +playback +!<^^^^^^ kwa +print +!<^^^ kwa +printchar +!<^^^^^^^ kwa +property +!<^^^^^^ kwa +punctuation +!<^^^^^^^^^ kwa +quit +!<^^ kwa +random +!<^^^^ kwa +readfile +!<^^^^^^ kwa +readval +!<^^^^^ kwa +recordoff +!<^^^^^^^ kwa +recordon +!<^^^^^^ kwa +removal +!<^^^^^ kwa +remove +!<^^^^ kwa +repeat +!<^^^^ kwa +replace +!<^^^^^ kwa +resource +!<^^^^^^ kwa +restart +!<^^^^^ kwa +restore +!<^^^^^ kwa +return +!<^^^^ kwa +routine +!<^^^^^ kwa +run +!<^ kwa +runevents +!<^^^^^^^ kwa +save +!<^^ kwa +scriptoff +!<^^^^^^^ kwa +scripton +!<^^^^^^ kwa +select +!<^^^^ kwa +sibling +!<^^^^^ kwa +sound +!<^^^ kwa +start +!<^^^ kwa +step +!<^^ kwa +string +!<^^^^ kwa +synonym +!<^^^^^ kwa +system +!<^^^^ kwa +text +!<^^ kwa +to +!<^ kwa +undo +!<^^ kwa +verb +!<^^ kwa +video +!<^^^ kwa +while +!<^^^ kwa +window +!<^^^^ kwa +word +!<^^ kwa +writefile +!<^^^^^^^ kwa +writeval +!<^^^^^^ kwa +xverb +!<^^^ kwa +younger +!<^^^^^ kwa +youngest +!<^^^^^^ kwa +! ============================================================================== +! [kwb] Predefined Engine Stored Values +! ============================================================================== +! Keywords Group 2 gathers various predefined global engines values, variables +! and constants. + +! ------------------------------------------------------------------------------ +! Builtin Global Variables +! ------------------------------------------------------------------------------ +actor +!<^^^ kwb +endflag +!<^^^^^ kwb +location +!<^^^^^^ kwb +object +!<^^^^ kwb +objects +!<^^^^^ kwb +player +!<^^^^ kwb +prompt +!<^^^^ kwb +self +!<^^ kwb +system_status +!<^^^^^^^^^^^ kwb +verbroutine +!<^^^^^^^^^ kwb +words +!<^^^ kwb +xobject +!<^^^^^ kwb +! ------------------------------------------------------------------------------ +! Builtin Properties +! ------------------------------------------------------------------------------ +! NOTE: "adjectives" and "nouns" are aliases defined by hugo library, and not +! tokens defined in the Hugo engine and compiler. + +adjective +!<^^^^^^^ kwb +after +!<^^^ kwb +article +!<^^^^^ kwb +before +!<^^^^ kwb +name +!<^^ kwb +noun +!<^^ kwb +! ------------------------------------------------------------------------------ +! Built-in Engine Variables +! ------------------------------------------------------------------------------ +parse$ +!<^^^ kwb +serial$ +!<^^^^ kwb +! ============================================================================== +! [kwc] Special System Words +! ============================================================================== +! Keywords Group 3, includes Char constants and other special system- defined +! tokens that didn't fit elsewhere. +! ------------------------------------------------------------------------------ +! ASCII Characters Constants +! ------------------------------------------------------------------------------ +printchar 'A', 'B' +! ^^^ ^^^ kwc +! ------------------------------------------------------------------------------ +! Hardcoded Boolean Constants +! ------------------------------------------------------------------------------ +true +!<^^ kwc +false +!<^^^ kwc +! ------------------------------------------------------------------------------ +! System Words +! ------------------------------------------------------------------------------ +~all +!<^^ kwc +~and +!<^^ kwc +~any +!<^^ kwc +~except +!<^^^^^ kwc +~oops +!<^^^ kwc +! ------------------------------------------------------------------------------ +! Properties Qualifiers +! ------------------------------------------------------------------------------ +$additive +!<^^^^^^^ kwc +$complex +!<^^^^^^ kwc +! ============================================================================== +! [kwd] Limit Settings +! ============================================================================== +! Limit settings are currently captured as Keywords Group 4. +! See The Hugo Book: Appendix C: Limit Settings. + +! Static and non-modifiable limits: +$MAXATTRIBUTES +!<^^^^^^^^^^^^ kwd +$MAXGLOBALS +!<^^^^^^^^^ kwd +$MAXLOCALS +!<^^^^^^^^ kwd + +! Modifiable limits settings: +$MAXALIASES +!<^^^^^^^^^ kwd +$MAXARRAYS +!<^^^^^^^^ kwd +$MAXCONSTANTS +!<^^^^^^^^^^^ kwd +$MAXDICTEXTEND +!<^^^^^^^^^^^^ kwd +$MAXDICT +!<^^^^^^ kwd +$MAXDIRECTORIES +!<^^^^^^^^^^^^^ kwd +$MAXEVENTS +!<^^^^^^^^ kwd +$MAXFLAGS +!<^^^^^^^ kwd +$MAXLABELS +!<^^^^^^^^ kwd +$MAXOBJECTS +!<^^^^^^^^^ kwd +$MAXPROPERTIES +!<^^^^^^^^^^^^ kwd +$MAXROUTINES +!<^^^^^^^^^^ kwd +$MAXSPECIALWORDS +!<^^^^^^^^^^^^^^ kwd + +! ============================================================================== +! Compiler Directives +! ============================================================================== +#if +!<^ ppc +#ifclear SOME_FLAG +!<^^^^^^ ^^^^^^^^^ ppc +#if clear SOME_FLAG +!<^^^^^^^ ^^^^^^^^^ ppc + +#ifdefined SOME_FLAG +!<^^^^^^^^ ^^^^^^^^^ ppc +#if defined SOME_FLAG +!<^^^^^^^^^ ^^^^^^^^^ ppc + +#ifset SOME_FLAG +!<^^^^ ^^^^^^^^^ ppc +#if set SOME_FLAG +!<^^^^^ ^^^^^^^^^ ppc + +#ifundefined SOME_FLAG +!<^^^^^^^^^^ ^^^^^^^^^ ppc +#if undefined SOME_FLAG +!<^^^^^^^^^^^ ^^^^^^^^^ ppc + +#else +!<^^^ ppc +#elseif +!<^^^^^ ppc +#endif +!<^^^^ ppc + +#clear SOME_FLAG +!<^^^^ ^^^^^^^^^ ppc +#set SOME_FLAG +!<^^ ^^^^^^^^^ ppc + +#include "filename" +!<^^^^^^ ppc +! ^^^^^^^^^ pps +#link"filename" +!<^^^ ppc +! ^^^^^^^^^ pps + +#message "Hello world!" +!<^^^^^^ ppc +! ^^^^^^^^^^^^^ pps + +#message warning "Be careful!" +!<^^^^^^ ^^^^^^^ ppc +! ^^^^^^^^^^^^^ pps + +#message error "Thigs went down the drain!" +!<^^^^^^ ^^^^^ ppc +! ^^^^^^^^^^^^^^^^^^^^^^^^^^^ pps + +#switches -ls +!<^^^^^^^ ^^^ ppc +#version 2.5 +!<^^^^^^ ^^^ ppc diff --git a/hugo/test.sh b/hugo/test.sh index 16bec6b..f175d98 100644 --- a/hugo/test.sh +++ b/hugo/test.sh @@ -2,7 +2,7 @@ rm ./errors.log >/dev/null 2>&1 highlight\ --isolate\ - --encoding=UTF-8\ + --encoding=ISO-8859-1\ --config-file=hugo.lang\ --batch-recursive=*.hug\ --validate-input\