Skip to content

Commit

Permalink
notes on why author annotation cannot take a team member
Browse files Browse the repository at this point in the history
  • Loading branch information
kburtch committed Dec 1, 2016
1 parent 9e72300 commit ab4cfc9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
2 changes: 0 additions & 2 deletions TODO
Expand Up @@ -15,9 +15,7 @@ cms requirements(ideas only)

[forked jobs in a pipeline aren't logging out because they think they
are in a login shell, in a login shell]
[src/spar was not recognized as a command...looked for 'src']
[--profile - profile but do not make a login session]
[annotations should be able to take a team member as an author]
[csrf example - this is a random token stored in the user's session,
changing each request It is encoded as base64 just to make it
compatible with HTML - numerics.md5( strings.image( numerics.rnd( 100000000 ) ) ) - the md5 is just to make it HTML compatible]
Expand Down
19 changes: 18 additions & 1 deletion src/builtins.adb.orig
Expand Up @@ -860,6 +860,8 @@ end vm;
annotate_str : constant unbounded_string := to_unbounded_string( "annotate" );
refactor_str : constant unbounded_string := to_unbounded_string( "refactor" );

--authorId : identifier := eof_t;

function ParsePragmaKindAsHelp return unbounded_string is
pragmaKind : unbounded_string;
begin
Expand Down Expand Up @@ -1023,6 +1025,15 @@ end vm;
discardUnusedIdentifier( token );
getNextToken;
expect( symbol_t, "," );
-- handle a teams.member variable for an author
-- declarations don't happen so this doesn't work.
--if token /= strlit_t then
-- if identifiers( token ).class = VarClass then
-- if getBaseType( identifiers( token ).kind ) = teams_member_t then
-- ParseIdentifier( authorId );
-- end if;
-- end if;
--end if;
elsif identifiers( token ).name = to_unbounded_string( "bugs" ) then
if last_tag = "bugs" then
info := null_unbounded_string;
Expand Down Expand Up @@ -1194,7 +1205,13 @@ end vm;
else
info := null_unbounded_string;
end if;
ParseStaticExpression( exprVal, exprType );
--if authorId = eof_t then
ParseStaticExpression( exprVal, exprType );
--else
-- don't let it carry over for multiple authors
-- authorId := eof_t;
--end if;
--ParseStaticExpression( exprVal, exprType );
if HTMLoutput then
if length( exprVal ) = 0 then
info := info & "<br>&nbsp;";
Expand Down
21 changes: 19 additions & 2 deletions src/parser_pragmas.adb
Expand Up @@ -242,6 +242,7 @@ procedure ParseAnnotateKind is
name : string := to_string( identifiers( token ).name );
exprVal : unbounded_string;
exprType : identifier;
--authorId : identifier := eof_t;
begin
annotationsFound := true;
if token /= strlit_t and token /= charlit_t and not identifiers( token ).static then
Expand All @@ -265,8 +266,24 @@ begin
expect( symbol_t, "," );
end if;
end if;
ParseStaticExpression( exprVal, exprType );
baseTypesOK( exprType, uni_string_t );
-- allow a team.member variable for the author
-- This doesn't work because variables aren't declared when help runs and
-- parses output.
-- note: a string literal is also treated as a variable...
--if name = "author" then
--if token /= strlit_t then
-- if identifiers( token ).class = VarClass then
-- if getBaseType( identifiers( token ).kind ) = teams_member_t then
-- ParseIdentifier( authorId );
-- end if;
-- end if;
--end if;
--end if;
-- Otherwise, author is an expression
--if authorId = eof_t then
ParseStaticExpression( exprVal, exprType );
baseTypesOK( exprType, uni_string_t );
--end if;
end ParseAnnotateKind;

-- PARSE IMPORT KIND
Expand Down

0 comments on commit ab4cfc9

Please sign in to comment.