Skip to content
This repository was archived by the owner on Feb 22, 2025. It is now read-only.

Releases: ErwanBarbedor/Plume_-_TextEngine

0.13.0

Choose a tag to compare

@ErwanBarbedor ErwanBarbedor released this 29 Dec 13:54

Changes

  • Rename plume.export to plume.register_macro.
  • Parameters of plume.register_macro are no longer rendered before the macro call.
  • Plume will now work seamlessly with Lua local variables. Remove plume.capture_local.
  • plume.get accept a second argument annotation
  • plume variable is now local

Bugfixes

  • Fix a bug occurring when globally setting a variable defined locally, but with a nil value.

0.12.0

Choose a tag to compare

@ErwanBarbedor ErwanBarbedor released this 14 Dec 12:00

Changes

  • New syntax: conversion annotation. In the macro definition, users can give the name of a function to call on a parameter to convert it: \macro double [x:number] ${2*x}
  • Default annotation to all parameters is auto, even if old default behavior is ref.
  • New config.default_annotation.
  • New plume.set, plume.local_set and plume.lset.
  • Rename plume.lua_get to plume.get_lua
  • Remove plume.lget
  • All warnings are now disables by default.
  • New api.warnings_all()
  • token:sourceLua(), tokenlist:sourceLua() -> token:source_lua(), tokenlist:source_lua()
  • Sugar syntax : \foo[?bar] is a shortcut for \foo[{\if $bar bar}]

Enhancements

  • Betters error message for internals errors.

Interns changes

  • Code cleaning

Deprecation

  • tokenlist:is_empty () is deprecated
  • All tokenlist implicit conversions will be removed in the future.

CLI changes

  • New -w, --warnings option

Bugfixs

  • Fix a bug causing non-provided flags to be nil instead of false.
  • Preventing a file from including itself with the macro \include, or creating an infinite loop.

0.11.3

Choose a tag to compare

@ErwanBarbedor ErwanBarbedor released this 08 Dec 11:38

Bugfix

  • Fix a case when ${10.0} output .
  • Fix an error in documentation generation.
  • Fix an error causing Lua comment to remove the end line, causing syntax errors.
  • Fix a bug causing the ignoring of a local variable with a nil value and getting instead the parent value.
  • Fix a bug occurring when trying to require a directory.
  • Fix a bug causing external file Lua error to be treated as Plume internal errors.

Enhancements

  • A rendered flag that is empty doesn't raise an error anymore.
  • If a rendered flag is provided, trim spaces before checking if this flag exists.
  • Add a warning when globally editing eval default parameters.

0.11.2

Choose a tag to compare

@ErwanBarbedor ErwanBarbedor released this 30 Nov 11:11

Enhancement

  • Macro name suggestion in case of error like using "foo_bar" instead of "bar_foo", or "fooBar" instead of "barFoo".
  • New error message when trying to include a directory.
  • In error messages, cut lines if they are too long.
  • Better error messages in case of Lua syntax error raised by Plume parser.

Bugfix

  • When giving a path directory to include, first try to open path/init.plume before trying to open path.
  • Fix a bug preventing access to a local variable if its value is false.

0.11.1

Choose a tag to compare

@ErwanBarbedor ErwanBarbedor released this 23 Nov 10:01

Changes

  • Plume will no longer print output by default.
  • Rewrite the Linux launcher. You can choose the Lua executable by setting the LUA_EXEC environnement variable.

Bugfix

  • Fix a bug specific to Linux.
  • Fix an error occurring when trying to open a file in the same folder.
  • Fix an error occurring when giving an unknown flag to the eval macro.

0.11.0

Choose a tag to compare

@ErwanBarbedor ErwanBarbedor released this 02 Nov 17:06

Changes

  • As planned, \for, \if, \while and \elseif first parameters must now be lua blocks.
  • Remove _L, too complex to implement without being useful.
  • No need anymore to escape $ or braces inside lua string. Escaped $ or braces will now raise an error.
  • Can now use return inside a lua block.
  • In consequence, remove plume.write.
  • Can now use arbitrary complexe lua iterator in the \for macro.
  • Token implicit conversion now only works if used with string methods or operators.

Enhancement

  • Plume should now detects if a Lua block is a statement or an expression without error.
  • More pertinent suggestions in case of unknown macro or parameter.
  • More coherent error messages.
  • Resetting Plume is much faster.
  • More accurate spaces filtering.

