dzuelke / grammatista Goto Github PK
View Code? Open in Web Editor NEWA utility for finding, managing, transforming and processing translatable information in software projects.
License: MIT License
A utility for finding, managing, transforming and processing translatable information in software projects.
License: MIT License
given the pattern t(declare(singular_message), declare(parameters), declare(domain))
and a code like t("msg", [], "master")
the token matching breaks down completely since in the declare(parameters)
part it looks for a single token and then fails to detect the domain.
We could solve this by changing the parsing to look for the next token in the pattern when at the declare()
position (in this case the ,
) while skipping all parts in brackets/parenthesis. But I think this would be rather brittle.
Additionally having a generic way to parse an AST would also allow us implementing other languages pretty easily. Python supports getting the AST from code, with Javascript we could use http://lisperator.net/uglifyjs/ast.
Assuming a pattern definition like
'->t(declare(singular_message))' => [...],
't(declare(singular_message))' => [...],
both pattern will match for a line like $this->t(...)
, since
grammatista/lib/Parser/Php.php
Line 373 in dd1e835
One Problem with skipping the amount of matched tokens could be code like $this->t($this->t(...))
which would then only find the outer t()
call. That seems to me to be a rather edge case though, so we could add an option to a pattern which allows the old behaviour?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.