Commit Graph

283 Commits

Author SHA1 Message Date
Daniel Kolesa 0f4e617e9f elua: alignment 2014-06-11 11:15:11 +01:00
Daniel Kolesa cd29d76ce5 elua: fix coverity issues 2014-06-11 11:12:27 +01:00
Daniel Kolesa 9db8aa3b3f elua: use #ifdef ENABLE_NLS 2014-06-11 10:47:12 +01:00
Daniel Kolesa f0d008abf8 elua: lose support for loadfile modes for the time being 2014-06-11 10:41:02 +01:00
Chris Michael 3fd6061505 elua: Fix building of binary
If we have ENABLE_NLS then we need to #include <locale.h> for the
'setlocale' function else we get an implicit function declaration
warning, and a build failure due to LC_ALL not being defined

@fix

Signed-off-by: Chris Michael <devilhorns@comcast.net>
2014-06-10 15:52:50 -04:00
Daniel Kolesa 319034d683 elua: fix warnings with -Wextra -Wshadow 2014-06-10 15:48:54 +01:00
Daniel Kolesa 17698c9c7e elua: xgettext fixes 2014-06-10 15:48:53 +01:00
Daniel Kolesa 6df8766b6a elua: some janitoring (add newlines to the end of files) 2014-06-10 15:48:53 +01:00
Daniel Kolesa f8852d88ec elua: better caching behavior (try to use bytecode first) 2014-06-10 15:48:53 +01:00
Daniel Kolesa 4ebdf91ca8 elua: use eina_prefix 2014-06-10 15:48:53 +01:00
Daniel Kolesa ff519ccc4a elua: move __ctor_common, __do_start, __do_end out of the object (as it's effectively empty now, it can be generated) 2014-06-10 15:48:53 +01:00
Daniel Kolesa 072f318d44 elua: generator fix 2014-06-10 15:48:53 +01:00
Daniel Kolesa 4d5f4537c9 do not generate __M if not needed 2014-06-10 15:48:53 +01:00
Daniel Kolesa e5bdfdfff0 elua: better namespace handling in lualian generator (support more than 1 level of namespace) 2014-06-10 15:48:53 +01:00
Daniel Kolesa 39cdde7280 elua: prevent method calls on bad objects 2014-06-10 15:48:53 +01:00
Daniel Kolesa 5ee0d530ca elua: propagate property definitions down the inheritance hierarchy 2014-06-10 15:48:53 +01:00
Daniel Kolesa b665bdbd8a elua: eolian binding fix plus support namespaces in the lualian generator 2014-06-10 15:48:53 +01:00
Daniel Kolesa 822c517f93 elua: initial xgettext call parsing 2014-06-10 15:48:53 +01:00
Daniel Kolesa 890660d485 elua: String and Call objects in xgettext generator - includes methods to automatically decide flags for String, making things a lot easier (thanks to chaining) 2014-06-10 15:48:53 +01:00
Daniel Kolesa 83032e611d elua: store flags for hashing as well 2014-06-10 15:48:53 +01:00
Daniel Kolesa 2d5806294a elua: never actually fail parsing (keep error messages for debug, hidden by default) 2014-06-10 15:48:53 +01:00
Daniel Kolesa 9c3f65640c elua: pre-parse flags in xgettext app 2014-06-10 15:48:53 +01:00
Daniel Kolesa e32a1d7e78 elua: xgettext's semantics are WTF, but okay, emulate it 2014-06-10 15:48:53 +01:00
Daniel Kolesa d0ff647776 elua: new util: table.uniq, and use it in xgettext generator 2014-06-10 15:48:53 +01:00
Daniel Kolesa aab605e36a elua: properly copy flags around 2014-06-10 15:48:52 +01:00
Daniel Kolesa ef2ad4f473 elua: fix xgettext --extract-all 2014-06-10 15:48:52 +01:00
Daniel Kolesa 378b376cc8 elua: complete lexer (lex all valid tokens) 2014-06-10 15:48:52 +01:00
Daniel Kolesa 9d5b2d433e elua: prepare xgettext for flag comments and try to emulate xgettext's silly behavior when it comes to concatenating comments 2014-06-10 15:48:52 +01:00
Daniel Kolesa d8caf323d8 elua: fix xgettext 2014-06-10 15:48:52 +01:00
Daniel Kolesa 88473de76a elua: fixed up the xgettext lua lexer/parser/generator 2014-06-10 15:48:52 +01:00
Daniel Kolesa be3e046865 elua: can only specify a keyword once 2014-06-10 15:48:52 +01:00
Daniel Kolesa 819b65090b elua: support for -a (--extract-all) option in xgettext 2014-06-10 15:48:52 +01:00
Daniel Kolesa 926282026b elua: merge comments in xgettext generator 2014-06-10 15:48:52 +01:00
Daniel Kolesa 7950c55965 elua: respect add-location / no-location options in xgettext 2014-06-10 15:48:52 +01:00
Daniel Kolesa ee8cdc5411 elua: group messages with the same contents together, generate grouped line info 2014-06-10 15:48:52 +01:00
Daniel Kolesa 7cf6a8abb0 elua: line information in the generated output 2014-06-10 15:48:52 +01:00
Daniel Kolesa a0b8f72ae9 elua: respect msgstr prefix and suffix in xgettext 2014-06-10 15:48:52 +01:00
Daniel Kolesa b638f4d034 elua: respect comment tags in the lexer 2014-06-10 15:48:52 +01:00
Daniel Kolesa b2af5ff97e elua: pass opts, flags around 2014-06-10 15:48:52 +01:00
Daniel Kolesa 0e5f9bc151 elua: change xgettext lexer to never include delimiters and also expand \n escape sequence in short strings to actual newline (no other escapes get this treatment) 2014-06-10 15:48:52 +01:00
Daniel Kolesa 297f9a821a elua: almost functional xgettext generator 2014-06-10 15:48:52 +01:00
Daniel Kolesa d8010702e8 elua: initial stuff for the xgettext generator, check existence of all input files beforehand in the app, and other fixes 2014-06-10 15:48:52 +01:00
Daniel Kolesa a98b916a74 elua: get_cmdline_from_argv cleanup + use _popen on windows 2014-06-10 15:48:52 +01:00
Daniel Kolesa 4311dc0439 elua: fclose before realpath 2014-06-10 15:48:52 +01:00
Daniel Kolesa 489b5fac11 elua: do not use fork in our "array popen" impl; instead serialize args in a platform specific way 2014-06-10 15:48:52 +01:00
Daniel Kolesa 6558d1ccc9 elua: reformat C source to EFL style 2014-06-10 15:48:52 +01:00
Daniel Kolesa 5f1e08bddf elua: remove prefix stripping from lualian 2014-06-10 15:48:52 +01:00
Daniel Kolesa 6614d02a69 elua: update lualian against latest eolian API 2014-06-10 15:48:52 +01:00
Daniel Kolesa 6896f2949e elua: xgettext parser: proper keyword parsing 2014-06-10 15:48:51 +01:00
Daniel Kolesa a47dc77a8a elua: xgettext parser argument parsing 2014-06-10 15:48:51 +01:00
Daniel Kolesa 812a601548 elua: extend the xgettext parser a bit 2014-06-10 15:48:51 +01:00
Daniel Kolesa 839ce0f651 elua: xgettext keyword fix 2014-06-10 15:48:51 +01:00
Daniel Kolesa b168a515e2 elua: sanitize keywords and extract info in xgettext (include default keywords for lua), dgettext and dngettext compatibility calls 2014-06-10 15:48:51 +01:00
Daniel Kolesa 00bec70b69 elua: initial work on parser part of the extractor 2014-06-10 15:48:51 +01:00
Daniel Kolesa 3f4fd784c2 elua: file search function 2014-06-10 15:48:51 +01:00
Daniel Kolesa 7c449a14e1 elua: make xgettext use excluded_files, do some re-mappings, and have a default search dir 2014-06-10 15:48:51 +01:00
Daniel Kolesa 02ef160621 evil: add fork, adjust elua to use that 2014-06-10 15:48:51 +01:00
Daniel Kolesa 9c42595225 elua: popenv fix (read proper stack items as args), getopt fix (fixed array append), xgettext: use cutil.popenv 2014-06-10 15:48:51 +01:00
Daniel Kolesa e9b555c57b elua: popenv function 2014-06-10 15:48:51 +01:00
Daniel Kolesa a04948c02f elua: fork_win cleanup 2014-06-10 15:48:51 +01:00
Daniel Kolesa 420f7a869a elua: include fork_win.c in compilation 2014-06-10 15:48:51 +01:00
Daniel Kolesa 88ca0dbf3f elua: custom non-shell popen implementation 2014-06-10 15:48:51 +01:00
Daniel Kolesa 30415f9261 elua: fork impl for windows 2014-06-10 15:48:51 +01:00
Daniel Kolesa fd6c1f6888 elua: comment is a valid token in xgettext 2014-06-10 15:48:51 +01:00
Daniel Kolesa 5b7f44ea5b elua: add build_args function to core cutil library, for building normalized args string in a platform independent way 2014-06-10 15:48:51 +01:00
Daniel Kolesa 9bb3667e2b elua: xgettext is again at least partially functional 2014-06-10 15:48:51 +01:00
Daniel Kolesa 139502dc76 elua: handle all xgettext args correctly 2014-06-10 15:48:51 +01:00
Daniel Kolesa b1bfd90d40 elua: xgettext progress, currently broken 2014-06-10 15:48:51 +01:00
Daniel Kolesa 708aaeeb12 elua: pass opts to callback 2014-06-10 15:48:51 +01:00
Daniel Kolesa 6d739a8746 elua: ngettext support 2014-06-10 15:48:51 +01:00
Daniel Kolesa 63ccaee7fd elua: ability to specify custom opts table for each desc in getopt 2014-06-10 15:48:51 +01:00
Daniel Kolesa bc2b6b503f elua: simplified getopt (allocates fewer tables) 2014-06-10 15:48:51 +01:00
Daniel Kolesa 01a4fd89d2 elua: do not include the : in arg[0] 2014-06-10 15:48:51 +01:00
Daniel Kolesa ab05d47d7c elua: free format buffers immediately 2014-06-10 15:48:51 +01:00
Daniel Kolesa e8b356858b elua: never pcall in format, instead keep track of the types properly 2014-06-10 15:48:51 +01:00
Daniel Kolesa ebbce82403 elua: perform conversion beforehand 2014-06-10 15:48:51 +01:00
Daniel Kolesa 654653bc4a elua: check types manually instead of pcall in one place for format 2014-06-10 15:48:51 +01:00
Daniel Kolesa 5eccfb29b7 elua: some more checking for no value 2014-06-10 15:48:51 +01:00
Daniel Kolesa 0c7b3e5d6b elua: format bug fix 2014-06-10 15:48:51 +01:00
Daniel Kolesa b304316b81 elua: better error handling for format 2014-06-10 15:48:51 +01:00
Daniel Kolesa 3da9de3d41 elua: use string buffer in all places for format plus extra optimizations 2014-06-10 15:48:50 +01:00
Daniel Kolesa a6e50fa9c7 elua: use custom string buffer impl for format (avoids multiple table allocs and calls to string.char) 2014-06-10 15:48:50 +01:00
Daniel Kolesa 8738ca957d elua: slight optimization of format func 2014-06-10 15:48:50 +01:00
Daniel Kolesa 006a49ddda elua: relatively slow but very powerful string formatter with support for positional and named format arguments, invoked via % 2014-06-10 15:48:50 +01:00
Daniel Kolesa e33efdb745 elua: xgettext: support for -X 2014-06-10 15:48:50 +01:00
Daniel Kolesa c0baa15b11 elua: insert input files always after opts 2014-06-10 15:48:50 +01:00
Daniel Kolesa d90bba655f elua: expand the input file lists for xgettext call (we want to leave out lua files) 2014-06-10 15:48:50 +01:00
Daniel Kolesa bebe011676 elua: use the new app loading system 2014-06-10 15:48:50 +01:00
Daniel Kolesa 544bf37c30 elua: a general system for application loading without having to specify explicit path 2014-06-10 15:48:50 +01:00
Daniel Kolesa 85367d35be elua: match file extensions in a case insensitive way 2014-06-10 15:48:50 +01:00
Daniel Kolesa 38ae60f744 elua: more checks 2014-06-10 15:48:50 +01:00
Daniel Kolesa 69a64dd620 elua: a bit more informative getopt plus better arg handling when calling to xgettext 2014-06-10 15:48:50 +01:00
Daniel Kolesa 344c1cbaf1 elua: more informative getopt 2014-06-10 15:48:50 +01:00
Daniel Kolesa 55b7973e56 elua: xgettext lexer enhancements 2014-06-10 15:48:50 +01:00
Daniel Kolesa 23c27f06c5 elua: simplified source 2014-06-10 15:48:50 +01:00
Daniel Kolesa b71231d93d elua: typo fix 2014-06-10 15:48:50 +01:00
Daniel Kolesa 341d8a9168 elua: typo fix 2014-06-10 15:48:50 +01:00
Daniel Kolesa dd8e3b433f elua: use an appropriately sized buffer 2014-06-10 15:48:50 +01:00
Daniel Kolesa 6220dd5968 elua: lexer for xgettext 2014-06-10 15:48:50 +01:00
Daniel Kolesa cbeaf5b58a elua: utility func to exec a process (without spawning a shell like os.execute) 2014-06-10 15:48:50 +01:00
Daniel Kolesa 58409c521a elua: trigger xgettext execution from xgettext.lua, which is executed by xgettext_wrapper 2014-06-10 15:48:50 +01:00
Daniel Kolesa 4dfec82877 elua: support the EFL_RUN_IN_TREE environment variable 2014-06-10 15:48:50 +01:00
Daniel Kolesa 57ebf0e02c elua: initial code for xgettext.lua, a xgettext variant that supports lua
will be used to handle i18n for lua files in EFL (because only gettext 0.18.3+ supports Lua) and it'll be usable standalone too, it will also be able of handling more things than lua support in xgettext does (e.g. concatenated string literals will be considered one string)
2014-06-10 15:48:50 +01:00
Daniel Kolesa 3fd4399c6f elua: allow description of positional arguments in help in getopt (using metavar field without short/long) 2014-06-10 15:48:50 +01:00
Daniel Kolesa c427742634 elua: support for omitting things from help 2014-06-10 15:48:50 +01:00
Daniel Kolesa 3c42301f00 elua: in/out fix 2014-06-10 15:48:50 +01:00
Daniel Kolesa 176e41020d elua: remove leftover 2014-06-10 15:48:50 +01:00
Daniel Kolesa 98192dd8c3 elua: we don't need to include func name in conversion funcs (they're all the same...), also print out the required conversion functions during gen 2014-06-10 15:48:50 +01:00
Daniel Kolesa 13f3c616d5 elua: pass ownership information to converters 2014-06-10 15:48:49 +01:00
Daniel Kolesa e90973e5cb elua: eolian fix (return nil instead of null in type_information_get), generate different names for type conversion funcs 2014-06-10 15:48:49 +01:00
Daniel Kolesa a0838343cb elua: lualian reorg 2014-06-10 15:48:49 +01:00
Daniel Kolesa 5b307c282b elua: support for list appends in elua.getopt 2014-06-10 15:48:49 +01:00
Daniel Kolesa f0330e5692 elua: alignment 2014-06-10 15:48:49 +01:00
Daniel Kolesa 7eff92c055 elua: getopt help alignment 2014-06-10 15:48:49 +01:00
Daniel Kolesa 15dd9dd623 elua: enforce posixly_correct in getopt_long of elua 2014-06-10 15:48:49 +01:00
Daniel Kolesa ae4daa5401 elua: also use hash fields to store resulting optional arguments 2014-06-10 15:48:49 +01:00
Daniel Kolesa 8c5cfce2a4 elua: if script returns true, do not start the main loop 2014-06-10 15:48:49 +01:00
Daniel Kolesa a94c216442 elua: match help categories in a case insensitive way, and add them to lualian 2014-06-10 15:48:49 +01:00
Daniel Kolesa e293536915 elua: getopt: support for categories in help callback, fix newline insertion in help 2014-06-10 15:48:49 +01:00
Daniel Kolesa d3d09f7df6 elua: support for return values in getopt help 2014-06-10 15:48:49 +01:00
Daniel Kolesa bdecee2eca elua: support for help categories in getopt 2014-06-10 15:48:49 +01:00
Daniel Kolesa 310a8ab13b elua: support for "done" callback in getopt 2014-06-10 15:48:49 +01:00
Daniel Kolesa 131826a083 elua: error callback in getopt 2014-06-10 15:48:49 +01:00
Daniel Kolesa c9b1378217 elua: use callbacks more in lualian 2014-06-10 15:48:49 +01:00
Daniel Kolesa 46f07a670e elua: getopt support for callbacks 2014-06-10 15:48:49 +01:00
Daniel Kolesa cde3ce5220 elua: smarter progname replacement in getopt 2014-06-10 15:48:49 +01:00
Daniel Kolesa 1afd1e6f27 elua: getopt api improvement 2014-06-10 15:48:49 +01:00
Daniel Kolesa 3130a0ec20 elua: remove license printing 2014-06-10 15:48:49 +01:00
Daniel Kolesa 8056a85428 elua: support for default domain in gettext module 2014-06-10 15:48:49 +01:00
Daniel Kolesa aaaf103234 elua: gettext cleanups, use ffi for calling into gettext to speed it up 2014-06-10 15:48:49 +01:00
Daniel Kolesa 76b445fb6d elua: i18n/l10n support including gettext module for user apps, bump gettext requirement to 0.18.3 (required for lua support in xgettext) 2014-06-10 15:48:49 +01:00
Daniel Kolesa 7876dd579f elua: lualian: remove out/inout support on keys 2014-06-10 15:48:49 +01:00
Daniel Kolesa 754f0fee79 elua: lualian: with directory scanning in, there is no need to do this anymore 2014-06-10 15:48:49 +01:00
Daniel Kolesa 4f7cdefbee elua: geometry and size parsing support in getopt 2014-06-10 15:48:49 +01:00
Daniel Kolesa 6da958d462 elua: initial support for complex types in lualian plus bug fixes 2014-06-10 15:48:49 +01:00
Daniel Kolesa 6a5057ef0d elua getopt: support for optional values 2014-06-10 15:48:49 +01:00
Daniel Kolesa e2f912aa03 elua: remove getopt-like interface from getopt.lua, use descs directly instead, and add a system of aliases (optional) 2014-06-10 15:48:48 +01:00
Daniel Kolesa e742b758d2 elua: do not use ecore_getopt, getopt.lua improvements and fixes, initial lualian generator script, lualian module changes 2014-06-10 15:48:48 +01:00
Daniel Kolesa 17be497fc2 elua: help support in getopt 2014-06-10 15:48:48 +01:00
Daniel Kolesa 975ca2634f elua: declarative version of the getopt function 2014-06-10 15:48:48 +01:00
Daniel Kolesa 27a5151bd8 elua: getopt module 2014-06-10 15:48:48 +01:00
Daniel Kolesa cefd51b955 elua: adjust module system for injection into loaded table nad preload, lualian can now inject inside of existing modules 2014-06-10 15:48:48 +01:00
Daniel Kolesa 942d684825 elua: register classes in lualian generated code 2014-06-10 15:48:48 +01:00
Daniel Kolesa d301b5bb84 elua: use actual class_get functions instead of placeholder 2014-06-10 15:48:48 +01:00
Daniel Kolesa 10c68c59c8 elua: generate a default constructor if none provided 2014-06-10 15:48:48 +01:00
Daniel Kolesa 3b053abdac elua: lualian support for non-default constructors, and a fix in event generation 2014-06-10 15:48:48 +01:00
Daniel Kolesa ad2aa8e9a9 elua: basic constructor generation in lualian 2014-06-10 15:48:48 +01:00
Daniel Kolesa 2f678f862d elua: make it possible to return values from constructors 2014-06-10 15:48:48 +01:00
Daniel Kolesa 437c2cf68f elua: event fix 2014-06-10 15:48:48 +01:00
Daniel Kolesa c2d581631b elua: functional event generation 2014-06-10 15:48:48 +01:00