Internal changes

  • Rewrite unitary testing: cleaner code and much clearer output.
  • Rewrite tokenizer. Cleaner and now context-sensitive
  • Move somme parts of render to parser.
  • Write a limited lua parser.
  • Move errors message to dedicateds files.
  • A lot of other code rewriting, cleaning, and comments added.

0.10.0

Choose a tag to compare

@ErwanBarbedor ErwanBarbedor released this 27 Oct 21:19
  • As planned, remove compatibilty for old syntax # and \\
  • As planned, remove compatibilty for old configuration config.ignore_spaces

0.9.0

Choose a tag to compare

@ErwanBarbedor ErwanBarbedor released this 19 Oct 13:20

Changes

  • Plume is no longer a standalone Lua file.
  • As planned, remove \def, \defl, \def_local, \setl, \set_local, \default_local, \alias_local, \aliasl, \redef and \redef_forced.

CLI

Changes

  • New option -c --config to edit configuration before executing the file or the given code.

Enhancements

  • Rewrite doc
  • New tests specifics to CLI

Fixes

  • No longer see the first error message for each error.
  • Fixe an error preventing to see plume output.
  • Error is now writted on stderr, not stdin.

0.8.0

Choose a tag to compare

@ErwanBarbedor ErwanBarbedor released this 11 Oct 21:06
ac2f7f9

Changes

  • Can now use ${...} in parameter names and parameter values.
  • Configuration can now be local.
  • ${...}[i] will now round, not floor.
  • New option for CLI: interactive mode
  • New function plume.is_called_by.
  • New function plume.write.
  • New plume.engine
  • Add a warning if using # or // instead of $ and \--. Will be triggered in Lua code, ignore it in this case.
  • Remove plume._LUA_VERSION. (the Lua version is already in plume._VERSION)
  • Remove implicit render on token.__eq
  • Remove access to the Lua table arg from plume.

Enhancement

  • When an error occurs in a Lua-defined macro, the line will no longer be printed twice in the error message.
  • Can now use comments inside optional parameter declaration.
  • Better error message for syntax error in lua code.

Fixes

  • Fix a bug causing local_macro and lmacro to be global.
  • Fix a bug causing an eval block to be evaluated 3 times instead of once.

Deprecation

  • \def, \defl, \def_local, \setl, \set_local, \default_local, \alias_local, \aliasl, \redef and \redef_forced will be removed in v0.9
  • Old syntax # and // compatibility will be removed in v0.10.
  • Non-lua block as parameter of \if, \elseif, \for and \while will no longer be accepted in v0.11.

0.7.0

Choose a tag to compare

@ErwanBarbedor ErwanBarbedor released this 05 Oct 20:07

Changes

  • Default space mode is now light.
  • Rework a lot of naming:
    • \def became \macro.
    • The convention for local variant of \command is \local_command, with an alias \lcommand.
    • All old names (\def, \defl, \def_local, \setl, \set_local, \default_local, \alias_local, and \aliasl) are deprecated, but work for now.
  • Deprecate \redef and \redef_forced. Writing over existing macros will now just print a warning.
  • The first parameter of \if, \elseif, \for, and \while must now be an eval block.
  • You can now declare a Plume block inside a Lua block. (only works inside plume files for now, not in external Lua files)
  • Change eval escape to $ from #. Code using # still works for now.
  • Change comment syntax to \-- from //. Code using // still works for now.
  • New option join for \for, which will insert a character between all iterations.
  • ${x} will now render all x elements if x is a table.
  • New flag no_table_join and new option join for macro $.

Explanations for the syntaxs changes:

Originally, # was chosen to adhere to the LaTeX macro syntax, \newcommand \double[1] {#1 #1}. However, it doesn't necessarily align with the broader use that Plume makes of it. Moreover, # is used by Lua, which makes some expressions unclear (e.g., #{#t} to print the size of a table) and prevents it from being used to declare plume blocks inside lua blocks. Finally, $ is much more associated with the evaluate function than #.

As for comments, the idea was to reduce the number of special characters to two in order to avoid the need for escaping as much as possible. (For example, // is used in URLs). So, start with \. It couldn't be \\ (because it prints the character \) and \$ was pretty weird, so \-- was chosen in alignment with the -- used by Lua.

Enhancement

  • Plume comment will now work in Lua blocks.
  • Remove useless lines from traceback.
  • Warnings will be printed only one time per faulty code chunk.

Fixes

  • Fix wrong space mode name.
  • Plume no longer see a==4 as a statement.
  • Fix an error causing Plume to crash if a for loop go over the iteration limit.