Commit Graph

310 Commits

Author SHA1 Message Date
Deukhoofd b0450d3bf5
Show file name in error messages, to handle errors from modules easier 2018-12-07 14:51:02 +01:00
Deukhoofd edd352e62a
Better error reporting if unable to find module 2018-12-07 14:41:19 +01:00
Deukhoofd c1da2dd5b7
Fix missing span in bad expression syntax 2018-12-07 14:36:44 +01:00
Deukhoofd 247ac10f17
Fixed BadExpression throwing exceptions 2018-12-07 14:08:32 +01:00
Deukhoofd 97968ef491
Fixed removed constructor that was needed for IDEs 2018-12-07 14:05:17 +01:00
Deukhoofd e48a89e70d
Changed how modules bind so that they can override existing variables 2018-12-07 13:51:43 +01:00
Deukhoofd 98e5c1c136
Reworked modules, they now should bind properly 2018-12-07 13:49:51 +01:00
Deukhoofd 1caf8320b3
Fixed issue with no parameter funcs 2018-12-06 16:25:06 +01:00
Deukhoofd 4054f1d383
Fixed static scope loader not deriving types properly 2018-12-06 16:06:42 +01:00
Deukhoofd 81cd22ce28
Support for generic Actions 2018-12-06 15:45:19 +01:00
Deukhoofd 7996420ee5
Fixes for require 2018-12-06 15:32:07 +01:00
Deukhoofd 520cd1ffcc
Initial support for generic funcs 2018-12-05 17:20:28 +01:00
Deukhoofd 587c8dfff3
Minor cleanup 2018-12-05 15:18:41 +01:00
Deukhoofd 8034a11fe3
Support for Enums 2018-12-05 15:14:31 +01:00
Deukhoofd 5b0ce2e52c
General fixes tweaks and things 2018-12-03 18:32:27 +01:00
Deukhoofd 6ba3860e84
Implement number comparison operators 2018-12-03 16:05:14 +01:00
Deukhoofd a9f4ef1b65
Bind whether a variable symbol is a creation statement or just changing the variable 2018-12-02 17:26:23 +01:00
Deukhoofd 07a71129a2
Make a literal expression public 2018-12-01 13:39:39 +01:00
Deukhoofd 3867ae77ea
Support ScriptType as parameter 2018-11-30 16:51:18 +01:00
Deukhoofd 2a0cce9bac
Fixed function parameter type not setting properly when unbound 2018-11-30 16:48:38 +01:00
Deukhoofd 00178cfa82
Handling for type checking parameters of internal functions 2018-11-30 16:19:25 +01:00
Deukhoofd f08d1c2541
Reworked function handling, support for type checking internal CSharp functions 2018-11-30 15:28:36 +01:00
Deukhoofd 81a6b05b26
Actually pass script reference if requested 2018-11-30 12:09:06 +01:00
Deukhoofd 1243492453
Adds comments to basic library functions 2018-11-30 12:07:18 +01:00
Deukhoofd 1f1b8c621e
changed parameters for require function 2018-11-30 11:51:22 +01:00
Deukhoofd 9e27778af1
Support for passing Script reference to functions. useful when options are required for function 2018-11-30 11:31:45 +01:00
Deukhoofd 3a3ed071d2
Move ScriptFunctions to own namespace 2018-11-30 11:15:52 +01:00
Deukhoofd 9455b753a0
Resolved UserData not binding proper type when multiple index expressions are chained 2018-11-30 11:12:10 +01:00
Deukhoofd a4ad57e3f7
Better support for userdata bound types 2018-11-29 20:45:59 +01:00
Deukhoofd 4fa0ad9f70
Log error if using full stop indexer on userdata type when the indexer doesn't exist 2018-11-29 19:10:03 +01:00
Deukhoofd f983239b5a
Bind indexing of userdata 2018-11-29 18:09:08 +01:00
Deukhoofd c1f4c8fb37
Fixes tests 2018-11-28 21:28:01 +01:00
Deukhoofd af0ff235e1
Fixes script --> C# function calls not working 2018-11-28 21:23:08 +01:00
Deukhoofd babbf2875f
Type check when calling script function from CSharp 2018-11-28 20:53:45 +01:00
Deukhoofd ba82b28ee4
Validate function call parameter types 2018-11-28 16:47:52 +01:00
Deukhoofd a64df2ff6b
Add spans to parameterTokens 2018-11-28 16:23:45 +01:00
Deukhoofd 27a7465961
Adds basics for predefined function parameter types 2018-11-28 16:18:56 +01:00
Deukhoofd 062f0f84ad
Allow for empty return expressions 2018-11-28 14:31:40 +01:00
Deukhoofd cefe48cb4b
Handle empty return statements 2018-11-28 14:13:39 +01:00
Deukhoofd cc029d0689
Handle binding unbound functions later better 2018-11-28 13:36:20 +01:00
Deukhoofd 576273ac56
Better support for binding functions, specifically nested functions 2018-11-28 13:30:24 +01:00
Deukhoofd 71397f5db2
Bind return type from a function to a variable 2018-11-28 12:54:18 +01:00
Deukhoofd dbc7b4eb4f
Add warnings when variable types are unknown 2018-11-28 12:11:09 +01:00
Deukhoofd 7ee230e20c
Handle warnings, and add a warning if a function parameter has an unknown type 2018-11-28 10:56:35 +01:00
Deukhoofd 14e30d0855
Support for getting a bound scope at a specific character position 2018-11-27 19:04:58 +01:00
Deukhoofd 8ece53db5b
Reworked handling of getting bottom node. Now uses an iterator to iterate from bottom to top nodes 2018-11-27 18:38:28 +01:00
Deukhoofd dd8569ecb0
Fixes diagnostics breaking when using ContinueWith function 2018-11-27 17:40:54 +01:00
Deukhoofd 0279859637
Fixes binary operators not properly handling indexers 2018-11-27 17:40:35 +01:00
Deukhoofd 160ed60cc2
Fix index error on userdata 2018-11-27 17:40:13 +01:00
Deukhoofd 16e1cde5c6
More work on binding table variables 2018-11-27 15:49:44 +01:00
Deukhoofd a0861e090f
Work on type checking variables when getting them from tables 2018-11-27 14:37:58 +01:00
Deukhoofd dca8773e54
Allow accessing variables inside a table from the variable symbol 2018-11-27 14:15:45 +01:00
Deukhoofd 8b08aea404
Dont save data comments if disabled through options 2018-11-27 12:35:20 +01:00
Deukhoofd b7d01b02f1
Exception throwing when required, and fixes for unit tests 2018-11-26 17:23:56 +01:00
Deukhoofd 74da87d936
Work on new execution start path 2018-11-26 16:55:10 +01:00
Deukhoofd 15ce180b8c
Allow assigning comment info to all variables 2018-11-26 15:05:20 +01:00
Deukhoofd 963245c9e7
Support for storing comments about specific variables 2018-11-26 14:50:46 +01:00
Deukhoofd a66b1abbf5
Better comments 2018-11-26 13:59:57 +01:00
Deukhoofd e02eb39753
Support for comments 2018-11-26 13:42:50 +01:00
Deukhoofd 2ee8170f74
Fix infinite loop with functions calls 2018-11-25 22:06:20 +01:00
Deukhoofd 2111f4080c
Fixes string not checking if it ends with a quotation mark 2018-11-25 22:05:01 +01:00
Deukhoofd 8f91b7f550
Fixes infinite loop in parsing blocks 2018-11-25 21:50:18 +01:00
Deukhoofd 55206f3807
Changed function variable declarations to BoundVariableSymbols 2018-11-25 21:44:03 +01:00
Deukhoofd d4fc24b389
Fixes Source Text length being off by the length of a newline 2018-11-25 21:18:58 +01:00
Deukhoofd 5f9c32874a
Diagnostic for invalid number of parameters 2018-11-25 20:55:36 +01:00
Deukhoofd 6bb8139f40
Break several while loop if tokens are not consumed 2018-11-25 19:45:10 +01:00
Deukhoofd cae3d7fb53
Lots of work for handling incomplete code and inspections better 2018-11-25 19:30:18 +01:00
Deukhoofd 0b6359f499
Fix broken reference 2018-11-24 15:58:34 +01:00
Deukhoofd cd04486d16
Adds Unary length operator 2018-11-24 15:11:33 +01:00
Deukhoofd 2dc59c5f8b
Adds tostring and type functions 2018-11-24 14:49:20 +01:00
Deukhoofd 194e7236c4
Unit tests for ipairs and pairs, as well as changing how they handle null. ipairs now breaks at first nil value, pairs skips it 2018-11-24 14:39:53 +01:00
Deukhoofd 13ac6f2754
Rework for loops to use iterators, requiring pairs or ipairs function to handle multi-assignment 2018-11-24 14:35:23 +01:00
Deukhoofd c63df3c941
Work on standard libraries.
- Allows Standard Libraries to work with actual luatypes, to prevent constant back and forth casting
- adds ipairs function, doesn't do anything except maintain compatibility with lua
- several tests
2018-11-24 13:35:40 +01:00
Deukhoofd 806b3d5689
Fix breaking of most complex expressions 2018-11-24 13:04:21 +01:00
Deukhoofd 9be1cfa1fc
Fixes issue where functions inside binary operators wouldnt work 2018-11-24 12:55:51 +01:00
Deukhoofd 62a18e22d4
Fixed Scoping issue 2018-11-24 12:42:54 +01:00
Deukhoofd 638394d25b
Generic For Loops 2018-11-23 18:18:07 +01:00
Deukhoofd 2db4d0607e
Implements break statement 2018-11-23 15:27:48 +01:00
Deukhoofd d2c14d213c
Add Numeric For Loops 2018-11-23 14:38:45 +01:00
Deukhoofd 1928979b40
More unit tests 2018-11-23 13:34:46 +01:00
Deukhoofd 8d6d6e45af
Handle lua -> C# function invocation exceptions more gracefully 2018-11-23 13:34:21 +01:00
Deukhoofd d6e18d9b0c
Better handling of Static Scope 2018-11-23 13:28:11 +01:00
Deukhoofd 95f76bc5e3
Minor performance tweak to handle LuaType casting better if type is already a LuaType 2018-11-23 13:24:41 +01:00
Deukhoofd ea24695128
Fixes binder assigning values to static read only scope 2018-11-23 13:18:49 +01:00
Deukhoofd aae16e8b62
General fixes for Tests 2018-11-23 12:55:28 +01:00
Deukhoofd 1e9b0e0166
Some initial work on standard libraries 2018-11-21 20:59:27 +01:00
Deukhoofd 68830a1676
Don't bind/evaluate variable value if the name is just an underscore 2018-11-21 17:25:12 +01:00
Deukhoofd 4ab755d0d2
Support for assigning multiple variables from a table 2018-11-21 17:18:35 +01:00
Deukhoofd 105c40bc05
Special UserData types for ILists(includes arrays) and IDictionaries 2018-11-21 14:49:59 +01:00
Deukhoofd 1d24be85d6
Better error handling of getting userdata members 2018-11-21 14:11:52 +01:00
Deukhoofd 8dd2be8c67
Better error handling for setting userdata values 2018-11-21 14:04:43 +01:00
Deukhoofd 605b98284d
Handle Unary operator overloading for UserData 2018-11-21 13:54:41 +01:00
Deukhoofd c627100e9c
Handle Binary operator overloading for UserData 2018-11-21 13:47:16 +01:00
Deukhoofd 0702b9f271
Allows for overloaded functions in CSharp to be used, initial work on handling CSHarp operators 2018-11-21 13:08:41 +01:00
Deukhoofd fe4a8d25ad
Message reporting if indexable value does not exist 2018-11-20 17:33:51 +01:00
Deukhoofd 2f8c295675
Allow identifiers to start with an underscore 2018-11-20 14:23:50 +01:00
Deukhoofd 8f6d2591f3
Make userdata fields/properties/methods case insensitive
While this can potentially cause collisions, this allows us to easily use Lua's style guide
2018-11-20 14:17:15 +01:00
Deukhoofd df8c7b99c9
Made indexable also work with full stop index 2018-11-20 14:05:34 +01:00
Deukhoofd 066af47b5b
Work on calling CSharp functions from Lua 2018-11-20 12:55:41 +01:00
Deukhoofd d1b1675bba
Added UserData support 2018-11-19 17:22:25 +01:00
Deukhoofd 7d551b6313
Adds assignment to tables 2018-11-19 16:22:13 +01:00
Deukhoofd f4ae57c550
Fix Binder not allowing setting variables due to parent scope 2018-11-19 14:45:20 +01:00
Deukhoofd c4962ac24c
Removed accidental syntax 2018-11-19 14:30:00 +01:00
Deukhoofd 2787d947b5
Better error message if type is not indexable with type 2018-11-19 14:29:35 +01:00
Deukhoofd 86447d0a36
Made strings indexable 2018-11-19 13:53:44 +01:00
Deukhoofd b3b26964cc
More fixes for scope 2018-11-19 12:49:48 +01:00
Deukhoofd 1f57eed3e7
Reworked scope again 2018-11-19 12:17:21 +01:00
Deukhoofd 860f2cc7e5
Lots of work on rewriting functions to allow more functionality 2018-11-18 22:22:30 +01:00
Deukhoofd dd9f5416a0
More work on nesting 2018-11-18 20:20:03 +01:00
Deukhoofd d8f7651de7
work on nested tables, will need some cleanup later 2018-11-18 16:08:20 +01:00
Deukhoofd 3d4e6380ea
Functionality for indexing tables 2018-11-18 14:18:24 +01:00
Deukhoofd 5a52c235c5
Support more in tables, including local variables that are hidden from the outside 2018-11-17 19:56:52 +01:00
Deukhoofd 44a2048153
Better evaluating of tables, allows things like functions to be added to tables as well 2018-11-17 19:45:24 +01:00
Deukhoofd b897adccf8
Fix simple expressions not functioning 2018-11-17 19:18:54 +01:00
Deukhoofd 6a396d6368
Adds Tables 2018-11-17 19:13:05 +01:00
Deukhoofd 4414534866
Allow escaping quotes in string 2018-11-17 16:36:41 +01:00
Deukhoofd 46308557c8
Fix error when character after string end 2018-11-17 16:10:04 +01:00
Deukhoofd 2baf2b223e
Adds support for strings 2018-11-17 15:57:26 +01:00
Deukhoofd 7beeb713c9
Show full lines in error messages in Ycicle 2018-11-17 14:49:26 +01:00
Deukhoofd 16d50b3311
Fix text spans being too long (using end pos as length) 2018-11-17 14:37:41 +01:00
Deukhoofd 0f45660a43
Show text line in error messages 2018-11-17 14:20:43 +01:00
Deukhoofd c013ed38c6
Fix continuing with previous script scope 2018-11-17 13:05:08 +01:00
Deukhoofd a631d3b377
Make LuaTypes internal, and only return the actual values 2018-11-17 12:40:28 +01:00
Deukhoofd f74992e47b
Add parameterized callable functions from CSharp 2018-11-16 14:58:15 +01:00
Deukhoofd e5ea4d0fde
Fix nested return not working 2018-11-16 14:47:03 +01:00
Deukhoofd 47e2dadb8d
Way better handling of calling functions from CSHarp 2018-11-16 14:46:12 +01:00
Deukhoofd 62ad100aee
More logical handling of return values 2018-11-16 14:11:27 +01:00
Deukhoofd 62f31ef0d3
Fix Ycicle arguments not persisting 2018-11-16 13:55:31 +01:00
Deukhoofd 7c6d847adb
Handle function returns 2018-11-16 13:45:03 +01:00
Deukhoofd eff60375ea
Bind functions even when they're not called, but with `Unknown` type parameters 2018-11-15 20:54:44 +01:00
Deukhoofd da6e95bfac
Resolve function parameter types by checking calls to the function 2018-11-15 20:48:52 +01:00
Deukhoofd d5c8a959fb
Add Function Calling 2018-11-15 20:13:53 +01:00
Deukhoofd 07660b6c46
Implement defining functions 2018-11-15 15:51:05 +01:00
Deukhoofd 58b5a7355e
Fixes type changing when initially nil 2018-11-14 17:10:06 +01:00
Deukhoofd d6057ae954
Tweaks for tests, allow for grabbing global scope variables 2018-11-14 17:04:04 +01:00
Deukhoofd 7e1edbe3f1
Properly handle scopes 2018-11-14 16:39:52 +01:00
Deukhoofd 82e13a85e2
Change Binder variable type if value is assigned to null variable, or null is assigned to a variable type 2018-11-14 13:58:12 +01:00
Deukhoofd 3efa6a6359
Adds Nil 2018-11-14 13:45:49 +01:00
Deukhoofd d34e5c85c7
Renamed Boolean to differentiate from system boolean type 2018-11-14 13:10:24 +01:00
Deukhoofd deefe43d9f
Reworked bound variables into specific LuaType class instead of anonymous objects 2018-11-14 13:09:01 +01:00
Deukhoofd dff1ddc0ba
Cleanup and reorganization 2018-11-14 12:44:44 +01:00
Deukhoofd bb5d8140e4
Initial work on compilation to C# 2018-11-13 17:11:20 +01:00
Deukhoofd b9aac52476
Handle if else if (else) statements 2018-11-13 15:15:44 +01:00
Deukhoofd 56f3777053
Handle if else statements 2018-11-13 13:54:51 +01:00
Deukhoofd 1aee448999
Handle if statements 2018-11-13 12:48:50 +01:00
Deukhoofd e5ac28bacf
Fix textspan of assignments 2018-11-12 17:55:06 +01:00
Deukhoofd 0d08ceda17
Removed refactored code 2018-11-12 17:54:43 +01:00
Deukhoofd 276b267045
Fix assignment type error throwing exception 2018-11-12 17:54:35 +01:00
Deukhoofd e9391193bb
Allow for blocks of statements, instead of only single statements 2018-11-12 17:45:50 +01:00
Deukhoofd ec7a32240f
Initial work on the concept of statements 2018-11-12 16:21:59 +01:00
Deukhoofd 3d811ff801
More work on variables 2018-11-11 21:03:50 +01:00
Deukhoofd 05d0de31a0
Bind Variables 2018-11-11 20:41:24 +01:00
Deukhoofd ac83dba77f
Binds Variable Assignment 2018-11-11 20:31:55 +01:00
Deukhoofd ce92348199
Binds parenthesized expressions 2018-11-11 20:00:06 +01:00
Deukhoofd 82dff87d4d
Bind unary operators 2018-11-11 19:56:53 +01:00
Deukhoofd 4e331712a8
Handle numbers fully as lua 2018-11-11 18:19:30 +01:00
Deukhoofd 3561979ded
Lots of work on type binding 2018-11-11 18:12:42 +01:00
Deukhoofd 699377cdfc
Work on Diagnostics 2018-11-11 10:26:52 +01:00
Deukhoofd ab61a01573
Handle variables 2018-11-10 17:00:39 +01:00
Deukhoofd 0693698f28
initial commit 2018-11-10 13:11:36 +01:00