Skip to content

Commit

Permalink
Abstract syntax, symbol table
Browse files Browse the repository at this point in the history
  • Loading branch information
julijaovcinnikova committed Nov 4, 2024
1 parent 4ac9954 commit 5a083fd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/imports/client/custom/vq/js/genAbstractQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,10 @@ async function resolveTypesAndBuildSymbolTable(query) {
} else {
// field without alias? We should somehow identify it
// obj_id + exp

my_scope_table.UNRESOLVED_NAME.push({id:obj_class.identification._id+f.exp, type:null, context:obj_class.identification._id});

let fName = f.exp;
if(fName.startsWith(":")) fName = fName.substring(1);
my_scope_table.UNRESOLVED_NAME.push({id:obj_class.identification._id+fName, type:null, context:obj_class.identification._id});
};
}

Expand Down Expand Up @@ -543,7 +545,8 @@ async function resolveTypesAndBuildSymbolTable(query) {
//update all entries of identifier name from context = sets kind and type (optional)
function updateSymbolTable(name, context, kind, type, parentType) {
_.each(symbol_table, function(name_list, current_context) {
if (name_list[name]) {

if (name_list[name]) {
let name_in_context = _.find(name_list[name], function(n) {return n.context == context} );
if (name_in_context) {
if (kind) {
Expand Down

0 comments on commit 5a083fd

Please sign in to comment.