Skip to content

Compiling MessageContext #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
a540993
Initial implementation of MessageContext
spookylukey May 11, 2018
3059ec2
Beginnings of implementing resolve
spookylukey May 12, 2018
ea68596
Beginnings of resolving external arguments
spookylukey May 12, 2018
97da936
Fixed term/message mixup
spookylukey May 12, 2018
5fd424b
format: Implemented attribute lookup
spookylukey May 13, 2018
f76c965
format: another test
spookylukey May 13, 2018
b280a9d
MessageContext: removed/changed methods that exposed implementation d…
spookylukey May 14, 2018
b5d0a2f
Avoid name clash with Python builtin ReferenceError
spookylukey May 14, 2018
b78f33f
format: Tests for missing attributes
spookylukey May 14, 2018
c77ff6f
format: support for accessing attributes directly
spookylukey May 14, 2018
89ef658
format: initial support for variant forms
spookylukey May 14, 2018
8d879ea
format: implemented select expressions
spookylukey May 14, 2018
cef0734
format: select expression with numbers
spookylukey May 14, 2018
5cb1066
format: implemented function calls
spookylukey May 14, 2018
a011eae
format: improved handling of numbers
spookylukey May 14, 2018
d38d932
utils: added 'cachedproperty' decorator
spookylukey May 14, 2018
fea2742
format: implemented plural rule forms, plus consistent handling of nu…
spookylukey May 14, 2018
8c1b02a
resolver: doc string plus better argument order
spookylukey May 14, 2018
84fca75
format: handle named/keyword arguments to functions
spookylukey May 15, 2018
5f8d8ec
format: support for Term
spookylukey May 15, 2018
5c36e5c
format: fixed handling of missing messages/terms
spookylukey May 15, 2018
0e30a76
format: bulked out some tests
spookylukey May 15, 2018
fc7ad8b
format: Bulked out tests for numbers
spookylukey May 15, 2018
0188bea
format: handling floating point numbers
spookylukey May 15, 2018
104da18
fluent: report missing variants
spookylukey May 15, 2018
bbde8e5
format: implemented NUMBER builtin, with partial application
spookylukey May 15, 2018
e9c9e66
format: test addition
spookylukey May 15, 2018
edf121b
MessageContext: added convenience add_messages_from_file
spookylukey May 15, 2018
874c999
format: made 'args' optional.
spookylukey May 15, 2018
87fc3c3
format: there is no need to support bytestrings, we keep them out at …
spookylukey May 15, 2018
46dea8b
format: Added some docs
spookylukey May 15, 2018
3f028ad
Fixed some errors in README
spookylukey May 15, 2018
c5c5246
MessageContext: removed method that did IO, as per fluent philosophy
spookylukey May 22, 2018
34bc74a
More obvious and convenient way to run tests.
spookylukey May 22, 2018
b42d5a4
format: partial support for NUMBER(currencyDisplay=)
spookylukey May 25, 2018
7f6345a
format: support for remaining NUMBER options
spookylukey May 25, 2018
9f77d70
Updated README
spookylukey May 25, 2018
712d0fb
format: cyclic reference detection
spookylukey May 26, 2018
46a6d48
format: implemented `use_isolating`
spookylukey May 27, 2018
fb91884
Changes forgotten in previous commit 46a6d48 :-(
spookylukey May 28, 2018
5f41120
tox - test against pypy and pypy3
spookylukey May 28, 2018
05e3dbc
Travis - test against pypy and pypy3
spookylukey May 28, 2018
02044b5
types: support for decimal.Decimal as a number type
spookylukey Jun 13, 2018
4d2f711
types: Fixed bug with non-existant options to FluentNumber not raisin…
spookylukey Jun 14, 2018
9343548
Decimal fixup
spookylukey Jun 14, 2018
49c8e3c
format: initial DATETIME implementation
spookylukey Jun 14, 2018
7a2780f
types: check operations on FluentNumber work as expected
spookylukey Jun 15, 2018
f77147c
Fixed some missing tests
spookylukey Jun 15, 2018
eb4fa5e
format: memory and CPU DOS protection
spookylukey Jun 15, 2018
09cdc9a
flake8 and isort fixes
spookylukey Jun 15, 2018
ab24993
MessageContext: documented `use_isolating`
spookylukey Jun 17, 2018
7c914cf
format: documented DATETIME and fluent_date
spookylukey Jun 17, 2018
4c5a0c0
Docs update
spookylukey Jun 17, 2018
313e9b7
types: rewrote FluentNumber to use same options system as FluentDateType
spookylukey Jun 17, 2018
38f7b3a
types: validation for FluentDate dateStyle and timeStyle
spookylukey Jun 17, 2018
8c4120b
Removed some dead code
spookylukey Jun 17, 2018
7311fc6
format: defined and fixed behaviour for missing message body
spookylukey Jul 6, 2018
28d2a3d
format: better handling of FluentNone/missing args
spookylukey Jul 6, 2018
e3dc515
format: better tests for isolating chars
spookylukey Jul 6, 2018
34820d2
MessageContext: added test for missing message condition
spookylukey Jun 25, 2018
cb22168
docs: more docs for custom functions
spookylukey Jul 7, 2018
7e7b907
Moved some things out of resolver.py for re-usabilty
spookylukey Jul 10, 2018
f383425
context: consistent name for functions attribute
spookylukey Jul 24, 2018
bf17bb5
tests: Cleaned up unnecessary sys.path hacking
spookylukey Jun 23, 2018
f1891af
Beginnings of creating two implementations of MessageContext
spookylukey Jun 24, 2018
d382405
tests: run MessageContext tests against both implementations
spookylukey Jul 10, 2018
97f6b5b
Beginnings of implementation of CompilingMessageContext
spookylukey Jun 26, 2018
34b6d66
Added benchmark script
spookylukey Jun 26, 2018
1e18685
compiler: ensure unicode literals are being used
spookylukey Jun 27, 2018
46da8c2
CompilingMessageContext.format: micro-optimization
spookylukey Jun 27, 2018
08cf0e8
compiler: implemented placeables - message references
spookylukey Jul 6, 2018
c01d927
compiler: handle StringExpression
spookylukey Jul 3, 2018
c3f400d
tests: consistent formatting
spookylukey Jul 3, 2018
b2da7c8
compiler: refactoring using singledispatch
spookylukey Jul 3, 2018
9964e19
compiler: implemented external arguments
spookylukey Jul 3, 2018
5d00c7b
benchmark for formatting interpolation
spookylukey Jul 4, 2018
a6c39e1
Small refactorings
spookylukey Jul 4, 2018
6ac8c54
compiler: implemented automatic formatting of numbers/dates
spookylukey Jul 4, 2018
797aea3
tests: small refactor
spookylukey Jul 4, 2018
70cdd94
compiler: implement number literal handling
spookylukey Jul 6, 2018
be23c30
compiler: implemented function calls
spookylukey Jul 6, 2018
57e2e4d
compiler: rudimentary type system to clean up ad-hoc logic
spookylukey Jul 4, 2018
8843086
compiler: implemented compiling message attributes
spookylukey Jul 5, 2018
b1f07f4
compiler: don't pass locale around when we can make it module global
spookylukey Jul 5, 2018
12d9b81
compiler: correct behaviour for missing message body
spookylukey Jul 6, 2018
b683aed
compiler: implemented message references
spookylukey Jul 5, 2018
6499aab
compiler: Removed incorrect (and useless) type annotation
spookylukey Jul 5, 2018
38c0076
compiler: implemented variants
spookylukey Jul 6, 2018
3e58bbb
compiler: implemented select expressions
spookylukey Jul 6, 2018
357d782
compiler: use FluentNone instead of static string where appropriate
spookylukey Jul 6, 2018
c4c1608
compiler: made terms private
spookylukey Jul 7, 2018
2e82048
compiler: optimization for StringJoin expressions
spookylukey Jul 7, 2018
1668f51
benchmarks: switched to Polish locale for translations
spookylukey Jul 7, 2018
237d465
compiler: debugging helps
spookylukey Jul 8, 2018
c6f96ab
benchmark: added benchmark for selecting plural form variants
spookylukey Jul 8, 2018
a342c01
compiler: select expression optimization
spookylukey Jul 8, 2018
6cbc161
compiler: more powerful system for simplifying expressions
spookylukey Jul 9, 2018
44ab14c
compiler/interpreter: function signature is checked before calling
spookylukey Jul 9, 2018
6042c27
docs: documented custom function requirements and error handling
spookylukey Jul 9, 2018
d8ec780
compiler: implemented use_isolating
spookylukey Jul 9, 2018
d08795e
small refactor
spookylukey Jul 9, 2018
cb5dd57
compiler: cycle detection
spookylukey Jul 9, 2018
f08919f
tests: --verbose option for runtests.py
spookylukey Jul 9, 2018
7b62eda
tests: don't do billion laughs tests for CompilingMessageContext
spookylukey Jul 9, 2018
18eb542
tests: fixes for other Python versions
spookylukey Jul 9, 2018
1480d2e
Code comments
spookylukey Jul 10, 2018
c25bf2f
MessageContext: made compilation default strategy
spookylukey Jul 10, 2018
5a66ee0
compiler: removed code that tolerated an incomplete compiler implemen…
spookylukey Jul 10, 2018
dcc140c
codegen: better name
spookylukey Jul 10, 2018
60309dd
compiler: handle custom function name clashes properly
spookylukey Jul 10, 2018
770c1c1
docs for security/performance/Interpreting vs Compiling MessageContext
spookylukey Jul 11, 2018
fbf0aad
Python 2.7 fix for benchmark script
spookylukey Jul 11, 2018
3a8e725
MessageContext: added 'check_messages' method
spookylukey Jul 12, 2018
46b9bd8
benchmarks: added README
spookylukey Jul 12, 2018
977c096
compiler: compile time error messages
spookylukey Jul 12, 2018
0e03384
MessageContext: fixed behaviour when functions return wrongly typed o…
spookylukey Jul 15, 2018
e5a9594
compiler: better identifier sanitization
spookylukey Jul 15, 2018
8e778c5
Removed some obsolete 'TODO' messages
spookylukey Jul 15, 2018
dbfd488
compiler: better error messages for incorrect function call args
spookylukey Jul 16, 2018
98f0a36
compiler: correct order of defining names for custom functions
spookylukey Jul 20, 2018
ba2e8a1
compiler: nicer pattern for modified env
spookylukey Jul 24, 2018
09a45e3
compiler: made use of attr.evolve for copying env
spookylukey Jul 24, 2018
3f01dd5
compiler: fixed name collisions with Python keywords
spookylukey Jul 24, 2018
3085fe5
README updates
spookylukey Jul 24, 2018
b859efb
Merge branch 'master' into implement_format
spookylukey Jul 25, 2018
8d825c1
resolver: initial fixes for spec v0.6 changes
spookylukey Jul 25, 2018
95ccf7e
Merge branch 'implement_format' into compiling_message_context
spookylukey Jul 25, 2018
f139ffb
compiler: fixes for v0.6 spec and AST
spookylukey Jul 25, 2018
363e4e0
compiler: inline terms and variants
spookylukey Jul 27, 2018
c771d91
compiler: future proofing some codegen
spookylukey Jul 27, 2018
3e67f20
compiler: cleaned up some unused codgen operators
spookylukey Jul 27, 2018
dc6406a
Fixed failing tests on Python 2.7
spookylukey Jul 27, 2018
f0f719c
Fixed unused import - flake8 warning
spookylukey Jul 27, 2018
6797d4f
Merge branch 'implement_format' into compiling_message_context
spookylukey Jul 27, 2018
cc25a6a
Post merge fixup
spookylukey Jul 27, 2018
57ff657
compiler: don't return tuple for compiled message functions
spookylukey Sep 15, 2018
b1ceda9
compiler: removed unnecessary temporary variable for message calls.
spookylukey Sep 15, 2018
b3fb776
compiler: removed some unused functionality
spookylukey Sep 19, 2018
f84038a
Fixed CompilingMessageContext.check_messages to always include compil…
spookylukey Oct 30, 2018
e2cb337
Merge branch 'master' into implement_format
spookylukey Oct 30, 2018
e59724e
Fixes for Fluent syntax 0.7
spookylukey Oct 30, 2018
b590a25
Better clarity in README regarding performance
spookylukey Nov 26, 2018
0576421
Optimized 'format' hot path, for 10% improvement in simplest case
spookylukey Nov 26, 2018
3945ad4
Fixed failing test
spookylukey Nov 26, 2018
6090673
Merge branch 'implement_format' into compiling_message_context
spookylukey Nov 26, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
*.pyc
.eggs/
fluent.egg-info/
*.pot
*.mo
*.po
.pytest_cache
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ python:
- "2.7"
- "3.5"
- "3.6"
- "pypy"
- "pypy3"
- "nightly"
install: pip install tox-travis
script: tox
Expand Down
358 changes: 358 additions & 0 deletions README.md

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions fluent/builtins.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from .types import fluent_date, fluent_number

NUMBER = fluent_number
DATETIME = fluent_date


BUILTINS = {
'NUMBER': NUMBER,
'DATETIME': DATETIME,
}
Loading