Releases: open2b/scriggo
Releases · open2b/scriggo
v0.51.1
Improve error message importing native declaration - #871
Importing a native declaration as []int{}
, Scriggo returns the error
importing package main, declaration "toc" is not valid
It is not clear why it is not valid. This change reports instead:
cannot import toc: to import a variable use a pointer to that variable
Update README file
Improve the example on templates, add a padded version of the logo and the badge for 'Go Report Card'
Add SECURITY.md file
Do internal code improvements
v0.51.0
Most relevant commits:
- all: rename 'endless macro' to 'distraction free macro declaration'
- cmd/scriggo: support GitHub Flavored Markdown in 'serve' command
- cmd/scriggo: add 'version' constant built-in
- native: rename 'Env.FilePath' method to 'CallPath'
- cmd/scriggo: add 'filepath' constant built-in
- cmd/scriggo: abort 'init' command if main.go or packages.go files exist
- cmd/scriggo: add an initial implementation of 'scriggo bug'
- cmd/scriggo: abort 'init' command if "Scriggofile" exists
v0.50.0
Most relevant commits:
- builtin: add 'pow' builtin
- cmd/scriggo: update help
- cmd/scriggo: fix documentation printed by 'scriggo help import'
- all: add the README
- ast, compiler: refer to 'extends' and 'import' as declarations
- compiler: make {% import "path" %} an alias for {% import . "path" %}
- all: stop execution on context cancellation
- playground: prefix the error message with "panic: " on panic
- runtime: change 'Zero' instruction to implement the new specification
- compiler/checker: fix panic in case of redeclaration of imported name
- all: update the copyright statements
- cmd: add 'pow' built-in to the 'serve' command
- runtime: fail with a fatal error on go of nil func value
- compiler/checker: don't export names imported in file/package block
- compiler/parser: fix parse composite literal with no type as expression
- compiler/lexer: fix lexing closed braces in show statement
- compiler: support recursive extends
v0.49.0
Most relevant commits:
- cmd/scriggo: support '//go:build' in generated package files
- cmd/scriggo: make generated packages file as fmt want
- native: improve 'CombinedPackage.LookupFunc' method documentation
- scriggo: remove outdated comment on 'BuildOptions.Packages'
- compiler/checker: rearrange code for checking method expressions
- compiler/checker: revise type checking of method values
- compiler/checker: fix error using a package identifier without selector
- compiler/checker: fix access to unexported method values of interfaces
- compiler/checker: fix access to unexported method expr. of interfaces
- compiler/emitter: fix 'delete' when map type is a Scriggo type
- runtime,scriggo: don't panic if an out error occurs running a template
- scriggo,scripts: improve documentation of 'Run' method on panic
- scriggo,scripts: remove 'MustRun' methods
- script: document '*ExitError' error is returned calling 'exit' built-in
- compiler: implement 'import for' declaration
- compiler/emitter: fix invalid behavior with short variable declarations
- runtime: fix show of a 'markdown' value to HTML context
- compiler/emitter: fix emission of optimized show macro calls
- scriggo/cmd: make 'version' subcommand prints Scriggo and Go versions
- compiler: re-implement extends adding an import and swapping files
- scriggo/cmd: add 'init' and remove 'build' and 'install' subcommands
- cmd/scriggo: rename 'scriggo embed' subcommand to 'scriggo import'
- native: rename 'Package', 'PackageImporter', 'DeclarationsPackage' types
v0.48.0
Most relevant commits:
- native: use 'Declaration' type for a declaration
- compiler/checker: make clearer an error message loading a package
- native: revert 'make 'MapPackage' methods with pointer receivers'
- native: rename 'Package.Name' method to 'PackageName'
- native: fix 'CombinedPackage.PackageName' method documentation
- compiler/checker: fix import of native packages with not allowed names
- native: replace 'Package.DeclarationNames' method with 'LookupFunc'
v0.47.0
Most relevant commits:
all
- all: require 1.16 as minimum Go version
- all: make 'compiler' package internal
- all: make 'runtime' package internal
- all: rename the 'types' package to 'native' and move some type into it
ast
- scriggo/ast: fix and improve documentation
cmd/scriggo
- cmd/scriggo: don't prefix error message with 'scriggo: '
- cmd/scriggo: rename the 'run.Scriggofile' file to 'Scriggofile'
- cmd/scriggo: use 'native' instead of 'predefined' in help
- cmd/scriggo: better document struct type limitations
compiler
- compiler/checker: consistently use the same error for redeclared names
- compiler/checker: fix unreported errors in type switch
- compiler: allow special case of call for 'print' and 'println'
- compiler/checker: add support for blank return parameters
- compiler/checker: fix imported and not used error enabling package cache
- compiler/emitter: fix position for dummy functions
- compiler/checker: fix a panic checking an invalid function call
- compiler/checker: fix a panic checking explicit conversion to interface
- compiler/checker: fix constant conversion from string to slice
- compiler/types: revise 'AssignableTo', 'ConvertibleTo' and 'Implements'
- compiler/checker: fix variadic call to 'append'
- compiler/lexer: fix parsing general comments
- compiler/lexer: disallow BOM if it is not the first Unicode code point
- compiler/checker: fix break sets too many statements to terminating
- compiler/checker: fix 'break' and 'continue' not in breakable statement
- compiler/parser: allow to omit a semicolon before a closing %%}
- compiler/parser: fix parsing empty label statements
- compiler/parser: support modules parsing programs
- compiler/checker: fix label, goto, break and continue statements
- compiler/checker: differentiate error messages in type declaration loops
- compiler/disassembler: fix panic disassembling 'Select' operation
- compiler/types: fix creation of defined types
- compiler/checker: add missing builtins to 'go' and 'defer' statements
- compiler/parser: fix error message if identifier name starts with digit
- compiler/parser: return better error message on interfaces with methods
- compiler/parser: fix automatically inserted semicolon
- compiler/parser: fix error message on unexpected token after 'else'
- compiler/emitter: call 'types.PtrTo' instead of 'reflect.PtrTo'
- compiler/checker: fix very slow printing of float constants
- compiler/checker: fix 'duplicate field _' error
- compiler/checker: fix checking of struct fields
- compiler/checker: don't panic is not first embedded type has methods
- compiler/types: implement 'structType.FieldByIndex' method
- compiler/checker: fix implicit assignment of unexported fields
- compiler/checker: rewrite checking of composite struct literal
- compiler/emitter: fix slicing
- compiler/emitter: fix invalid behavior in assignment
- compiler/checker: fix ambiguous selector error
- compiler/checker: fix corner cases in field selector
native
- native: make 'MapPackage' methods with pointer receivers
- native: make 'PackageLoader.Load' method returns only native packages
- native: rename the 'MapPackage' type to 'DeclarationsPackage'
- native, runtime: remove 'Exited' and 'ExitFunc' methods of 'Env'
- native: document that 'Exit' and 'Fatal' do not terminate goroutines
playground
- playground: remove 'wasm_exec.js' file and document how to copy the file
- playground: use '-v -o' to generate 'packages.go' in README
- playground: remove 'packages.go' from the repository
runtime
- runtime: fix error returned deleting a map key with an unhashable type
scriggo
- scriggo: change 'Build' function to get a file system
- scriggo, templates: merge 'templates' package into the 'scriggo' package
- scriggo: remove the 'PrintFunc' function
- scriggo: rename 'RunOptions.PrintFuc' to 'Print'
- scriggo, scripts: rename 'Panic' types to 'PanicError'
- scriggo, scripts: make 'Run' methods return an ExitError instead of code
- scriggo: merge 'BuildTemplateOptions' into 'BuildOptions'
- scriggo, scripts: make 'go' statement disabled by default
scripts
- scripts: document that scripts are experimental
- scripts: replace 'reflect.PrintFunc' type with 'scriggo.PrintFunc' type
- scripts: rename 'RunOptions.PrintFunc' to 'Print'
- scripts: improve documentation
v0.46.0
Most relevant commits:
all
- all: prefer 'behavior' to 'behaviour'
cmd/scriggo
- cmd/scriggo: don't strip HTML in markdown code serving template files
- cmd/scriggo: enable auto heading ids serving markdown
- cmd/scriggo: update documentation of 'serve' and run 'go generate'
- cmd/scriggo: mention that types are not garbage collected in limitations
- cmd/scriggo: don't mention that Delve is not supported
- cmd/scriggo: run script with '.ggo' extension
- cmd/scriggo: allow serving template URL without extensions
compiler
- compiler: add the 'default' primary expression
- compiler: remove special render assignment and declaration syntax
- compiler/checker: makes further error messages the same as gc
- compiler/checker: distinguish arrays and slices in duplicate index error
- compiler/parser: make 'used as value' error message the same of gc
- compiler/lexer: make error messages parsing runes the same of gc
- compiler/ast,compiler/checker: make struct literal errors the same as gc
- compiler/checker: fix type check of variadic function calls
- compiler/checker: make error message involving variadic calls the same as gc
- compiler/checker: return same as gc error using non-bool with && and ||
- compiler/checker: make 'cannot assign to' error messages the same as gc
- compiler/checker: fix panic checking const declaration without values
- compiler/checker: fix panic on global const declaration without values
- compiler/parser: don't suggest '{% render ... %}' in error message
- compiler/parser: don't allow forbidding shebang in scripts
- compiler/checker: fix unchecked duplicated parameter in function type
- compiler/checker: use '%#v' printing constant in error messages
- compiler/checker: fix dot import incorrectly checked as used
- compiler/checker: fix 'imported and not used' error position
- compiler/checker: fix panic checking unary operators as expr statements
- compiler/checker: simplify check of special case in call and fix errors
- compiler/checker: fix upvars for predefined values in templates
- compiler: add the 'using' statement
- compiler: deprecate the dollar identifier
- compiler/emitter: fix f(g()) with f variadic
runtime
- runtime: rewrite 'appendCap' function and use old cap instead of len
- runtime: reimplement *Panic.Error to return all currently active panics
- runtime: print panic messages as gc does
- runtime: fix panic calling macros as predefined functions
scriggo
- scriggo: remove 'IsLimitExceeded' function
- scriggo, templates: remove 'templates.CompilerError' type
v0.45.0
Most relevant commits:
- compiler/parser: fix error message parsing '{% end foo bar %}'
- compiler/parser: improve missing end statement error
- compiler: add the 'raw' statement
- cmd/scriggo,test/compare: support parsing of Go devel versions
- runtime: handle conversions from []T to *[N]T
- compiler/parser: fix panic parsing '{{ }}' in a declaration context
- compiler/parser: improve non-allowed macro declaration error
- compiler/parser: don't parse short show statement with an option
- compiler/checker: don't allow slicing of format types
- compiler/checker: fix impossible type assertion at compile-time
- templates/builtin: add 'Time.IsZero' method
- compiler/checker: fix error 'extra expression in const declaration'
- compiler/checker: fix position of errors in const declaration
- compiler/checker: fix error message on assignment mismatch
v0.44.0
Most relevant commits:
- cmd/scriggo: remove outdated limitation in the help
- runtime: declare 'Format' and 'Context' types for renderer
- runtime: don't pass a 'Context' to 'Renderer.Text' but two booleans
- compiler/emitter: add support for indirect input parameters
- templates: fix stack overflow checking templates
- all: use the expression 'template file' instead of 'template page'
- compiler/emitter: fix an invalid behavior with 'return f()'
- compiler/disassembler: fix panic disassembling 'IfFloat' operation
- compiler/parser: fix error message when '%}' is expected
- compiler/emitter: support non local upvars in function literals
- cmd/scriggo: fix typo and formatting in the help
- compiler/emitter: move check on max select cases from runtime to emitter
- compiler/parser: fix parsing function parameters with non-final ellipses
- templates/builtin: handle semicolon error in queries
v0.43.0
Most relevant commits:
- compiler/parser: simplify and fix function parameters parsing
- compiler/checker: fix importing a precompiled pkg from imported file
- compiler/parser: make struct parsing conform to spec and Go compiler
- compiler/checker: fix 'imported and not used' error on precompiled pkgs
- compiler/ast/astutil: allow CloneNode to clone a StructType node
- compiler/lexer: fix column numbers lexing raw strings
- compiler/parser: fix parsing of non-terminated expressions
- compiler: support tags in struct type declarations
- compiler/checker: support struct declarations with implicit fields
- scriggo, compiler: pass package loader as option
- scripts: pass package loader as option
- compiler/parser: fix position of the identifier of 'import' declaration
- compiler/lexer: trim "data-" prefix checking if attribute contains URL
- compiler/lexer: trim namespace checking if attribute contains URL
- compiler/lexer: treat "xmlns" attributes as contain URL
- compiler/lexer: treat 'src', 'url', 'uri' in attributes as contain URL
- compiler/lexer: make tag name scanning more permissive
- compiler/emitter: allow indirect registers in lhs of for range statement